aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/asm-alpha/topology.h3
-rw-r--r--include/asm-arm/arch-at91/at91_ecc.h10
-rw-r--r--include/asm-arm/arch-at91/at91_pmc.h15
-rw-r--r--include/asm-arm/arch-at91/at91_shdwc.h2
-rw-r--r--include/asm-arm/arch-at91/at91cap9_ddrsdr.h100
-rw-r--r--include/asm-arm/arch-at91/at91sam9_sdramc.h (renamed from include/asm-arm/arch-at91/at91sam926x_mc.h)68
-rw-r--r--include/asm-arm/arch-at91/at91sam9_smc.h73
-rw-r--r--include/asm-arm/arch-ep93xx/gpio.h21
-rw-r--r--include/asm-arm/arch-ks8695/devices.h5
-rw-r--r--include/asm-arm/arch-mxc/board-mx31ads.h124
-rw-r--r--include/asm-arm/arch-mxc/dma.h7
-rw-r--r--include/asm-arm/arch-mxc/hardware.h33
-rw-r--r--include/asm-arm/arch-mxc/io.h15
-rw-r--r--include/asm-arm/arch-mxc/irqs.h21
-rw-r--r--include/asm-arm/arch-mxc/memory.h13
-rw-r--r--include/asm-arm/arch-mxc/mx31.h30
-rw-r--r--include/asm-arm/arch-mxc/mxc.h11
-rw-r--r--include/asm-arm/arch-mxc/system.h18
-rw-r--r--include/asm-arm/arch-mxc/vmalloc.h14
-rw-r--r--include/asm-arm/arch-ns9xxx/board.h28
-rw-r--r--include/asm-arm/arch-ns9xxx/clock.h71
-rw-r--r--include/asm-arm/arch-ns9xxx/entry-macro.S6
-rw-r--r--include/asm-arm/arch-ns9xxx/irqs.h67
-rw-r--r--include/asm-arm/arch-ns9xxx/module.h60
-rw-r--r--include/asm-arm/arch-ns9xxx/processor-ns9360.h32
-rw-r--r--include/asm-arm/arch-ns9xxx/processor.h31
-rw-r--r--include/asm-arm/arch-ns9xxx/regs-sys-common.h31
-rw-r--r--include/asm-arm/arch-ns9xxx/regs-sys-ns9360.h (renamed from include/asm-arm/arch-ns9xxx/regs-sys.h)25
-rw-r--r--include/asm-arm/arch-ns9xxx/system.h17
-rw-r--r--include/asm-arm/arch-ns9xxx/uncompress.h143
-rw-r--r--include/asm-arm/arch-omap/board-osk.h11
-rw-r--r--include/asm-arm/arch-omap/clock.h75
-rw-r--r--include/asm-arm/arch-omap/control.h191
-rw-r--r--include/asm-arm/arch-omap/entry-macro.S2
-rw-r--r--include/asm-arm/arch-omap/gpio.h57
-rw-r--r--include/asm-arm/arch-omap/io.h70
-rw-r--r--include/asm-arm/arch-omap/mux.h66
-rw-r--r--include/asm-arm/arch-omap/omap24xx.h96
-rw-r--r--include/asm-arm/arch-omap/sdrc.h75
-rw-r--r--include/asm-arm/arch-omap/usb.h5
-rw-r--r--include/asm-arm/arch-orion/io.h27
-rw-r--r--include/asm-arm/arch-orion/irqs.h61
-rw-r--r--include/asm-arm/arch-orion/orion.h165
-rw-r--r--include/asm-arm/arch-orion/timex.h12
-rw-r--r--include/asm-arm/arch-orion5x/debug-macro.S (renamed from include/asm-arm/arch-orion/debug-macro.S)8
-rw-r--r--include/asm-arm/arch-orion5x/dma.h (renamed from include/asm-arm/arch-orion/dma.h)0
-rw-r--r--include/asm-arm/arch-orion5x/entry-macro.S (renamed from include/asm-arm/arch-orion/entry-macro.S)4
-rw-r--r--include/asm-arm/arch-orion5x/gpio.h (renamed from include/asm-arm/arch-orion/gpio.h)8
-rw-r--r--include/asm-arm/arch-orion5x/hardware.h (renamed from include/asm-arm/arch-orion/hardware.h)10
-rw-r--r--include/asm-arm/arch-orion5x/io.h68
-rw-r--r--include/asm-arm/arch-orion5x/irqs.h62
-rw-r--r--include/asm-arm/arch-orion5x/memory.h (renamed from include/asm-arm/arch-orion/memory.h)7
-rw-r--r--include/asm-arm/arch-orion5x/orion5x.h159
-rw-r--r--include/asm-arm/arch-orion5x/system.h (renamed from include/asm-arm/arch-orion/system.h)13
-rw-r--r--include/asm-arm/arch-orion5x/timex.h13
-rw-r--r--include/asm-arm/arch-orion5x/uncompress.h (renamed from include/asm-arm/arch-orion/uncompress.h)8
-rw-r--r--include/asm-arm/arch-orion5x/vmalloc.h (renamed from include/asm-arm/arch-orion/vmalloc.h)2
-rw-r--r--include/asm-arm/arch-pxa/camera.h48
-rw-r--r--include/asm-arm/arch-pxa/gumstix.h96
-rw-r--r--include/asm-arm/arch-pxa/irda.h2
-rw-r--r--include/asm-arm/arch-pxa/irqs.h3
-rw-r--r--include/asm-arm/arch-pxa/magician.h57
-rw-r--r--include/asm-arm/arch-pxa/mfp-pxa25x.h161
-rw-r--r--include/asm-arm/arch-pxa/mfp-pxa27x.h432
-rw-r--r--include/asm-arm/arch-pxa/mfp-pxa2xx.h132
-rw-r--r--include/asm-arm/arch-pxa/pxa-regs.h330
-rw-r--r--include/asm-arm/arch-pxa/pxa27x_keypad.h2
-rw-r--r--include/asm-arm/arch-pxa/pxa2xx-gpio.h357
-rw-r--r--include/asm-arm/arch-pxa/pxa3xx-regs.h9
-rw-r--r--include/asm-arm/arch-pxa/tosa.h40
-rw-r--r--include/asm-arm/arch-pxa/zylonite.h2
-rw-r--r--include/asm-arm/arch-realview/board-eb.h20
-rw-r--r--include/asm-arm/arch-realview/board-pb1176.h152
-rw-r--r--include/asm-arm/arch-realview/board-pb11mp.h186
-rw-r--r--include/asm-arm/arch-realview/debug-macro.S2
-rw-r--r--include/asm-arm/arch-realview/hardware.h2
-rw-r--r--include/asm-arm/arch-realview/irqs.h2
-rw-r--r--include/asm-arm/arch-realview/platform.h27
-rw-r--r--include/asm-arm/arch-realview/scu.h11
-rw-r--r--include/asm-arm/arch-realview/uncompress.h38
-rw-r--r--include/asm-arm/arch-s3c2410/regs-clock.h2
-rw-r--r--include/asm-arm/arch-s3c2410/regs-gpio.h4
-rw-r--r--include/asm-arm/arch-s3c2410/regs-s3c2412-mem.h29
-rw-r--r--include/asm-arm/arch-s3c2410/system-reset.h64
-rw-r--r--include/asm-arm/arch-s3c2410/system.h46
-rw-r--r--include/asm-arm/arch-sa1100/gpio.h31
-rw-r--r--include/asm-arm/cpu-multi32.h4
-rw-r--r--include/asm-arm/glue.h87
-rw-r--r--include/asm-arm/hardware/arm_scu.h15
-rw-r--r--include/asm-arm/hardware/iop3xx-adma.h4
-rw-r--r--include/asm-arm/hardware/iop3xx.h9
-rw-r--r--include/asm-arm/hardware/scoop.h5
-rw-r--r--include/asm-arm/hwcap.h1
-rw-r--r--include/asm-arm/mach/pci.h1
-rw-r--r--include/asm-arm/memory.h3
-rw-r--r--include/asm-arm/plat-orion/ehci-orion.h19
-rw-r--r--include/asm-arm/plat-orion/irq.h17
-rw-r--r--include/asm-arm/plat-orion/orion_nand.h (renamed from include/asm-arm/arch-orion/platform.h)11
-rw-r--r--include/asm-arm/plat-orion/pcie.h31
-rw-r--r--include/asm-arm/plat-orion/time.h17
-rw-r--r--include/asm-arm/sparsemem.h10
-rw-r--r--include/asm-arm/thread_info.h3
-rw-r--r--include/asm-arm/unistd.h4
-rw-r--r--include/asm-avr32/arch-at32ap/board.h9
-rw-r--r--include/asm-avr32/arch-at32ap/pm.h48
-rw-r--r--include/asm-avr32/arch-at32ap/time.h112
-rw-r--r--include/asm-avr32/asm.h8
-rw-r--r--include/asm-avr32/intc.h128
-rw-r--r--include/asm-avr32/irq.h5
-rw-r--r--include/asm-avr32/page.h8
-rw-r--r--include/asm-avr32/serial.h13
-rw-r--r--include/asm-avr32/xor.h6
-rw-r--r--include/asm-blackfin/dma.h1
-rw-r--r--include/asm-frv/system.h5
-rw-r--r--include/asm-frv/topology.h4
-rw-r--r--include/asm-generic/topology.h14
-rw-r--r--include/asm-ia64/sn/nodepda.h1
-rw-r--r--include/asm-ia64/topology.h7
-rw-r--r--include/asm-powerpc/Kbuild2
-rw-r--r--include/asm-powerpc/abs_addr.h3
-rw-r--r--include/asm-powerpc/bitops.h32
-rw-r--r--include/asm-powerpc/cpm.h14
-rw-r--r--include/asm-powerpc/cpm1.h13
-rw-r--r--include/asm-powerpc/cpm2.h11
-rw-r--r--include/asm-powerpc/cputhreads.h2
-rw-r--r--include/asm-powerpc/dcr-native.h17
-rw-r--r--include/asm-powerpc/dcr-regs.h78
-rw-r--r--include/asm-powerpc/exception.h6
-rw-r--r--include/asm-powerpc/fsl_lbc.h311
-rw-r--r--include/asm-powerpc/gpio.h56
-rw-r--r--include/asm-powerpc/hw_irq.h13
-rw-r--r--include/asm-powerpc/immap_qe.h3
-rw-r--r--include/asm-powerpc/irqflags.h37
-rw-r--r--include/asm-powerpc/iseries/alpaca.h31
-rw-r--r--include/asm-powerpc/iseries/it_lp_reg_save.h85
-rw-r--r--include/asm-powerpc/lmb.h82
-rw-r--r--include/asm-powerpc/machdep.h5
-rw-r--r--include/asm-powerpc/macio.h2
-rw-r--r--include/asm-powerpc/mmu-40x.h2
-rw-r--r--include/asm-powerpc/mmu-44x.h2
-rw-r--r--include/asm-powerpc/mmu-8xx.h2
-rw-r--r--include/asm-powerpc/mmu-fsl-booke.h6
-rw-r--r--include/asm-powerpc/mmu-hash32.h2
-rw-r--r--include/asm-powerpc/mmu-hash64.h3
-rw-r--r--include/asm-powerpc/paca.h12
-rw-r--r--include/asm-powerpc/page.h1
-rw-r--r--include/asm-powerpc/page_32.h2
-rw-r--r--include/asm-powerpc/pasemi_dma.h77
-rw-r--r--include/asm-powerpc/pci-bridge.h4
-rw-r--r--include/asm-powerpc/pgtable-ppc32.h8
-rw-r--r--include/asm-powerpc/phyp_dump.h47
-rw-r--r--include/asm-powerpc/pmi.h2
-rw-r--r--include/asm-powerpc/ppc4xx.h18
-rw-r--r--include/asm-powerpc/ps3.h7
-rw-r--r--include/asm-powerpc/ptrace.h9
-rw-r--r--include/asm-powerpc/qe.h12
-rw-r--r--include/asm-powerpc/rwsem.h35
-rw-r--r--include/asm-powerpc/sparsemem.h1
-rw-r--r--include/asm-powerpc/spinlock.h1
-rw-r--r--include/asm-powerpc/string.h2
-rw-r--r--include/asm-powerpc/system.h1
-rw-r--r--include/asm-powerpc/topology.h3
-rw-r--r--include/asm-powerpc/types.h7
-rw-r--r--include/asm-ppc/ocp.h1
-rw-r--r--include/asm-sh/bugs.h2
-rw-r--r--include/asm-sh/cpu-sh4/freq.h6
-rw-r--r--include/asm-sh/cpu-sh4/rtc.h5
-rw-r--r--include/asm-sh/migor.h58
-rw-r--r--include/asm-sh/mpc1211/pci.h2
-rw-r--r--include/asm-sh/processor.h5
-rw-r--r--include/asm-sh/r7780rp.h22
-rw-r--r--include/asm-sh/se7721.h70
-rw-r--r--include/asm-sh/se7722.h2
-rw-r--r--include/asm-sh/sh_keysc.h13
-rw-r--r--include/asm-sh/system.h2
-rw-r--r--include/asm-sh/topology.h2
-rw-r--r--include/asm-sh/uaccess_32.h5
-rw-r--r--include/asm-sparc/Kbuild1
-rw-r--r--include/asm-sparc/a.out-core.h52
-rw-r--r--include/asm-sparc/a.out.h97
-rw-r--r--include/asm-sparc/floppy.h2
-rw-r--r--include/asm-sparc/head.h33
-rw-r--r--include/asm-sparc/ioctls.h2
-rw-r--r--include/asm-sparc/mman.h13
-rw-r--r--include/asm-sparc/namei.h15
-rw-r--r--include/asm-sparc/pconf.h25
-rw-r--r--include/asm-sparc/processor.h3
-rw-r--r--include/asm-sparc/socket.h3
-rw-r--r--include/asm-sparc/solerrno.h132
-rw-r--r--include/asm-sparc/svr4.h119
-rw-r--r--include/asm-sparc/termios.h5
-rw-r--r--include/asm-sparc/user.h56
-rw-r--r--include/asm-sparc64/Kbuild1
-rw-r--r--include/asm-sparc64/a.out-core.h31
-rw-r--r--include/asm-sparc64/a.out.h1
-rw-r--r--include/asm-sparc64/ioctls.h2
-rw-r--r--include/asm-sparc64/lmb.h10
-rw-r--r--include/asm-sparc64/mman.h13
-rw-r--r--include/asm-sparc64/namei.h15
-rw-r--r--include/asm-sparc64/pconf.h25
-rw-r--r--include/asm-sparc64/socket.h3
-rw-r--r--include/asm-sparc64/solerrno.h132
-rw-r--r--include/asm-sparc64/svr4.h120
-rw-r--r--include/asm-sparc64/termios.h5
-rw-r--r--include/asm-sparc64/ttable.h18
-rw-r--r--include/asm-sparc64/unistd.h10
-rw-r--r--include/asm-sparc64/user.h61
-rw-r--r--include/asm-x86/boot.h8
-rw-r--r--include/asm-x86/dma-mapping.h238
-rw-r--r--include/asm-x86/dma-mapping_32.h187
-rw-r--r--include/asm-x86/dma-mapping_64.h202
-rw-r--r--include/asm-x86/e820_32.h2
-rw-r--r--include/asm-x86/genapic_32.h1
-rw-r--r--include/asm-x86/i387.h37
-rw-r--r--include/asm-x86/numa_64.h3
-rw-r--r--include/asm-x86/pci_64.h1
-rw-r--r--include/asm-x86/processor.h16
-rw-r--r--include/asm-x86/scatterlist.h2
-rw-r--r--include/asm-x86/thread_info.h9
-rw-r--r--include/asm-x86/thread_info_32.h2
-rw-r--r--include/asm-x86/thread_info_64.h6
-rw-r--r--include/asm-x86/topology.h22
-rw-r--r--include/asm-x86/tsc.h1
-rw-r--r--include/crypto/aes.h8
-rw-r--r--include/keys/rxrpc-type.h2
-rw-r--r--include/linux/Kbuild3
-rw-r--r--include/linux/aer.h5
-rw-r--r--include/linux/arcdevice.h4
-rw-r--r--include/linux/ata_platform.h3
-rw-r--r--include/linux/atalk.h2
-rw-r--r--include/linux/atmel_tc.h252
-rw-r--r--include/linux/attribute_container.h30
-rw-r--r--include/linux/audit.h29
-rw-r--r--include/linux/bio.h2
-rw-r--r--include/linux/bitmap.h1
-rw-r--r--include/linux/blkdev.h9
-rw-r--r--include/linux/bsg.h2
-rw-r--r--include/linux/cdrom.h5
-rw-r--r--include/linux/cpu.h1
-rw-r--r--include/linux/cpumask.h25
-rw-r--r--include/linux/cpuset.h13
-rw-r--r--include/linux/crypto.h7
-rw-r--r--include/linux/device.h37
-rw-r--r--include/linux/dmaengine.h2
-rw-r--r--include/linux/efi.h7
-rw-r--r--include/linux/enclosure.h11
-rw-r--r--include/linux/file.h1
-rw-r--r--include/linux/filter.h35
-rw-r--r--include/linux/fs.h54
-rw-r--r--include/linux/fsl_devices.h2
-rw-r--r--include/linux/hil_mlc.h2
-rw-r--r--include/linux/hw_random.h10
-rw-r--r--include/linux/i2c/tps65010.h30
-rw-r--r--include/linux/i2o.h2
-rw-r--r--include/linux/icmpv6.h11
-rw-r--r--include/linux/ide.h1
-rw-r--r--include/linux/ieee80211.h35
-rw-r--r--include/linux/if_arp.h6
-rw-r--r--include/linux/if_pppox.h1
-rw-r--r--include/linux/if_tunnel.h22
-rw-r--r--include/linux/if_vlan.h6
-rw-r--r--include/linux/if_wanpipe.h124
-rw-r--r--include/linux/igmp.h38
-rw-r--r--include/linux/in6.h34
-rw-r--r--include/linux/inetdevice.h8
-rw-r--r--include/linux/init_task.h3
-rw-r--r--include/linux/ioport.h5
-rw-r--r--include/linux/ipv6.h48
-rw-r--r--include/linux/irqflags.h6
-rw-r--r--include/linux/iscsi_ibft.h50
-rw-r--r--include/linux/isdn.h6
-rw-r--r--include/linux/jbd.h2
-rw-r--r--include/linux/jbd2.h2
-rw-r--r--include/linux/jiffies.h18
-rw-r--r--include/linux/kernel.h6
-rw-r--r--include/linux/kernelcapi.h1
-rw-r--r--include/linux/ktime.h6
-rw-r--r--include/linux/leds.h10
-rw-r--r--include/linux/libata.h2
-rw-r--r--include/linux/list.h48
-rw-r--r--include/linux/lmb.h85
-rw-r--r--include/linux/mbus.h36
-rw-r--r--include/linux/memory.h5
-rw-r--r--include/linux/memstick.h2
-rw-r--r--include/linux/mfd/htc-egpio.h57
-rw-r--r--include/linux/mfd/htc-pasic3.h55
-rw-r--r--include/linux/miscdevice.h10
-rw-r--r--include/linux/mmzone.h1
-rw-r--r--include/linux/mount.h11
-rw-r--r--include/linux/mroute.h25
-rw-r--r--include/linux/mroute6.h228
-rw-r--r--include/linux/mtio.h1
-rw-r--r--include/linux/net.h3
-rw-r--r--include/linux/netdevice.h36
-rw-r--r--include/linux/netfilter.h85
-rw-r--r--include/linux/netfilter/nf_conntrack_dccp.h40
-rw-r--r--include/linux/netfilter/nf_conntrack_sip.h185
-rw-r--r--include/linux/netfilter/nfnetlink_conntrack.h8
-rw-r--r--include/linux/netfilter/x_tables.h4
-rw-r--r--include/linux/netfilter/xt_sctp.h84
-rw-r--r--include/linux/netfilter_arp/arp_tables.h17
-rw-r--r--include/linux/netfilter_bridge/ebt_nflog.h21
-rw-r--r--include/linux/netfilter_ipv4.h2
-rw-r--r--include/linux/nl80211.h218
-rw-r--r--include/linux/of.h1
-rw-r--r--include/linux/of_gpio.h69
-rw-r--r--include/linux/of_i2c.h24
-rw-r--r--include/linux/parport.h2
-rw-r--r--include/linux/pci-aspm.h56
-rw-r--r--include/linux/pci.h30
-rw-r--r--include/linux/pci_regs.h8
-rw-r--r--include/linux/pcounter.h74
-rw-r--r--include/linux/phy.h61
-rw-r--r--include/linux/pim.h45
-rw-r--r--include/linux/pm.h43
-rw-r--r--include/linux/pm_wakeup.h90
-rw-r--r--include/linux/prctl.h6
-rw-r--r--include/linux/raid/md.h1
-rw-r--r--include/linux/raid_class.h12
-rw-r--r--include/linux/scatterlist.h5
-rw-r--r--include/linux/sched.h57
-rw-r--r--include/linux/security.h162
-rw-r--r--include/linux/selinux.h134
-rw-r--r--include/linux/seq_file.h13
-rw-r--r--include/linux/seq_file_net.h27
-rw-r--r--include/linux/skbuff.h207
-rw-r--r--include/linux/smc91x.h13
-rw-r--r--include/linux/ssb/ssb.h50
-rw-r--r--include/linux/ssb/ssb_driver_chipcommon.h7
-rw-r--r--include/linux/ssb/ssb_driver_gige.h174
-rw-r--r--include/linux/ssb/ssb_driver_pci.h19
-rw-r--r--include/linux/syscalls.h1
-rw-r--r--include/linux/sysdev.h17
-rw-r--r--include/linux/sysfs.h9
-rw-r--r--include/linux/tcp.h7
-rw-r--r--include/linux/topology.h46
-rw-r--r--include/linux/transport_class.h11
-rw-r--r--include/linux/udp.h19
-rw-r--r--include/linux/usb/atmel_usba_udc.h22
-rw-r--r--include/linux/wireless.h1
-rw-r--r--include/linux/xfrm.h3
-rw-r--r--include/net/addrconf.h122
-rw-r--r--include/net/cfg80211.h159
-rw-r--r--include/net/dst.h10
-rw-r--r--include/net/fib_rules.h1
-rw-r--r--include/net/icmp.h9
-rw-r--r--include/net/ieee80211.h1
-rw-r--r--include/net/ieee80211softmac.h373
-rw-r--r--include/net/ieee80211softmac_wx.h99
-rw-r--r--include/net/inet_common.h11
-rw-r--r--include/net/inet_connection_sock.h5
-rw-r--r--include/net/inet_frag.h6
-rw-r--r--include/net/inet_hashtables.h29
-rw-r--r--include/net/inet_sock.h7
-rw-r--r--include/net/inet_timewait_sock.h18
-rw-r--r--include/net/ip.h10
-rw-r--r--include/net/ip6_fib.h18
-rw-r--r--include/net/ip6_route.h56
-rw-r--r--include/net/ipip.h10
-rw-r--r--include/net/ipv6.h84
-rw-r--r--include/net/irda/irlan_eth.h1
-rw-r--r--include/net/llc_if.h5
-rw-r--r--include/net/mac80211.h560
-rw-r--r--include/net/mip6.h3
-rw-r--r--include/net/ndisc.h31
-rw-r--r--include/net/neighbour.h31
-rw-r--r--include/net/net_namespace.h75
-rw-r--r--include/net/netfilter/nf_conntrack.h39
-rw-r--r--include/net/netfilter/nf_conntrack_core.h4
-rw-r--r--include/net/netfilter/nf_conntrack_expect.h22
-rw-r--r--include/net/netfilter/nf_conntrack_helper.h5
-rw-r--r--include/net/netfilter/nf_conntrack_l3proto.h19
-rw-r--r--include/net/netfilter/nf_conntrack_l4proto.h13
-rw-r--r--include/net/netfilter/nf_conntrack_tuple.h96
-rw-r--r--include/net/netfilter/nf_nat_helper.h3
-rw-r--r--include/net/netfilter/nf_nat_protocol.h46
-rw-r--r--include/net/netfilter/nf_nat_rule.h3
-rw-r--r--include/net/netlabel.h14
-rw-r--r--include/net/netns/core.h16
-rw-r--r--include/net/netns/dccp.h11
-rw-r--r--include/net/netns/generic.h49
-rw-r--r--include/net/netns/ipv4.h11
-rw-r--r--include/net/netns/ipv6.h18
-rw-r--r--include/net/pkt_cls.h2
-rw-r--r--include/net/protocol.h3
-rw-r--r--include/net/raw.h4
-rw-r--r--include/net/request_sock.h9
-rw-r--r--include/net/route.h5
-rw-r--r--include/net/rtnetlink.h1
-rw-r--r--include/net/sctp/command.h3
-rw-r--r--include/net/sctp/sctp.h5
-rw-r--r--include/net/sctp/sm.h8
-rw-r--r--include/net/sctp/structs.h10
-rw-r--r--include/net/sock.h118
-rw-r--r--include/net/tcp.h35
-rw-r--r--include/net/tipc/tipc_bearer.h9
-rw-r--r--include/net/tipc/tipc_port.h13
-rw-r--r--include/net/udp.h15
-rw-r--r--include/net/wireless.h186
-rw-r--r--include/net/xfrm.h69
-rw-r--r--include/rdma/ib_verbs.h2
-rw-r--r--include/scsi/iscsi_proto.h6
-rw-r--r--include/scsi/libsas.h3
-rw-r--r--include/scsi/sas_ata.h4
-rw-r--r--include/scsi/scsi_cmnd.h17
-rw-r--r--include/scsi/scsi_device.h10
-rw-r--r--include/scsi/scsi_eh.h5
-rw-r--r--include/scsi/scsi_host.h8
-rw-r--r--include/scsi/scsi_transport.h2
-rw-r--r--include/scsi/scsi_transport_fc.h14
-rw-r--r--include/scsi/scsi_transport_sas.h12
-rw-r--r--include/scsi/sd.h4
412 files changed, 9161 insertions, 5636 deletions
diff --git a/include/asm-alpha/topology.h b/include/asm-alpha/topology.h
index 420ccde6b916..149532e162c4 100644
--- a/include/asm-alpha/topology.h
+++ b/include/asm-alpha/topology.h
@@ -41,8 +41,7 @@ static inline cpumask_t node_to_cpumask(int node)
41 41
42#define pcibus_to_cpumask(bus) (cpu_online_map) 42#define pcibus_to_cpumask(bus) (cpu_online_map)
43 43
44#else /* CONFIG_NUMA */
45# include <asm-generic/topology.h>
46#endif /* !CONFIG_NUMA */ 44#endif /* !CONFIG_NUMA */
45# include <asm-generic/topology.h>
47 46
48#endif /* _ASM_ALPHA_TOPOLOGY_H */ 47#endif /* _ASM_ALPHA_TOPOLOGY_H */
diff --git a/include/asm-arm/arch-at91/at91_ecc.h b/include/asm-arm/arch-at91/at91_ecc.h
index ff93df516d6d..1e5a8caca2d1 100644
--- a/include/asm-arm/arch-at91/at91_ecc.h
+++ b/include/asm-arm/arch-at91/at91_ecc.h
@@ -13,26 +13,26 @@
13#ifndef AT91_ECC_H 13#ifndef AT91_ECC_H
14#define AT91_ECC_H 14#define AT91_ECC_H
15 15
16#define AT91_ECC_CR (AT91_ECC + 0x00) /* Control register */ 16#define AT91_ECC_CR 0x00 /* Control register */
17#define AT91_ECC_RST (1 << 0) /* Reset parity */ 17#define AT91_ECC_RST (1 << 0) /* Reset parity */
18 18
19#define AT91_ECC_MR (AT91_ECC + 0x04) /* Mode register */ 19#define AT91_ECC_MR 0x04 /* Mode register */
20#define AT91_ECC_PAGESIZE (3 << 0) /* Page Size */ 20#define AT91_ECC_PAGESIZE (3 << 0) /* Page Size */
21#define AT91_ECC_PAGESIZE_528 (0) 21#define AT91_ECC_PAGESIZE_528 (0)
22#define AT91_ECC_PAGESIZE_1056 (1) 22#define AT91_ECC_PAGESIZE_1056 (1)
23#define AT91_ECC_PAGESIZE_2112 (2) 23#define AT91_ECC_PAGESIZE_2112 (2)
24#define AT91_ECC_PAGESIZE_4224 (3) 24#define AT91_ECC_PAGESIZE_4224 (3)
25 25
26#define AT91_ECC_SR (AT91_ECC + 0x08) /* Status register */ 26#define AT91_ECC_SR 0x08 /* Status register */
27#define AT91_ECC_RECERR (1 << 0) /* Recoverable Error */ 27#define AT91_ECC_RECERR (1 << 0) /* Recoverable Error */
28#define AT91_ECC_ECCERR (1 << 1) /* ECC Single Bit Error */ 28#define AT91_ECC_ECCERR (1 << 1) /* ECC Single Bit Error */
29#define AT91_ECC_MULERR (1 << 2) /* Multiple Errors */ 29#define AT91_ECC_MULERR (1 << 2) /* Multiple Errors */
30 30
31#define AT91_ECC_PR (AT91_ECC + 0x0c) /* Parity register */ 31#define AT91_ECC_PR 0x0c /* Parity register */
32#define AT91_ECC_BITADDR (0xf << 0) /* Bit Error Address */ 32#define AT91_ECC_BITADDR (0xf << 0) /* Bit Error Address */
33#define AT91_ECC_WORDADDR (0xfff << 4) /* Word Error Address */ 33#define AT91_ECC_WORDADDR (0xfff << 4) /* Word Error Address */
34 34
35#define AT91_ECC_NPR (AT91_ECC + 0x10) /* NParity register */ 35#define AT91_ECC_NPR 0x10 /* NParity register */
36#define AT91_ECC_NPARITY (0xffff << 0) /* NParity */ 36#define AT91_ECC_NPARITY (0xffff << 0) /* NParity */
37 37
38#endif 38#endif
diff --git a/include/asm-arm/arch-at91/at91_pmc.h b/include/asm-arm/arch-at91/at91_pmc.h
index 52cd8e5dabc9..c2b13c280155 100644
--- a/include/asm-arm/arch-at91/at91_pmc.h
+++ b/include/asm-arm/arch-at91/at91_pmc.h
@@ -76,10 +76,17 @@
76#define AT91_PMC_PRES_32 (5 << 2) 76#define AT91_PMC_PRES_32 (5 << 2)
77#define AT91_PMC_PRES_64 (6 << 2) 77#define AT91_PMC_PRES_64 (6 << 2)
78#define AT91_PMC_MDIV (3 << 8) /* Master Clock Division */ 78#define AT91_PMC_MDIV (3 << 8) /* Master Clock Division */
79#define AT91_PMC_MDIV_1 (0 << 8) 79#define AT91RM9200_PMC_MDIV_1 (0 << 8) /* [AT91RM9200 only] */
80#define AT91_PMC_MDIV_2 (1 << 8) 80#define AT91RM9200_PMC_MDIV_2 (1 << 8)
81#define AT91_PMC_MDIV_3 (2 << 8) 81#define AT91RM9200_PMC_MDIV_3 (2 << 8)
82#define AT91_PMC_MDIV_4 (3 << 8) 82#define AT91RM9200_PMC_MDIV_4 (3 << 8)
83#define AT91SAM9_PMC_MDIV_1 (0 << 8) /* [SAM9,CAP9 only] */
84#define AT91SAM9_PMC_MDIV_2 (1 << 8)
85#define AT91SAM9_PMC_MDIV_4 (2 << 8)
86#define AT91SAM9_PMC_MDIV_6 (3 << 8)
87#define AT91_PMC_PDIV (1 << 12) /* Processor Clock Division [some SAM9 only] */
88#define AT91_PMC_PDIV_1 (0 << 12)
89#define AT91_PMC_PDIV_2 (1 << 12)
83 90
84#define AT91_PMC_PCKR(n) (AT91_PMC + 0x40 + ((n) * 4)) /* Programmable Clock 0-3 Registers */ 91#define AT91_PMC_PCKR(n) (AT91_PMC + 0x40 + ((n) * 4)) /* Programmable Clock 0-3 Registers */
85 92
diff --git a/include/asm-arm/arch-at91/at91_shdwc.h b/include/asm-arm/arch-at91/at91_shdwc.h
index 01b433de2272..581fa41d90e8 100644
--- a/include/asm-arm/arch-at91/at91_shdwc.h
+++ b/include/asm-arm/arch-at91/at91_shdwc.h
@@ -24,10 +24,12 @@
24#define AT91_SHDW_WKMODE0_LOW 2 24#define AT91_SHDW_WKMODE0_LOW 2
25#define AT91_SHDW_WKMODE0_ANYLEVEL 3 25#define AT91_SHDW_WKMODE0_ANYLEVEL 3
26#define AT91_SHDW_CPTWK0 (0xf << 4) /* Counter On Wake Up 0 */ 26#define AT91_SHDW_CPTWK0 (0xf << 4) /* Counter On Wake Up 0 */
27#define AT91_SHDW_CPTWK0_(x) ((x) << 4)
27#define AT91_SHDW_RTTWKEN (1 << 16) /* Real Time Timer Wake-up Enable */ 28#define AT91_SHDW_RTTWKEN (1 << 16) /* Real Time Timer Wake-up Enable */
28 29
29#define AT91_SHDW_SR (AT91_SHDWC + 0x08) /* Shut Down Status Register */ 30#define AT91_SHDW_SR (AT91_SHDWC + 0x08) /* Shut Down Status Register */
30#define AT91_SHDW_WAKEUP0 (1 << 0) /* Wake-up 0 Status */ 31#define AT91_SHDW_WAKEUP0 (1 << 0) /* Wake-up 0 Status */
31#define AT91_SHDW_RTTWK (1 << 16) /* Real-time Timer Wake-up */ 32#define AT91_SHDW_RTTWK (1 << 16) /* Real-time Timer Wake-up */
33#define AT91_SHDW_RTCWK (1 << 17) /* Real-time Clock Wake-up [SAM9RL] */
32 34
33#endif 35#endif
diff --git a/include/asm-arm/arch-at91/at91cap9_ddrsdr.h b/include/asm-arm/arch-at91/at91cap9_ddrsdr.h
new file mode 100644
index 000000000000..efdb23af1ee4
--- /dev/null
+++ b/include/asm-arm/arch-at91/at91cap9_ddrsdr.h
@@ -0,0 +1,100 @@
1/*
2 * include/asm-arm/arch-at91/at91cap9_ddrsdr.h
3 *
4 * DDR/SDR Controller (DDRSDRC) - System peripherals registers.
5 * Based on AT91CAP9 datasheet revision B.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 */
12
13#ifndef AT91CAP9_DDRSDR_H
14#define AT91CAP9_DDRSDR_H
15
16#define AT91_DDRSDRC_MR (AT91_DDRSDRC + 0x00) /* Mode Register */
17#define AT91_DDRSDRC_MODE (0xf << 0) /* Command Mode */
18#define AT91_DDRSDRC_MODE_NORMAL 0
19#define AT91_DDRSDRC_MODE_NOP 1
20#define AT91_DDRSDRC_MODE_PRECHARGE 2
21#define AT91_DDRSDRC_MODE_LMR 3
22#define AT91_DDRSDRC_MODE_REFRESH 4
23#define AT91_DDRSDRC_MODE_EXT_LMR 5
24#define AT91_DDRSDRC_MODE_DEEP 6
25
26#define AT91_DDRSDRC_RTR (AT91_DDRSDRC + 0x04) /* Refresh Timer Register */
27#define AT91_DDRSDRC_COUNT (0xfff << 0) /* Refresh Timer Counter */
28
29#define AT91_DDRSDRC_CR (AT91_DDRSDRC + 0x08) /* Configuration Register */
30#define AT91_DDRSDRC_NC (3 << 0) /* Number of Column Bits */
31#define AT91_DDRSDRC_NC_SDR8 (0 << 0)
32#define AT91_DDRSDRC_NC_SDR9 (1 << 0)
33#define AT91_DDRSDRC_NC_SDR10 (2 << 0)
34#define AT91_DDRSDRC_NC_SDR11 (3 << 0)
35#define AT91_DDRSDRC_NC_DDR9 (0 << 0)
36#define AT91_DDRSDRC_NC_DDR10 (1 << 0)
37#define AT91_DDRSDRC_NC_DDR11 (2 << 0)
38#define AT91_DDRSDRC_NC_DDR12 (3 << 0)
39#define AT91_DDRSDRC_NR (3 << 2) /* Number of Row Bits */
40#define AT91_DDRSDRC_NR_11 (0 << 2)
41#define AT91_DDRSDRC_NR_12 (1 << 2)
42#define AT91_DDRSDRC_NR_13 (2 << 2)
43#define AT91_DDRSDRC_CAS (7 << 4) /* CAS Latency */
44#define AT91_DDRSDRC_CAS_2 (2 << 4)
45#define AT91_DDRSDRC_CAS_3 (3 << 4)
46#define AT91_DDRSDRC_CAS_25 (6 << 4)
47#define AT91_DDRSDRC_DLL (1 << 7) /* Reset DLL */
48#define AT91_DDRSDRC_DICDS (1 << 8) /* Output impedance control */
49
50#define AT91_DDRSDRC_T0PR (AT91_DDRSDRC + 0x0C) /* Timing 0 Register */
51#define AT91_DDRSDRC_TRAS (0xf << 0) /* Active to Precharge delay */
52#define AT91_DDRSDRC_TRCD (0xf << 4) /* Row to Column delay */
53#define AT91_DDRSDRC_TWR (0xf << 8) /* Write recovery delay */
54#define AT91_DDRSDRC_TRC (0xf << 12) /* Row cycle delay */
55#define AT91_DDRSDRC_TRP (0xf << 16) /* Row precharge delay */
56#define AT91_DDRSDRC_TRRD (0xf << 20) /* Active BankA to BankB */
57#define AT91_DDRSDRC_TWTR (1 << 24) /* Internal Write to Read delay */
58#define AT91_DDRSDRC_TMRD (0xf << 28) /* Load mode to active/refresh delay */
59
60#define AT91_DDRSDRC_T1PR (AT91_DDRSDRC + 0x10) /* Timing 1 Register */
61#define AT91_DDRSDRC_TRFC (0x1f << 0) /* Row Cycle Delay */
62#define AT91_DDRSDRC_TXSNR (0xff << 8) /* Exit self-refresh to non-read */
63#define AT91_DDRSDRC_TXSRD (0xff << 16) /* Exit self-refresh to read */
64#define AT91_DDRSDRC_TXP (0xf << 24) /* Exit power-down delay */
65
66#define AT91_DDRSDRC_LPR (AT91_DDRSDRC + 0x18) /* Low Power Register */
67#define AT91_DDRSDRC_LPCB (3 << 0) /* Low-power Configurations */
68#define AT91_DDRSDRC_LPCB_DISABLE 0
69#define AT91_DDRSDRC_LPCB_SELF_REFRESH 1
70#define AT91_DDRSDRC_LPCB_POWER_DOWN 2
71#define AT91_DDRSDRC_LPCB_DEEP_POWER_DOWN 3
72#define AT91_DDRSDRC_CLKFR (1 << 2) /* Clock Frozen */
73#define AT91_DDRSDRC_PASR (7 << 4) /* Partial Array Self Refresh */
74#define AT91_DDRSDRC_TCSR (3 << 8) /* Temperature Compensated Self Refresh */
75#define AT91_DDRSDRC_DS (3 << 10) /* Drive Strength */
76#define AT91_DDRSDRC_TIMEOUT (3 << 12) /* Time to define when Low Power Mode is enabled */
77#define AT91_DDRSDRC_TIMEOUT_0_CLK_CYCLES (0 << 12)
78#define AT91_DDRSDRC_TIMEOUT_64_CLK_CYCLES (1 << 12)
79#define AT91_DDRSDRC_TIMEOUT_128_CLK_CYCLES (2 << 12)
80
81#define AT91_DDRSDRC_MDR (AT91_DDRSDRC + 0x1C) /* Memory Device Register */
82#define AT91_DDRSDRC_MD (3 << 0) /* Memory Device Type */
83#define AT91_DDRSDRC_MD_SDR 0
84#define AT91_DDRSDRC_MD_LOW_POWER_SDR 1
85#define AT91_DDRSDRC_MD_DDR 2
86#define AT91_DDRSDRC_MD_LOW_POWER_DDR 3
87
88#define AT91_DDRSDRC_DLLR (AT91_DDRSDRC + 0x20) /* DLL Information Register */
89#define AT91_DDRSDRC_MDINC (1 << 0) /* Master Delay increment */
90#define AT91_DDRSDRC_MDDEC (1 << 1) /* Master Delay decrement */
91#define AT91_DDRSDRC_MDOVF (1 << 2) /* Master Delay Overflow */
92#define AT91_DDRSDRC_SDCOVF (1 << 3) /* Slave Delay Correction Overflow */
93#define AT91_DDRSDRC_SDCUDF (1 << 4) /* Slave Delay Correction Underflow */
94#define AT91_DDRSDRC_SDERF (1 << 5) /* Slave Delay Correction error */
95#define AT91_DDRSDRC_MDVAL (0xff << 8) /* Master Delay value */
96#define AT91_DDRSDRC_SDVAL (0xff << 16) /* Slave Delay value */
97#define AT91_DDRSDRC_SDCVAL (0xff << 24) /* Slave Delay Correction value */
98
99
100#endif
diff --git a/include/asm-arm/arch-at91/at91sam926x_mc.h b/include/asm-arm/arch-at91/at91sam9_sdramc.h
index d82631c251f1..d3b8b3da6b4d 100644
--- a/include/asm-arm/arch-at91/at91sam926x_mc.h
+++ b/include/asm-arm/arch-at91/at91sam9_sdramc.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * include/asm-arm/arch-at91/at91sam926x_mc.h 2 * include/asm-arm/arch-at91/at91sam9_sdramc.h
3 * 3 *
4 * Memory Controllers (SMC, SDRAMC) - System peripherals registers. 4 * SDRAM Controllers (SDRAMC) - System peripherals registers.
5 * Based on AT91SAM9261 datasheet revision D. 5 * Based on AT91SAM9261 datasheet revision D.
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
@@ -10,8 +10,8 @@
10 * (at your option) any later version. 10 * (at your option) any later version.
11 */ 11 */
12 12
13#ifndef AT91SAM926x_MC_H 13#ifndef AT91SAM9_SDRAMC_H
14#define AT91SAM926x_MC_H 14#define AT91SAM9_SDRAMC_H
15 15
16/* SDRAM Controller (SDRAMC) registers */ 16/* SDRAM Controller (SDRAMC) registers */
17#define AT91_SDRAMC_MR (AT91_SDRAMC + 0x00) /* SDRAM Controller Mode Register */ 17#define AT91_SDRAMC_MR (AT91_SDRAMC + 0x00) /* SDRAM Controller Mode Register */
@@ -62,7 +62,7 @@
62#define AT91_SDRAMC_LPCB_DEEP_POWER_DOWN 3 62#define AT91_SDRAMC_LPCB_DEEP_POWER_DOWN 3
63#define AT91_SDRAMC_PASR (7 << 4) /* Partial Array Self Refresh */ 63#define AT91_SDRAMC_PASR (7 << 4) /* Partial Array Self Refresh */
64#define AT91_SDRAMC_TCSR (3 << 8) /* Temperature Compensated Self Refresh */ 64#define AT91_SDRAMC_TCSR (3 << 8) /* Temperature Compensated Self Refresh */
65#define AT91_SDRAMC_DS (3 << 10) /* Drive Strenght */ 65#define AT91_SDRAMC_DS (3 << 10) /* Drive Strength */
66#define AT91_SDRAMC_TIMEOUT (3 << 12) /* Time to define when Low Power Mode is enabled */ 66#define AT91_SDRAMC_TIMEOUT (3 << 12) /* Time to define when Low Power Mode is enabled */
67#define AT91_SDRAMC_TIMEOUT_0_CLK_CYCLES (0 << 12) 67#define AT91_SDRAMC_TIMEOUT_0_CLK_CYCLES (0 << 12)
68#define AT91_SDRAMC_TIMEOUT_64_CLK_CYCLES (1 << 12) 68#define AT91_SDRAMC_TIMEOUT_64_CLK_CYCLES (1 << 12)
@@ -80,62 +80,4 @@
80#define AT91_SDRAMC_MD_LOW_POWER_SDRAM 1 80#define AT91_SDRAMC_MD_LOW_POWER_SDRAM 1
81 81
82 82
83/* Static Memory Controller (SMC) registers */
84#define AT91_SMC_SETUP(n) (AT91_SMC + 0x00 + ((n)*0x10)) /* Setup Register for CS n */
85#define AT91_SMC_NWESETUP (0x3f << 0) /* NWE Setup Length */
86#define AT91_SMC_NWESETUP_(x) ((x) << 0)
87#define AT91_SMC_NCS_WRSETUP (0x3f << 8) /* NCS Setup Length in Write Access */
88#define AT91_SMC_NCS_WRSETUP_(x) ((x) << 8)
89#define AT91_SMC_NRDSETUP (0x3f << 16) /* NRD Setup Length */
90#define AT91_SMC_NRDSETUP_(x) ((x) << 16)
91#define AT91_SMC_NCS_RDSETUP (0x3f << 24) /* NCS Setup Length in Read Access */
92#define AT91_SMC_NCS_RDSETUP_(x) ((x) << 24)
93
94#define AT91_SMC_PULSE(n) (AT91_SMC + 0x04 + ((n)*0x10)) /* Pulse Register for CS n */
95#define AT91_SMC_NWEPULSE (0x7f << 0) /* NWE Pulse Length */
96#define AT91_SMC_NWEPULSE_(x) ((x) << 0)
97#define AT91_SMC_NCS_WRPULSE (0x7f << 8) /* NCS Pulse Length in Write Access */
98#define AT91_SMC_NCS_WRPULSE_(x)((x) << 8)
99#define AT91_SMC_NRDPULSE (0x7f << 16) /* NRD Pulse Length */
100#define AT91_SMC_NRDPULSE_(x) ((x) << 16)
101#define AT91_SMC_NCS_RDPULSE (0x7f << 24) /* NCS Pulse Length in Read Access */
102#define AT91_SMC_NCS_RDPULSE_(x)((x) << 24)
103
104#define AT91_SMC_CYCLE(n) (AT91_SMC + 0x08 + ((n)*0x10)) /* Cycle Register for CS n */
105#define AT91_SMC_NWECYCLE (0x1ff << 0 ) /* Total Write Cycle Length */
106#define AT91_SMC_NWECYCLE_(x) ((x) << 0)
107#define AT91_SMC_NRDCYCLE (0x1ff << 16) /* Total Read Cycle Length */
108#define AT91_SMC_NRDCYCLE_(x) ((x) << 16)
109
110#define AT91_SMC_MODE(n) (AT91_SMC + 0x0c + ((n)*0x10)) /* Mode Register for CS n */
111#define AT91_SMC_READMODE (1 << 0) /* Read Mode */
112#define AT91_SMC_WRITEMODE (1 << 1) /* Write Mode */
113#define AT91_SMC_EXNWMODE (3 << 4) /* NWAIT Mode */
114#define AT91_SMC_EXNWMODE_DISABLE (0 << 4)
115#define AT91_SMC_EXNWMODE_FROZEN (2 << 4)
116#define AT91_SMC_EXNWMODE_READY (3 << 4)
117#define AT91_SMC_BAT (1 << 8) /* Byte Access Type */
118#define AT91_SMC_BAT_SELECT (0 << 8)
119#define AT91_SMC_BAT_WRITE (1 << 8)
120#define AT91_SMC_DBW (3 << 12) /* Data Bus Width */
121#define AT91_SMC_DBW_8 (0 << 12)
122#define AT91_SMC_DBW_16 (1 << 12)
123#define AT91_SMC_DBW_32 (2 << 12)
124#define AT91_SMC_TDF (0xf << 16) /* Data Float Time. */
125#define AT91_SMC_TDF_(x) ((x) << 16)
126#define AT91_SMC_TDFMODE (1 << 20) /* TDF Optimization - Enabled */
127#define AT91_SMC_PMEN (1 << 24) /* Page Mode Enabled */
128#define AT91_SMC_PS (3 << 28) /* Page Size */
129#define AT91_SMC_PS_4 (0 << 28)
130#define AT91_SMC_PS_8 (1 << 28)
131#define AT91_SMC_PS_16 (2 << 28)
132#define AT91_SMC_PS_32 (3 << 28)
133
134#if defined(AT91_SMC1) /* The AT91SAM9263 has 2 Static Memory contollers */
135#define AT91_SMC1_SETUP(n) (AT91_SMC1 + 0x00 + ((n)*0x10)) /* Setup Register for CS n */
136#define AT91_SMC1_PULSE(n) (AT91_SMC1 + 0x04 + ((n)*0x10)) /* Pulse Register for CS n */
137#define AT91_SMC1_CYCLE(n) (AT91_SMC1 + 0x08 + ((n)*0x10)) /* Cycle Register for CS n */
138#define AT91_SMC1_MODE(n) (AT91_SMC1 + 0x0c + ((n)*0x10)) /* Mode Register for CS n */
139#endif
140
141#endif 83#endif
diff --git a/include/asm-arm/arch-at91/at91sam9_smc.h b/include/asm-arm/arch-at91/at91sam9_smc.h
new file mode 100644
index 000000000000..9e49eed31e50
--- /dev/null
+++ b/include/asm-arm/arch-at91/at91sam9_smc.h
@@ -0,0 +1,73 @@
1/*
2 * include/asm-arm/arch-at91/at91sam9_smc.h
3 *
4 * Static Memory Controllers (SMC) - System peripherals registers.
5 * Based on AT91SAM9261 datasheet revision D.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 */
12
13#ifndef AT91SAM9_SMC_H
14#define AT91SAM9_SMC_H
15
16#define AT91_SMC_SETUP(n) (AT91_SMC + 0x00 + ((n)*0x10)) /* Setup Register for CS n */
17#define AT91_SMC_NWESETUP (0x3f << 0) /* NWE Setup Length */
18#define AT91_SMC_NWESETUP_(x) ((x) << 0)
19#define AT91_SMC_NCS_WRSETUP (0x3f << 8) /* NCS Setup Length in Write Access */
20#define AT91_SMC_NCS_WRSETUP_(x) ((x) << 8)
21#define AT91_SMC_NRDSETUP (0x3f << 16) /* NRD Setup Length */
22#define AT91_SMC_NRDSETUP_(x) ((x) << 16)
23#define AT91_SMC_NCS_RDSETUP (0x3f << 24) /* NCS Setup Length in Read Access */
24#define AT91_SMC_NCS_RDSETUP_(x) ((x) << 24)
25
26#define AT91_SMC_PULSE(n) (AT91_SMC + 0x04 + ((n)*0x10)) /* Pulse Register for CS n */
27#define AT91_SMC_NWEPULSE (0x7f << 0) /* NWE Pulse Length */
28#define AT91_SMC_NWEPULSE_(x) ((x) << 0)
29#define AT91_SMC_NCS_WRPULSE (0x7f << 8) /* NCS Pulse Length in Write Access */
30#define AT91_SMC_NCS_WRPULSE_(x)((x) << 8)
31#define AT91_SMC_NRDPULSE (0x7f << 16) /* NRD Pulse Length */
32#define AT91_SMC_NRDPULSE_(x) ((x) << 16)
33#define AT91_SMC_NCS_RDPULSE (0x7f << 24) /* NCS Pulse Length in Read Access */
34#define AT91_SMC_NCS_RDPULSE_(x)((x) << 24)
35
36#define AT91_SMC_CYCLE(n) (AT91_SMC + 0x08 + ((n)*0x10)) /* Cycle Register for CS n */
37#define AT91_SMC_NWECYCLE (0x1ff << 0 ) /* Total Write Cycle Length */
38#define AT91_SMC_NWECYCLE_(x) ((x) << 0)
39#define AT91_SMC_NRDCYCLE (0x1ff << 16) /* Total Read Cycle Length */
40#define AT91_SMC_NRDCYCLE_(x) ((x) << 16)
41
42#define AT91_SMC_MODE(n) (AT91_SMC + 0x0c + ((n)*0x10)) /* Mode Register for CS n */
43#define AT91_SMC_READMODE (1 << 0) /* Read Mode */
44#define AT91_SMC_WRITEMODE (1 << 1) /* Write Mode */
45#define AT91_SMC_EXNWMODE (3 << 4) /* NWAIT Mode */
46#define AT91_SMC_EXNWMODE_DISABLE (0 << 4)
47#define AT91_SMC_EXNWMODE_FROZEN (2 << 4)
48#define AT91_SMC_EXNWMODE_READY (3 << 4)
49#define AT91_SMC_BAT (1 << 8) /* Byte Access Type */
50#define AT91_SMC_BAT_SELECT (0 << 8)
51#define AT91_SMC_BAT_WRITE (1 << 8)
52#define AT91_SMC_DBW (3 << 12) /* Data Bus Width */
53#define AT91_SMC_DBW_8 (0 << 12)
54#define AT91_SMC_DBW_16 (1 << 12)
55#define AT91_SMC_DBW_32 (2 << 12)
56#define AT91_SMC_TDF (0xf << 16) /* Data Float Time. */
57#define AT91_SMC_TDF_(x) ((x) << 16)
58#define AT91_SMC_TDFMODE (1 << 20) /* TDF Optimization - Enabled */
59#define AT91_SMC_PMEN (1 << 24) /* Page Mode Enabled */
60#define AT91_SMC_PS (3 << 28) /* Page Size */
61#define AT91_SMC_PS_4 (0 << 28)
62#define AT91_SMC_PS_8 (1 << 28)
63#define AT91_SMC_PS_16 (2 << 28)
64#define AT91_SMC_PS_32 (3 << 28)
65
66#if defined(AT91_SMC1) /* The AT91SAM9263 has 2 Static Memory contollers */
67#define AT91_SMC1_SETUP(n) (AT91_SMC1 + 0x00 + ((n)*0x10)) /* Setup Register for CS n */
68#define AT91_SMC1_PULSE(n) (AT91_SMC1 + 0x04 + ((n)*0x10)) /* Pulse Register for CS n */
69#define AT91_SMC1_CYCLE(n) (AT91_SMC1 + 0x08 + ((n)*0x10)) /* Cycle Register for CS n */
70#define AT91_SMC1_MODE(n) (AT91_SMC1 + 0x0c + ((n)*0x10)) /* Mode Register for CS n */
71#endif
72
73#endif
diff --git a/include/asm-arm/arch-ep93xx/gpio.h b/include/asm-arm/arch-ep93xx/gpio.h
index 9b1864bbd9a8..186e7c715f8a 100644
--- a/include/asm-arm/arch-ep93xx/gpio.h
+++ b/include/asm-arm/arch-ep93xx/gpio.h
@@ -101,30 +101,17 @@
101 101
102/* new generic GPIO API - see Documentation/gpio.txt */ 102/* new generic GPIO API - see Documentation/gpio.txt */
103 103
104static inline int gpio_request(unsigned gpio, const char *label) 104#include <asm-generic/gpio.h>
105{
106 if (gpio > EP93XX_GPIO_LINE_MAX)
107 return -EINVAL;
108 return 0;
109}
110 105
111static inline void gpio_free(unsigned gpio) 106#define gpio_get_value __gpio_get_value
112{ 107#define gpio_set_value __gpio_set_value
113} 108#define gpio_cansleep __gpio_cansleep
114
115int gpio_direction_input(unsigned gpio);
116int gpio_direction_output(unsigned gpio, int value);
117int gpio_get_value(unsigned gpio);
118void gpio_set_value(unsigned gpio, int value);
119
120#include <asm-generic/gpio.h> /* cansleep wrappers */
121 109
122/* 110/*
123 * Map GPIO A0..A7 (0..7) to irq 64..71, 111 * Map GPIO A0..A7 (0..7) to irq 64..71,
124 * B0..B7 (7..15) to irq 72..79, and 112 * B0..B7 (7..15) to irq 72..79, and
125 * F0..F7 (16..24) to irq 80..87. 113 * F0..F7 (16..24) to irq 80..87.
126 */ 114 */
127
128static inline int gpio_to_irq(unsigned gpio) 115static inline int gpio_to_irq(unsigned gpio)
129{ 116{
130 if (gpio <= EP93XX_GPIO_LINE_MAX_IRQ) 117 if (gpio <= EP93XX_GPIO_LINE_MAX_IRQ)
diff --git a/include/asm-arm/arch-ks8695/devices.h b/include/asm-arm/arch-ks8695/devices.h
index b0364dce463f..7ad2c656e162 100644
--- a/include/asm-arm/arch-ks8695/devices.h
+++ b/include/asm-arm/arch-ks8695/devices.h
@@ -18,6 +18,11 @@ extern void __init ks8695_add_device_wan(void);
18extern void __init ks8695_add_device_lan(void); 18extern void __init ks8695_add_device_lan(void);
19extern void __init ks8695_add_device_hpna(void); 19extern void __init ks8695_add_device_hpna(void);
20 20
21 /* LEDs */
22extern short ks8695_leds_cpu;
23extern short ks8695_leds_timer;
24extern void __init ks8695_init_leds(u8 cpu_led, u8 timer_led);
25
21 /* PCI */ 26 /* PCI */
22#define KS8695_MODE_PCI 0 27#define KS8695_MODE_PCI 0
23#define KS8695_MODE_MINIPCI 1 28#define KS8695_MODE_MINIPCI 1
diff --git a/include/asm-arm/arch-mxc/board-mx31ads.h b/include/asm-arm/arch-mxc/board-mx31ads.h
index be29b83ad4ae..8590127760a8 100644
--- a/include/asm-arm/arch-mxc/board-mx31ads.h
+++ b/include/asm-arm/arch-mxc/board-mx31ads.h
@@ -11,107 +11,77 @@
11#ifndef __ASM_ARCH_MXC_BOARD_MX31ADS_H__ 11#ifndef __ASM_ARCH_MXC_BOARD_MX31ADS_H__
12#define __ASM_ARCH_MXC_BOARD_MX31ADS_H__ 12#define __ASM_ARCH_MXC_BOARD_MX31ADS_H__
13 13
14/*! 14/* Base address of PBC controller */
15 * @name PBC Controller parameters
16 */
17/*! @{ */
18/*!
19 * Base address of PBC controller
20 */
21#define PBC_BASE_ADDRESS IO_ADDRESS(CS4_BASE_ADDR) 15#define PBC_BASE_ADDRESS IO_ADDRESS(CS4_BASE_ADDR)
22/* Offsets for the PBC Controller register */ 16/* Offsets for the PBC Controller register */
23/*! 17
24 * PBC Board status register offset 18/* PBC Board status register offset */
25 */
26#define PBC_BSTAT 0x000002 19#define PBC_BSTAT 0x000002
27/*! 20
28 * PBC Board control register 1 set address. 21/* PBC Board control register 1 set address */
29 */
30#define PBC_BCTRL1_SET 0x000004 22#define PBC_BCTRL1_SET 0x000004
31/*! 23
32 * PBC Board control register 1 clear address. 24/* PBC Board control register 1 clear address */
33 */
34#define PBC_BCTRL1_CLEAR 0x000006 25#define PBC_BCTRL1_CLEAR 0x000006
35/*! 26
36 * PBC Board control register 2 set address. 27/* PBC Board control register 2 set address */
37 */
38#define PBC_BCTRL2_SET 0x000008 28#define PBC_BCTRL2_SET 0x000008
39/*! 29
40 * PBC Board control register 2 clear address. 30/* PBC Board control register 2 clear address */
41 */
42#define PBC_BCTRL2_CLEAR 0x00000A 31#define PBC_BCTRL2_CLEAR 0x00000A
43/*! 32
44 * PBC Board control register 3 set address. 33/* PBC Board control register 3 set address */
45 */
46#define PBC_BCTRL3_SET 0x00000C 34#define PBC_BCTRL3_SET 0x00000C
47/*! 35
48 * PBC Board control register 3 clear address. 36/* PBC Board control register 3 clear address */
49 */
50#define PBC_BCTRL3_CLEAR 0x00000E 37#define PBC_BCTRL3_CLEAR 0x00000E
51/*! 38
52 * PBC Board control register 4 set address. 39/* PBC Board control register 4 set address */
53 */
54#define PBC_BCTRL4_SET 0x000010 40#define PBC_BCTRL4_SET 0x000010
55/*! 41
56 * PBC Board control register 4 clear address. 42/* PBC Board control register 4 clear address */
57 */
58#define PBC_BCTRL4_CLEAR 0x000012 43#define PBC_BCTRL4_CLEAR 0x000012
59/*! 44
60 * PBC Board status register 1. 45/* PBC Board status register 1 */
61 */
62#define PBC_BSTAT1 0x000014 46#define PBC_BSTAT1 0x000014
63/*! 47
64 * PBC Board interrupt status register. 48/* PBC Board interrupt status register */
65 */
66#define PBC_INTSTATUS 0x000016 49#define PBC_INTSTATUS 0x000016
67/*! 50
68 * PBC Board interrupt current status register. 51/* PBC Board interrupt current status register */
69 */
70#define PBC_INTCURR_STATUS 0x000018 52#define PBC_INTCURR_STATUS 0x000018
71/*! 53
72 * PBC Interrupt mask register set address. 54/* PBC Interrupt mask register set address */
73 */
74#define PBC_INTMASK_SET 0x00001A 55#define PBC_INTMASK_SET 0x00001A
75/*! 56
76 * PBC Interrupt mask register clear address. 57/* PBC Interrupt mask register clear address */
77 */
78#define PBC_INTMASK_CLEAR 0x00001C 58#define PBC_INTMASK_CLEAR 0x00001C
79 59
80/*! 60/* External UART A */
81 * External UART A.
82 */
83#define PBC_SC16C652_UARTA 0x010000 61#define PBC_SC16C652_UARTA 0x010000
84/*! 62
85 * External UART B. 63/* External UART B */
86 */
87#define PBC_SC16C652_UARTB 0x010010 64#define PBC_SC16C652_UARTB 0x010010
88/*! 65
89 * Ethernet Controller IO base address. 66/* Ethernet Controller IO base address */
90 */
91#define PBC_CS8900A_IOBASE 0x020000 67#define PBC_CS8900A_IOBASE 0x020000
92/*! 68
93 * Ethernet Controller Memory base address. 69/* Ethernet Controller Memory base address */
94 */
95#define PBC_CS8900A_MEMBASE 0x021000 70#define PBC_CS8900A_MEMBASE 0x021000
96/*! 71
97 * Ethernet Controller DMA base address. 72/* Ethernet Controller DMA base address */
98 */
99#define PBC_CS8900A_DMABASE 0x022000 73#define PBC_CS8900A_DMABASE 0x022000
100/*! 74
101 * External chip select 0. 75/* External chip select 0 */
102 */
103#define PBC_XCS0 0x040000 76#define PBC_XCS0 0x040000
104/*! 77
105 * LCD Display enable. 78/* LCD Display enable */
106 */
107#define PBC_LCD_EN_B 0x060000 79#define PBC_LCD_EN_B 0x060000
108/*! 80
109 * Code test debug enable. 81/* Code test debug enable */
110 */
111#define PBC_CODE_B 0x070000 82#define PBC_CODE_B 0x070000
112/*! 83
113 * PSRAM memory select. 84/* PSRAM memory select */
114 */
115#define PBC_PSRAM_B 0x5000000 85#define PBC_PSRAM_B 0x5000000
116 86
117#define PBC_INTSTATUS_REG (PBC_INTSTATUS + PBC_BASE_ADDRESS) 87#define PBC_INTSTATUS_REG (PBC_INTSTATUS + PBC_BASE_ADDRESS)
@@ -139,4 +109,4 @@
139 109
140#define MXC_MAX_EXP_IO_LINES 16 110#define MXC_MAX_EXP_IO_LINES 16
141 111
142#endif /* __ASM_ARCH_MXC_BOARD_MX31ADS_H__ */ 112#endif /* __ASM_ARCH_MXC_BOARD_MX31ADS_H__ */
diff --git a/include/asm-arm/arch-mxc/dma.h b/include/asm-arm/arch-mxc/dma.h
index 65e639d51d2b..c822d569a05e 100644
--- a/include/asm-arm/arch-mxc/dma.h
+++ b/include/asm-arm/arch-mxc/dma.h
@@ -11,11 +11,4 @@
11#ifndef __ASM_ARCH_MXC_DMA_H__ 11#ifndef __ASM_ARCH_MXC_DMA_H__
12#define __ASM_ARCH_MXC_DMA_H__ 12#define __ASM_ARCH_MXC_DMA_H__
13 13
14/*!
15 * @file dma.h
16 * @brief This file contains Unified DMA API for all MXC platforms.
17 * The API is platform independent.
18 *
19 * @ingroup SDMA
20 */
21#endif 14#endif
diff --git a/include/asm-arm/arch-mxc/hardware.h b/include/asm-arm/arch-mxc/hardware.h
index 3c09b92fef0d..e87ff0679d5e 100644
--- a/include/asm-arm/arch-mxc/hardware.h
+++ b/include/asm-arm/arch-mxc/hardware.h
@@ -8,45 +8,24 @@
8 * published by the Free Software Foundation. 8 * published by the Free Software Foundation.
9 */ 9 */
10 10
11/*!
12 * @file hardware.h
13 * @brief This file contains the hardware definitions of the board.
14 *
15 * @ingroup System
16 */
17#ifndef __ASM_ARCH_MXC_HARDWARE_H__ 11#ifndef __ASM_ARCH_MXC_HARDWARE_H__
18#define __ASM_ARCH_MXC_HARDWARE_H__ 12#define __ASM_ARCH_MXC_HARDWARE_H__
19 13
20#include <asm/sizes.h> 14#include <asm/sizes.h>
21 15
22#include <asm/arch/mx31.h> 16#ifdef CONFIG_ARCH_MX3
17# include <asm/arch/mx31.h>
18#endif
23 19
24#include <asm/arch/mxc.h> 20#include <asm/arch/mxc.h>
25 21
26#define MXC_MAX_GPIO_LINES (GPIO_NUM_PIN * GPIO_PORT_NUM)
27
28/* 22/*
29 * --------------------------------------------------------------------------- 23 * ---------------------------------------------------------------------------
30 * Board specific defines 24 * Board specific defines
31 * --------------------------------------------------------------------------- 25 * ---------------------------------------------------------------------------
32 */ 26 */
33#define MXC_EXP_IO_BASE (MXC_GPIO_INT_BASE + MXC_MAX_GPIO_LINES) 27#ifdef CONFIG_MACH_MX31ADS
34 28# include <asm/arch/board-mx31ads.h>
35#include <asm/arch/board-mx31ads.h>
36
37#ifndef MXC_MAX_EXP_IO_LINES
38#define MXC_MAX_EXP_IO_LINES 0
39#endif 29#endif
40 30
41#define MXC_MAX_VIRTUAL_INTS 16 31#endif /* __ASM_ARCH_MXC_HARDWARE_H__ */
42#define MXC_VIRTUAL_INTS_BASE (MXC_EXP_IO_BASE + MXC_MAX_EXP_IO_LINES)
43#define MXC_SDIO1_CARD_IRQ MXC_VIRTUAL_INTS_BASE
44#define MXC_SDIO2_CARD_IRQ (MXC_VIRTUAL_INTS_BASE + 1)
45#define MXC_SDIO3_CARD_IRQ (MXC_VIRTUAL_INTS_BASE + 2)
46
47#define MXC_MAX_INTS (MXC_MAX_INT_LINES + \
48 MXC_MAX_GPIO_LINES + \
49 MXC_MAX_EXP_IO_LINES + \
50 MXC_MAX_VIRTUAL_INTS)
51
52#endif /* __ASM_ARCH_MXC_HARDWARE_H__ */
diff --git a/include/asm-arm/arch-mxc/io.h b/include/asm-arm/arch-mxc/io.h
index cf6c83a4b9f7..65b6810124c1 100644
--- a/include/asm-arm/arch-mxc/io.h
+++ b/include/asm-arm/arch-mxc/io.h
@@ -8,24 +8,13 @@
8 * published by the Free Software Foundation. 8 * published by the Free Software Foundation.
9 */ 9 */
10 10
11/*!
12 * @file io.h
13 * @brief This file contains some memory mapping macros.
14 * @note There is no real ISA or PCI buses. But have to define these macros
15 * for some drivers to compile.
16 *
17 * @ingroup System
18 */
19
20#ifndef __ASM_ARCH_MXC_IO_H__ 11#ifndef __ASM_ARCH_MXC_IO_H__
21#define __ASM_ARCH_MXC_IO_H__ 12#define __ASM_ARCH_MXC_IO_H__
22 13
23/*! Allow IO space to be anywhere in the memory */ 14/* Allow IO space to be anywhere in the memory */
24#define IO_SPACE_LIMIT 0xffffffff 15#define IO_SPACE_LIMIT 0xffffffff
25 16
26/*! 17/* io address mapping macro */
27 * io address mapping macro
28 */
29#define __io(a) ((void __iomem *)(a)) 18#define __io(a) ((void __iomem *)(a))
30 19
31#define __mem_pci(a) (a) 20#define __mem_pci(a) (a)
diff --git a/include/asm-arm/arch-mxc/irqs.h b/include/asm-arm/arch-mxc/irqs.h
index e4686c6bc4bf..b2c5205e1962 100644
--- a/include/asm-arm/arch-mxc/irqs.h
+++ b/include/asm-arm/arch-mxc/irqs.h
@@ -13,26 +13,17 @@
13 13
14#include <asm/hardware.h> 14#include <asm/hardware.h>
15 15
16/*!
17 * @file irqs.h
18 * @brief This file defines the number of normal interrupts and fast interrupts
19 *
20 * @ingroup Interrupt
21 */
22
23#define MXC_IRQ_TO_EXPIO(irq) ((irq) - MXC_EXP_IO_BASE) 16#define MXC_IRQ_TO_EXPIO(irq) ((irq) - MXC_EXP_IO_BASE)
24 17
25#define MXC_IRQ_TO_GPIO(irq) ((irq) - MXC_GPIO_INT_BASE) 18#define MXC_IRQ_TO_GPIO(irq) ((irq) - MXC_GPIO_INT_BASE)
26#define MXC_GPIO_TO_IRQ(x) (MXC_GPIO_INT_BASE + x) 19#define MXC_GPIO_TO_IRQ(x) (MXC_GPIO_INT_BASE + x)
27 20
28/*! 21/* Number of normal interrupts */
29 * Number of normal interrupts 22#define NR_IRQS (MXC_MAX_INT_LINES + \
30 */ 23 MXC_MAX_GPIO_LINES + \
31#define NR_IRQS MXC_MAX_INTS 24 MXC_MAX_VIRTUAL_INTS)
32 25
33/*! 26/* Number of fast interrupts */
34 * Number of fast interrupts
35 */
36#define NR_FIQS MXC_MAX_INTS 27#define NR_FIQS MXC_MAX_INTS
37 28
38#endif /* __ASM_ARCH_MXC_IRQS_H__ */ 29#endif /* __ASM_ARCH_MXC_IRQS_H__ */
diff --git a/include/asm-arm/arch-mxc/memory.h b/include/asm-arm/arch-mxc/memory.h
index c89aac83a407..059f83023a10 100644
--- a/include/asm-arm/arch-mxc/memory.h
+++ b/include/asm-arm/arch-mxc/memory.h
@@ -13,24 +13,17 @@
13 13
14#include <asm/hardware.h> 14#include <asm/hardware.h>
15 15
16/*! 16/*
17 * @file memory.h
18 * @brief This file contains macros needed by the Linux kernel and drivers.
19 *
20 * @ingroup Memory
21 */
22
23/*!
24 * Virtual view <-> DMA view memory address translations 17 * Virtual view <-> DMA view memory address translations
25 * This macro is used to translate the virtual address to an address 18 * This macro is used to translate the virtual address to an address
26 * suitable to be passed to set_dma_addr() 19 * suitable to be passed to set_dma_addr()
27 */ 20 */
28#define __virt_to_bus(a) __virt_to_phys(a) 21#define __virt_to_bus(a) __virt_to_phys(a)
29 22
30/*! 23/*
31 * Used to convert an address for DMA operations to an address that the 24 * Used to convert an address for DMA operations to an address that the
32 * kernel can use. 25 * kernel can use.
33 */ 26 */
34#define __bus_to_virt(a) __phys_to_virt(a) 27#define __bus_to_virt(a) __phys_to_virt(a)
35 28
36#endif /* __ASM_ARCH_MXC_MEMORY_H__ */ 29#endif /* __ASM_ARCH_MXC_MEMORY_H__ */
diff --git a/include/asm-arm/arch-mxc/mx31.h b/include/asm-arm/arch-mxc/mx31.h
index 85c49c9e5d15..36a1af495bb3 100644
--- a/include/asm-arm/arch-mxc/mx31.h
+++ b/include/asm-arm/arch-mxc/mx31.h
@@ -317,6 +317,8 @@
317#define MXC_MAX_INT_LINES 64 317#define MXC_MAX_INT_LINES 64
318 318
319#define MXC_GPIO_INT_BASE MXC_MAX_INT_LINES 319#define MXC_GPIO_INT_BASE MXC_MAX_INT_LINES
320#define MXC_MAX_GPIO_LINES (GPIO_NUM_PIN * GPIO_PORT_NUM)
321#define MXC_MAX_VIRTUAL_INTS 16
320 322
321/*! 323/*!
322 * Number of GPIO port as defined in the IC Spec 324 * Number of GPIO port as defined in the IC Spec
@@ -329,7 +331,33 @@
329 331
330#define PROD_SIGNATURE 0x1 /* For MX31 */ 332#define PROD_SIGNATURE 0x1 /* For MX31 */
331 333
334/* silicon revisions specific to i.MX31 */
335#define CHIP_REV_1_0 0x10
336#define CHIP_REV_1_1 0x11
337#define CHIP_REV_1_2 0x12
338#define CHIP_REV_1_3 0x13
339#define CHIP_REV_2_0 0x20
340#define CHIP_REV_2_1 0x21
341#define CHIP_REV_2_2 0x22
342#define CHIP_REV_2_3 0x23
343#define CHIP_REV_3_0 0x30
344#define CHIP_REV_3_1 0x31
345#define CHIP_REV_3_2 0x32
346
332#define SYSTEM_REV_MIN CHIP_REV_1_0 347#define SYSTEM_REV_MIN CHIP_REV_1_0
333#define SYSTEM_REV_NUM 3 348#define SYSTEM_REV_NUM 3
334 349
335#endif /* __ASM_ARCH_MXC_MX31_H__ */ 350#if !defined(__ASSEMBLY__) && !defined(__MXC_BOOT_UNCOMPRESS)
351
352/* this is a i.MX31 CPU */
353#define cpu_is_mx31() (1)
354
355extern unsigned int system_rev;
356
357static inline int mx31_revision(void)
358{
359 return system_rev;
360}
361#endif
362
363#endif /* __ASM_ARCH_MXC_MX31_H__ */
diff --git a/include/asm-arm/arch-mxc/mxc.h b/include/asm-arm/arch-mxc/mxc.h
index 0837f1f9ca31..146d3f60951a 100644
--- a/include/asm-arm/arch-mxc/mxc.h
+++ b/include/asm-arm/arch-mxc/mxc.h
@@ -15,6 +15,11 @@
15#error "Do not include directly." 15#error "Do not include directly."
16#endif 16#endif
17 17
18/* clean up all things that are not used */
19#ifndef CONFIG_ARCH_MX3
20# define cpu_is_mx31() (0)
21#endif
22
18/* 23/*
19 ***************************************** 24 *****************************************
20 * GPT Register definitions * 25 * GPT Register definitions *
@@ -31,9 +36,7 @@
31#define MXC_GPT_GPTICR2 IO_ADDRESS(GPT1_BASE_ADDR + 0x20) 36#define MXC_GPT_GPTICR2 IO_ADDRESS(GPT1_BASE_ADDR + 0x20)
32#define MXC_GPT_GPTCNT IO_ADDRESS(GPT1_BASE_ADDR + 0x24) 37#define MXC_GPT_GPTCNT IO_ADDRESS(GPT1_BASE_ADDR + 0x24)
33 38
34/*! 39/* GPT Control register bit definitions */
35 * GPT Control register bit definitions
36 */
37#define GPTCR_FO3 (1 << 31) 40#define GPTCR_FO3 (1 << 31)
38#define GPTCR_FO2 (1 << 30) 41#define GPTCR_FO2 (1 << 30)
39#define GPTCR_FO1 (1 << 29) 42#define GPTCR_FO1 (1 << 29)
@@ -146,4 +149,4 @@
146#define IIM_PROD_REV_SH 3 149#define IIM_PROD_REV_SH 3
147#define IIM_PROD_REV_LEN 5 150#define IIM_PROD_REV_LEN 5
148 151
149#endif /* __ASM_ARCH_MXC_H__ */ 152#endif /* __ASM_ARCH_MXC_H__ */
diff --git a/include/asm-arm/arch-mxc/system.h b/include/asm-arm/arch-mxc/system.h
index 109956b41aca..bbfc37465fc5 100644
--- a/include/asm-arm/arch-mxc/system.h
+++ b/include/asm-arm/arch-mxc/system.h
@@ -21,30 +21,14 @@
21#ifndef __ASM_ARCH_MXC_SYSTEM_H__ 21#ifndef __ASM_ARCH_MXC_SYSTEM_H__
22#define __ASM_ARCH_MXC_SYSTEM_H__ 22#define __ASM_ARCH_MXC_SYSTEM_H__
23 23
24/*!
25 * @file system.h
26 * @brief This file contains idle and reset functions.
27 *
28 * @ingroup System
29 */
30
31/*!
32 * This function puts the CPU into idle mode. It is called by default_idle()
33 * in process.c file.
34 */
35static inline void arch_idle(void) 24static inline void arch_idle(void)
36{ 25{
37 cpu_do_idle(); 26 cpu_do_idle();
38} 27}
39 28
40/*
41 * This function resets the system. It is called by machine_restart().
42 *
43 * @param mode indicates different kinds of resets
44 */
45static inline void arch_reset(char mode) 29static inline void arch_reset(char mode)
46{ 30{
47 cpu_reset(0); 31 cpu_reset(0);
48} 32}
49 33
50#endif /* __ASM_ARCH_MXC_SYSTEM_H__ */ 34#endif /* __ASM_ARCH_MXC_SYSTEM_H__ */
diff --git a/include/asm-arm/arch-mxc/vmalloc.h b/include/asm-arm/arch-mxc/vmalloc.h
index 83a73da895eb..62d97623412f 100644
--- a/include/asm-arm/arch-mxc/vmalloc.h
+++ b/include/asm-arm/arch-mxc/vmalloc.h
@@ -20,17 +20,7 @@
20#ifndef __ASM_ARCH_MXC_VMALLOC_H__ 20#ifndef __ASM_ARCH_MXC_VMALLOC_H__
21#define __ASM_ARCH_MXC_VMALLOC_H__ 21#define __ASM_ARCH_MXC_VMALLOC_H__
22 22
23/*! 23/* vmalloc ending address */
24 * @file vmalloc.h
25 *
26 * @brief This file contains platform specific macros for vmalloc.
27 *
28 * @ingroup System
29 */
30
31/*!
32 * vmalloc ending address
33 */
34#define VMALLOC_END 0xF4000000 24#define VMALLOC_END 0xF4000000
35 25
36#endif /* __ASM_ARCH_MXC_VMALLOC_H__ */ 26#endif /* __ASM_ARCH_MXC_VMALLOC_H__ */
diff --git a/include/asm-arm/arch-ns9xxx/board.h b/include/asm-arm/arch-ns9xxx/board.h
index 716f34fdb716..e57443bdbbd9 100644
--- a/include/asm-arm/arch-ns9xxx/board.h
+++ b/include/asm-arm/arch-ns9xxx/board.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * include/asm-arm/arch-ns9xxx/board.h 2 * include/asm-arm/arch-ns9xxx/board.h
3 * 3 *
4 * Copyright (C) 2006 by Digi International Inc. 4 * Copyright (C) 2006,2007 by Digi International Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify it 7 * This program is free software; you can redistribute it and/or modify it
@@ -13,8 +13,30 @@
13 13
14#include <asm/mach-types.h> 14#include <asm/mach-types.h>
15 15
16#define board_is_a9m9750dev() (machine_is_cc9p9360dev()) 16#define board_is_a9m9750dev() (0 \
17 || machine_is_cc9p9360dev() \
18 || machine_is_cc9p9750dev() \
19 )
17 20
18#define board_is_jscc9p9360() (machine_is_cc9p9360js()) 21#define board_is_a9mvali() (0 \
22 || machine_is_cc9p9360val() \
23 || machine_is_cc9p9750val() \
24 )
25
26#define board_is_jscc9p9210() (0 \
27 || machine_is_cc9p9210js() \
28 )
29
30#define board_is_jscc9p9215() (0 \
31 || machine_is_cc9p9215js() \
32 )
33
34#define board_is_jscc9p9360() (0 \
35 || machine_is_cc9p9360js() \
36 )
37
38#define board_is_uncbas() (0 \
39 || machine_is_cc7ucamry() \
40 )
19 41
20#endif /* ifndef __ASM_ARCH_BOARD_H */ 42#endif /* ifndef __ASM_ARCH_BOARD_H */
diff --git a/include/asm-arm/arch-ns9xxx/clock.h b/include/asm-arm/arch-ns9xxx/clock.h
deleted file mode 100644
index b943d3a92a1d..000000000000
--- a/include/asm-arm/arch-ns9xxx/clock.h
+++ /dev/null
@@ -1,71 +0,0 @@
1/*
2 * include/asm-arm/arch-ns9xxx/clock.h
3 *
4 * Copyright (C) 2007 by Digi International Inc.
5 * All rights reserved.
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License version 2 as published by
9 * the Free Software Foundation.
10 */
11#ifndef __ASM_ARCH_CLOCK_H
12#define __ASM_ARCH_CLOCK_H
13
14#include <asm/arch-ns9xxx/regs-sys.h>
15
16#define CRYSTAL 29491200 /* Hz */
17
18/* The HRM calls this value f_vco */
19static inline u32 ns9xxx_systemclock(void) __attribute__((const));
20static inline u32 ns9xxx_systemclock(void)
21{
22 u32 pll = __raw_readl(SYS_PLL);
23
24 /*
25 * The system clock should be a multiple of HZ * TIMERCLOCKSELECT (in
26 * time.c).
27 *
28 * The following values are given:
29 * - TIMERCLOCKSELECT == 2^i for an i in {0 .. 6}
30 * - CRYSTAL == 29491200 == 2^17 * 3^2 * 5^2
31 * - ND in {0 .. 31}
32 * - FS in {0 .. 3}
33 *
34 * Assuming the worst, we consider:
35 * - TIMERCLOCKSELECT == 64
36 * - ND == 0
37 * - FS == 3
38 *
39 * So HZ should be a divisor of:
40 * (CRYSTAL * (ND + 1) >> FS) / TIMERCLOCKSELECT
41 * == (2^17 * 3^2 * 5^2 * 1 >> 3) / 64
42 * == 2^8 * 3^2 * 5^2
43 * == 57600
44 *
45 * Currently HZ is defined to be 100 for this platform.
46 *
47 * Fine.
48 */
49 return CRYSTAL * (REGGETIM(pll, SYS_PLL, ND) + 1)
50 >> REGGETIM(pll, SYS_PLL, FS);
51}
52
53static inline u32 ns9xxx_cpuclock(void) __attribute__((const));
54static inline u32 ns9xxx_cpuclock(void)
55{
56 return ns9xxx_systemclock() / 2;
57}
58
59static inline u32 ns9xxx_ahbclock(void) __attribute__((const));
60static inline u32 ns9xxx_ahbclock(void)
61{
62 return ns9xxx_systemclock() / 4;
63}
64
65static inline u32 ns9xxx_bbusclock(void) __attribute__((const));
66static inline u32 ns9xxx_bbusclock(void)
67{
68 return ns9xxx_systemclock() / 8;
69}
70
71#endif /* ifndef __ASM_ARCH_CLOCK_H */
diff --git a/include/asm-arm/arch-ns9xxx/entry-macro.S b/include/asm-arm/arch-ns9xxx/entry-macro.S
index 86aec87303e4..89a21c530468 100644
--- a/include/asm-arm/arch-ns9xxx/entry-macro.S
+++ b/include/asm-arm/arch-ns9xxx/entry-macro.S
@@ -1,7 +1,7 @@
1/* 1/*
2 * include/asm-arm/arch-ns9xxx/entry-macro.S 2 * include/asm-arm/arch-ns9xxx/entry-macro.S
3 * 3 *
4 * Copyright (C) 2006 by Digi International Inc. 4 * Copyright (C) 2006,2007 by Digi International Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify it 7 * This program is free software; you can redistribute it and/or modify it
@@ -9,16 +9,16 @@
9 * the Free Software Foundation. 9 * the Free Software Foundation.
10 */ 10 */
11#include <asm/hardware.h> 11#include <asm/hardware.h>
12#include <asm/arch-ns9xxx/regs-sys.h> 12#include <asm/arch-ns9xxx/regs-sys-common.h>
13 13
14 .macro get_irqnr_preamble, base, tmp 14 .macro get_irqnr_preamble, base, tmp
15 ldr \base, =SYS_ISRADDR
15 .endm 16 .endm
16 17
17 .macro arch_ret_to_user, tmp1, tmp2 18 .macro arch_ret_to_user, tmp1, tmp2
18 .endm 19 .endm
19 20
20 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp 21 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
21 ldr \base, =SYS_ISRADDR
22 ldr \irqstat, [\base, #(SYS_ISA - SYS_ISRADDR)] 22 ldr \irqstat, [\base, #(SYS_ISA - SYS_ISRADDR)]
23 cmp \irqstat, #0 23 cmp \irqstat, #0
24 ldrne \irqnr, [\base] 24 ldrne \irqnr, [\base]
diff --git a/include/asm-arm/arch-ns9xxx/irqs.h b/include/asm-arm/arch-ns9xxx/irqs.h
index 25d8d28b27f3..e83d48ec42c9 100644
--- a/include/asm-arm/arch-ns9xxx/irqs.h
+++ b/include/asm-arm/arch-ns9xxx/irqs.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * include/asm-arm/arch-ns9xxx/irqs.h 2 * include/asm-arm/arch-ns9xxx/irqs.h
3 * 3 *
4 * Copyright (C) 2006 by Digi International Inc. 4 * Copyright (C) 2006,2007 by Digi International Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify it 7 * This program is free software; you can redistribute it and/or modify it
@@ -11,38 +11,39 @@
11#ifndef __ASM_ARCH_IRQS_H 11#ifndef __ASM_ARCH_IRQS_H
12#define __ASM_ARCH_IRQS_H 12#define __ASM_ARCH_IRQS_H
13 13
14#define IRQ_WATCHDOG 0 14/* NetSilicon 9360 */
15#define IRQ_AHBBUSERR 1 15#define IRQ_NS9XXX_WATCHDOG 0
16#define IRQ_BBUSAGG 2 16#define IRQ_NS9XXX_AHBBUSERR 1
17#define IRQ_NS9360_BBUSAGG 2
17/* irq 3 is reserved for NS9360 */ 18/* irq 3 is reserved for NS9360 */
18#define IRQ_ETHRX 4 19#define IRQ_NS9XXX_ETHRX 4
19#define IRQ_ETHTX 5 20#define IRQ_NS9XXX_ETHTX 5
20#define IRQ_ETHPHY 6 21#define IRQ_NS9XXX_ETHPHY 6
21#define IRQ_LCD 7 22#define IRQ_NS9360_LCD 7
22#define IRQ_SERBRX 8 23#define IRQ_NS9360_SERBRX 8
23#define IRQ_SERBTX 9 24#define IRQ_NS9360_SERBTX 9
24#define IRQ_SERARX 10 25#define IRQ_NS9360_SERARX 10
25#define IRQ_SERATX 11 26#define IRQ_NS9360_SERATX 11
26#define IRQ_SERCRX 12 27#define IRQ_NS9360_SERCRX 12
27#define IRQ_SERCTX 13 28#define IRQ_NS9360_SERCTX 13
28#define IRQ_I2C 14 29#define IRQ_NS9360_I2C 14
29#define IRQ_BBUSDMA 15 30#define IRQ_NS9360_BBUSDMA 15
30#define IRQ_TIMER0 16 31#define IRQ_NS9360_TIMER0 16
31#define IRQ_TIMER1 17 32#define IRQ_NS9360_TIMER1 17
32#define IRQ_TIMER2 18 33#define IRQ_NS9360_TIMER2 18
33#define IRQ_TIMER3 19 34#define IRQ_NS9360_TIMER3 19
34#define IRQ_TIMER4 20 35#define IRQ_NS9360_TIMER4 20
35#define IRQ_TIMER5 21 36#define IRQ_NS9360_TIMER5 21
36#define IRQ_TIMER6 22 37#define IRQ_NS9360_TIMER6 22
37#define IRQ_TIMER7 23 38#define IRQ_NS9360_TIMER7 23
38#define IRQ_RTC 24 39#define IRQ_NS9360_RTC 24
39#define IRQ_USBHOST 25 40#define IRQ_NS9360_USBHOST 25
40#define IRQ_USBDEVICE 26 41#define IRQ_NS9360_USBDEVICE 26
41#define IRQ_IEEE1284 27 42#define IRQ_NS9360_IEEE1284 27
42#define IRQ_EXT0 28 43#define IRQ_NS9XXX_EXT0 28
43#define IRQ_EXT1 29 44#define IRQ_NS9XXX_EXT1 29
44#define IRQ_EXT2 30 45#define IRQ_NS9XXX_EXT2 30
45#define IRQ_EXT3 31 46#define IRQ_NS9XXX_EXT3 31
46 47
47#define BBUS_IRQ(irq) (32 + irq) 48#define BBUS_IRQ(irq) (32 + irq)
48 49
@@ -67,7 +68,7 @@
67/* 68/*
68 * these Interrupts are specific for the a9m9750dev board. 69 * these Interrupts are specific for the a9m9750dev board.
69 * They are generated by an FPGA that interrupts the CPU on 70 * They are generated by an FPGA that interrupts the CPU on
70 * IRQ_EXT2 71 * IRQ_NS9360_EXT2
71 */ 72 */
72#define FPGA_IRQ(irq) (64 + irq) 73#define FPGA_IRQ(irq) (64 + irq)
73 74
diff --git a/include/asm-arm/arch-ns9xxx/module.h b/include/asm-arm/arch-ns9xxx/module.h
new file mode 100644
index 000000000000..ac08a31111e4
--- /dev/null
+++ b/include/asm-arm/arch-ns9xxx/module.h
@@ -0,0 +1,60 @@
1/*
2 * include/asm-arm/arch-ns9xxx/module.h
3 *
4 * Copyright (C) 2007 by Digi International Inc.
5 * All rights reserved.
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License version 2 as published by
9 * the Free Software Foundation.
10 */
11#ifndef __ASM_ARCH_MODULE_H
12#define __ASM_ARCH_MODULE_H
13
14#include <asm/mach-types.h>
15
16#define module_is_cc7ucamry() (0 \
17 || machine_is_cc7ucamry() \
18 )
19
20#define module_is_cc9c() (0 \
21 || machine_is_cc9c() \
22 )
23
24#define module_is_cc9p9210() (0 \
25 || machine_is_cc9p9210() \
26 || machine_is_cc9p9210js() \
27 )
28
29#define module_is_cc9p9215() (0 \
30 || machine_is_cc9p9215() \
31 || machine_is_cc9p9215js() \
32 )
33
34#define module_is_cc9p9360() (0 \
35 || machine_is_a9m9360() \
36 || machine_is_cc9p9360dev() \
37 || machine_is_cc9p9360js() \
38 || machine_is_cc9p9360val() \
39 )
40
41#define module_is_cc9p9750() (0 \
42 || machine_is_a9m9750() \
43 || machine_is_cc9p9750dev() \
44 || machine_is_cc9p9750js() \
45 || machine_is_cc9p9750val() \
46 )
47
48#define module_is_ccw9c() (0 \
49 || machine_is_ccw9c() \
50 )
51
52#define module_is_inc20otter() (0 \
53 || machine_is_inc20otter() \
54 )
55
56#define module_is_otter() (0 \
57 || machine_is_otter() \
58 )
59
60#endif /* ifndef __ASM_ARCH_MODULE_H */
diff --git a/include/asm-arm/arch-ns9xxx/processor-ns9360.h b/include/asm-arm/arch-ns9xxx/processor-ns9360.h
new file mode 100644
index 000000000000..f3aa6c50dbe5
--- /dev/null
+++ b/include/asm-arm/arch-ns9xxx/processor-ns9360.h
@@ -0,0 +1,32 @@
1/*
2 * include/asm-arm/arch-ns9xxx/processor-ns9360.h
3 *
4 * Copyright (C) 2007 by Digi International Inc.
5 * All rights reserved.
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License version 2 as published by
9 * the Free Software Foundation.
10 */
11#ifndef __ASM_ARCH_PROCESSORNS9360_H
12#define __ASM_ARCH_PROCESSORNS9360_H
13
14#include <linux/init.h>
15
16void ns9360_reset(char mode);
17
18unsigned long ns9360_systemclock(void) __attribute__((const));
19
20static inline unsigned long ns9360_cpuclock(void) __attribute__((const));
21static inline unsigned long ns9360_cpuclock(void)
22{
23 return ns9360_systemclock() / 2;
24}
25
26void __init ns9360_map_io(void);
27
28extern struct sys_timer ns9360_timer;
29
30int ns9360_gpio_configure(unsigned gpio, int inv, int func);
31
32#endif /* ifndef __ASM_ARCH_PROCESSORNS9360_H */
diff --git a/include/asm-arm/arch-ns9xxx/processor.h b/include/asm-arm/arch-ns9xxx/processor.h
index 223e51b8e104..f7b53b65de81 100644
--- a/include/asm-arm/arch-ns9xxx/processor.h
+++ b/include/asm-arm/arch-ns9xxx/processor.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * include/asm-arm/arch-ns9xxx/processor.h 2 * include/asm-arm/arch-ns9xxx/processor.h
3 * 3 *
4 * Copyright (C) 2006 by Digi International Inc. 4 * Copyright (C) 2006,2007 by Digi International Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify it 7 * This program is free software; you can redistribute it and/or modify it
@@ -11,9 +11,32 @@
11#ifndef __ASM_ARCH_PROCESSOR_H 11#ifndef __ASM_ARCH_PROCESSOR_H
12#define __ASM_ARCH_PROCESSOR_H 12#define __ASM_ARCH_PROCESSOR_H
13 13
14#include <asm/mach-types.h> 14#include <asm/arch-ns9xxx/module.h>
15 15
16#define processor_is_ns9360() (machine_is_cc9p9360dev() \ 16#define processor_is_ns9210() (0 \
17 || machine_is_cc9p9360js()) 17 || module_is_cc7ucamry() \
18 || module_is_cc9p9210() \
19 || module_is_inc20otter() \
20 || module_is_otter() \
21 )
22
23#define processor_is_ns9215() (0 \
24 || module_is_cc9p9215() \
25 )
26
27#define processor_is_ns9360() (0 \
28 || module_is_cc9p9360() \
29 || module_is_cc9c() \
30 || module_is_ccw9c() \
31 )
32
33#define processor_is_ns9750() (0 \
34 || module_is_cc9p9750() \
35 )
36
37#define processor_is_ns921x() (0 \
38 || processor_is_ns9210() \
39 || processor_is_ns9215() \
40 )
18 41
19#endif /* ifndef __ASM_ARCH_PROCESSOR_H */ 42#endif /* ifndef __ASM_ARCH_PROCESSOR_H */
diff --git a/include/asm-arm/arch-ns9xxx/regs-sys-common.h b/include/asm-arm/arch-ns9xxx/regs-sys-common.h
new file mode 100644
index 000000000000..956c57cb781f
--- /dev/null
+++ b/include/asm-arm/arch-ns9xxx/regs-sys-common.h
@@ -0,0 +1,31 @@
1/*
2 * include/asm-arm/arch-ns9xxx/regs-sys-common.h
3 *
4 * Copyright (C) 2007 by Digi International Inc.
5 * All rights reserved.
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License version 2 as published by
9 * the Free Software Foundation.
10 */
11
12#ifndef __ASM_ARCH_REGSSYSCOMMON_H
13#define __ASM_ARCH_REGSSYSCOMMON_H
14#include <asm/hardware.h>
15
16/* Interrupt Vector Address Register Level x */
17#define SYS_IVA(x) __REG2(0xa09000c4, (x))
18
19/* Interrupt Configuration registers */
20#define SYS_IC(x) __REG2(0xa0900144, (x))
21
22/* ISRADDR */
23#define SYS_ISRADDR __REG(0xa0900164)
24
25/* Interrupt Status Active */
26#define SYS_ISA __REG(0xa0900168)
27
28/* Interrupt Status Raw */
29#define SYS_ISR __REG(0xa090016c)
30
31#endif /* ifndef __ASM_ARCH_REGSSYSCOMMON_H */
diff --git a/include/asm-arm/arch-ns9xxx/regs-sys.h b/include/asm-arm/arch-ns9xxx/regs-sys-ns9360.h
index 749262f86204..318b6945afb6 100644
--- a/include/asm-arm/arch-ns9xxx/regs-sys.h
+++ b/include/asm-arm/arch-ns9xxx/regs-sys-ns9360.h
@@ -1,15 +1,15 @@
1/* 1/*
2 * include/asm-arm/arch-ns9xxx/regs-sys.h 2 * include/asm-arm/arch-ns9xxx/regs-sys-ns9360.h
3 * 3 *
4 * Copyright (C) 2006 by Digi International Inc. 4 * Copyright (C) 2006,2007 by Digi International Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify it 7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License version 2 as published by 8 * under the terms of the GNU General Public License version 2 as published by
9 * the Free Software Foundation. 9 * the Free Software Foundation.
10 */ 10 */
11#ifndef __ASM_ARCH_REGSSYS_H 11#ifndef __ASM_ARCH_REGSSYSNS9360_H
12#define __ASM_ARCH_REGSSYS_H 12#define __ASM_ARCH_REGSSYSNS9360_H
13 13
14#include <asm/hardware.h> 14#include <asm/hardware.h>
15 15
@@ -27,21 +27,6 @@
27/* Timer x Read register */ 27/* Timer x Read register */
28#define SYS_TR(x) __REG2(0xa0900084, (x)) 28#define SYS_TR(x) __REG2(0xa0900084, (x))
29 29
30/* Interrupt Vector Address Register Level x */
31#define SYS_IVA(x) __REG2(0xa09000c4, (x))
32
33/* Interrupt Configuration registers */
34#define SYS_IC(x) __REG2(0xa0900144, (x))
35
36/* ISRADDR */
37#define SYS_ISRADDR __REG(0xa0900164)
38
39/* Interrupt Status Active */
40#define SYS_ISA __REG(0xa0900168)
41
42/* Interrupt Status Raw */
43#define SYS_ISR __REG(0xa090016c)
44
45/* Timer Interrupt Status register */ 30/* Timer Interrupt Status register */
46#define SYS_TIS __REG(0xa0900170) 31#define SYS_TIS __REG(0xa0900170)
47 32
@@ -160,4 +145,4 @@
160#define SYS_EIC_LVEDG_LEVEL __REGVAL(SYS_EIC_LVEDG, 0) 145#define SYS_EIC_LVEDG_LEVEL __REGVAL(SYS_EIC_LVEDG, 0)
161#define SYS_EIC_LVEDG_EDGE __REGVAL(SYS_EIC_LVEDG, 1) 146#define SYS_EIC_LVEDG_EDGE __REGVAL(SYS_EIC_LVEDG, 1)
162 147
163#endif /* ifndef __ASM_ARCH_REGSSYS_H */ 148#endif /* ifndef __ASM_ARCH_REGSSYSNS9360_H */
diff --git a/include/asm-arm/arch-ns9xxx/system.h b/include/asm-arm/arch-ns9xxx/system.h
index c1082bd8977c..1348073afe48 100644
--- a/include/asm-arm/arch-ns9xxx/system.h
+++ b/include/asm-arm/arch-ns9xxx/system.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * include/asm-arm/arch-ns9xxx/system.h 2 * include/asm-arm/arch-ns9xxx/system.h
3 * 3 *
4 * Copyright (C) 2006 by Digi International Inc. 4 * Copyright (C) 2006,2007 by Digi International Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify it 7 * This program is free software; you can redistribute it and/or modify it
@@ -12,8 +12,8 @@
12#define __ASM_ARCH_SYSTEM_H 12#define __ASM_ARCH_SYSTEM_H
13 13
14#include <asm/proc-fns.h> 14#include <asm/proc-fns.h>
15#include <asm/arch-ns9xxx/regs-sys.h> 15#include <asm/arch-ns9xxx/processor.h>
16#include <asm/mach-types.h> 16#include <asm/arch-ns9xxx/processor-ns9360.h>
17 17
18static inline void arch_idle(void) 18static inline void arch_idle(void)
19{ 19{
@@ -22,11 +22,12 @@ static inline void arch_idle(void)
22 22
23static inline void arch_reset(char mode) 23static inline void arch_reset(char mode)
24{ 24{
25 u32 reg; 25#ifdef CONFIG_PROCESSOR_NS9360
26 26 if (processor_is_ns9360())
27 reg = __raw_readl(SYS_PLL) >> 16; 27 ns9360_reset(mode);
28 REGSET(reg, SYS_PLL, SWC, YES); 28 else
29 __raw_writel(reg, SYS_PLL); 29#endif
30 BUG();
30 31
31 BUG(); 32 BUG();
32} 33}
diff --git a/include/asm-arm/arch-ns9xxx/uncompress.h b/include/asm-arm/arch-ns9xxx/uncompress.h
index 961ca7dc9954..71066baceab7 100644
--- a/include/asm-arm/arch-ns9xxx/uncompress.h
+++ b/include/asm-arm/arch-ns9xxx/uncompress.h
@@ -11,20 +11,149 @@
11#ifndef __ASM_ARCH_UNCOMPRESS_H 11#ifndef __ASM_ARCH_UNCOMPRESS_H
12#define __ASM_ARCH_UNCOMPRESS_H 12#define __ASM_ARCH_UNCOMPRESS_H
13 13
14static void putc(char c) 14#include <asm/io.h>
15
16#define __REG(x) ((void __iomem __force *)(x))
17
18static void putc_dummy(char c, void __iomem *base)
15{ 19{
16 volatile u8 *base = (volatile u8 *)0x40000000; 20 /* nothing */
17 int t = 0x10000; 21}
18 22
23static void putc_ns9360(char c, void __iomem *base)
24{
25 static int t = 0x10000;
26 do {
27 if (t)
28 --t;
29
30 if (__raw_readl(base + 8) & (1 << 3)) {
31 __raw_writeb(c, base + 16);
32 t = 0x10000;
33 break;
34 }
35 } while (t);
36}
37
38static void putc_a9m9750dev(char c, void __iomem *base)
39{
40 static int t = 0x10000;
41 do {
42 if (t)
43 --t;
44
45 if (__raw_readb(base + 5) & (1 << 5)) {
46 __raw_writeb(c, base);
47 t = 0x10000;
48 break;
49 }
50 } while (t);
51
52}
53
54static void putc_ns921x(char c, void __iomem *base)
55{
56 static int t = 0x10000;
19 do { 57 do {
20 if (base[5] & 0x20) { 58 if (t)
21 base[0] = c; 59 --t;
60
61 if (!(__raw_readl(base) & (1 << 11))) {
62 __raw_writeb(c, base + 0x0028);
63 t = 0x10000;
22 break; 64 break;
23 } 65 }
24 } while (--t); 66 } while (t);
25} 67}
26 68
27#define arch_decomp_setup() 69#define MSCS __REG(0xA0900184)
70
71#define NS9360_UARTA __REG(0x90200040)
72#define NS9360_UARTB __REG(0x90200000)
73#define NS9360_UARTC __REG(0x90300000)
74#define NS9360_UARTD __REG(0x90300040)
75
76#define NS9360_UART_ENABLED(base) \
77 (__raw_readl(NS9360_UARTA) & (1 << 31))
78
79#define A9M9750DEV_UARTA __REG(0x40000000)
80
81#define NS921XSYS_CLOCK __REG(0xa090017c)
82#define NS921X_UARTA __REG(0x90010000)
83#define NS921X_UARTB __REG(0x90018000)
84#define NS921X_UARTC __REG(0x90020000)
85#define NS921X_UARTD __REG(0x90028000)
86
87#define NS921X_UART_ENABLED(base) \
88 (__raw_readl((base) + 0x1000) & (1 << 29))
89
90static void autodetect(void (**putc)(char, void __iomem *), void __iomem **base)
91{
92 if (((__raw_readl(MSCS) >> 16) & 0xfe) == 0x00) {
93 /* ns9360 or ns9750 */
94 if (NS9360_UART_ENABLED(NS9360_UARTA)) {
95 *putc = putc_ns9360;
96 *base = NS9360_UARTA;
97 return;
98 } else if (NS9360_UART_ENABLED(NS9360_UARTB)) {
99 *putc = putc_ns9360;
100 *base = NS9360_UARTB;
101 return;
102 } else if (NS9360_UART_ENABLED(NS9360_UARTC)) {
103 *putc = putc_ns9360;
104 *base = NS9360_UARTC;
105 return;
106 } else if (NS9360_UART_ENABLED(NS9360_UARTD)) {
107 *putc = putc_ns9360;
108 *base = NS9360_UARTD;
109 return;
110 } else if (__raw_readl(__REG(0xa09001f4)) == 0xfffff001) {
111 *putc = putc_a9m9750dev;
112 *base = A9M9750DEV_UARTA;
113 return;
114 }
115 } else if (((__raw_readl(MSCS) >> 16) & 0xfe) == 0x02) {
116 /* ns921x */
117 u32 clock = __raw_readl(NS921XSYS_CLOCK);
118
119 if ((clock & (1 << 1)) &&
120 NS921X_UART_ENABLED(NS921X_UARTA)) {
121 *putc = putc_ns921x;
122 *base = NS921X_UARTA;
123 return;
124 } else if ((clock & (1 << 2)) &&
125 NS921X_UART_ENABLED(NS921X_UARTB)) {
126 *putc = putc_ns921x;
127 *base = NS921X_UARTB;
128 return;
129 } else if ((clock & (1 << 3)) &&
130 NS921X_UART_ENABLED(NS921X_UARTC)) {
131 *putc = putc_ns921x;
132 *base = NS921X_UARTC;
133 return;
134 } else if ((clock & (1 << 4)) &&
135 NS921X_UART_ENABLED(NS921X_UARTD)) {
136 *putc = putc_ns921x;
137 *base = NS921X_UARTD;
138 return;
139 }
140 }
141
142 *putc = putc_dummy;
143}
144
145void (*myputc)(char, void __iomem *);
146void __iomem *base;
147
148static void putc(char c)
149{
150 myputc(c, base);
151}
152
153static void arch_decomp_setup(void)
154{
155 autodetect(&myputc, &base);
156}
28#define arch_decomp_wdog() 157#define arch_decomp_wdog()
29 158
30static void flush(void) 159static void flush(void)
diff --git a/include/asm-arm/arch-omap/board-osk.h b/include/asm-arm/arch-omap/board-osk.h
index 2b1a8a4fe44e..94926090e475 100644
--- a/include/asm-arm/arch-omap/board-osk.h
+++ b/include/asm-arm/arch-omap/board-osk.h
@@ -32,5 +32,16 @@
32/* At OMAP5912 OSK the Ethernet is directly connected to CS1 */ 32/* At OMAP5912 OSK the Ethernet is directly connected to CS1 */
33#define OMAP_OSK_ETHR_START 0x04800300 33#define OMAP_OSK_ETHR_START 0x04800300
34 34
35/* TPS65010 has four GPIOs. nPG and LED2 can be treated like GPIOs with
36 * alternate pin configurations for hardware-controlled blinking.
37 */
38#define OSK_TPS_GPIO_BASE (OMAP_MAX_GPIO_LINES + 16 /* MPUIO */)
39# define OSK_TPS_GPIO_USB_PWR_EN (OSK_TPS_GPIO_BASE + 0)
40# define OSK_TPS_GPIO_LED_D3 (OSK_TPS_GPIO_BASE + 1)
41# define OSK_TPS_GPIO_LAN_RESET (OSK_TPS_GPIO_BASE + 2)
42# define OSK_TPS_GPIO_DSP_PWR_EN (OSK_TPS_GPIO_BASE + 3)
43# define OSK_TPS_GPIO_LED_D9 (OSK_TPS_GPIO_BASE + 4)
44# define OSK_TPS_GPIO_LED_D2 (OSK_TPS_GPIO_BASE + 5)
45
35#endif /* __ASM_ARCH_OMAP_OSK_H */ 46#endif /* __ASM_ARCH_OMAP_OSK_H */
36 47
diff --git a/include/asm-arm/arch-omap/clock.h b/include/asm-arm/arch-omap/clock.h
index fa6881049903..57523bdb642b 100644
--- a/include/asm-arm/arch-omap/clock.h
+++ b/include/asm-arm/arch-omap/clock.h
@@ -14,6 +14,35 @@
14#define __ARCH_ARM_OMAP_CLOCK_H 14#define __ARCH_ARM_OMAP_CLOCK_H
15 15
16struct module; 16struct module;
17struct clk;
18
19#if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3)
20
21struct clksel_rate {
22 u8 div;
23 u32 val;
24 u8 flags;
25};
26
27struct clksel {
28 struct clk *parent;
29 const struct clksel_rate *rates;
30};
31
32struct dpll_data {
33 void __iomem *mult_div1_reg;
34 u32 mult_mask;
35 u32 div1_mask;
36# if defined(CONFIG_ARCH_OMAP3)
37 void __iomem *control_reg;
38 u32 enable_mask;
39 u8 auto_recal_bit;
40 u8 recal_en_bit;
41 u8 recal_st_bit;
42# endif
43};
44
45#endif
17 46
18struct clk { 47struct clk {
19 struct list_head node; 48 struct list_head node;
@@ -25,8 +54,6 @@ struct clk {
25 __u32 flags; 54 __u32 flags;
26 void __iomem *enable_reg; 55 void __iomem *enable_reg;
27 __u8 enable_bit; 56 __u8 enable_bit;
28 __u8 rate_offset;
29 __u8 src_offset;
30 __s8 usecount; 57 __s8 usecount;
31 void (*recalc)(struct clk *); 58 void (*recalc)(struct clk *);
32 int (*set_rate)(struct clk *, unsigned long); 59 int (*set_rate)(struct clk *, unsigned long);
@@ -34,6 +61,16 @@ struct clk {
34 void (*init)(struct clk *); 61 void (*init)(struct clk *);
35 int (*enable)(struct clk *); 62 int (*enable)(struct clk *);
36 void (*disable)(struct clk *); 63 void (*disable)(struct clk *);
64#if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3)
65 u8 fixed_div;
66 void __iomem *clksel_reg;
67 u32 clksel_mask;
68 const struct clksel *clksel;
69 const struct dpll_data *dpll_data;
70#else
71 __u8 rate_offset;
72 __u8 src_offset;
73#endif
37}; 74};
38 75
39struct clk_functions { 76struct clk_functions {
@@ -54,10 +91,12 @@ extern int clk_init(struct clk_functions * custom_clocks);
54extern int clk_register(struct clk *clk); 91extern int clk_register(struct clk *clk);
55extern void clk_unregister(struct clk *clk); 92extern void clk_unregister(struct clk *clk);
56extern void propagate_rate(struct clk *clk); 93extern void propagate_rate(struct clk *clk);
94extern void recalculate_root_clocks(void);
57extern void followparent_recalc(struct clk * clk); 95extern void followparent_recalc(struct clk * clk);
58extern void clk_allow_idle(struct clk *clk); 96extern void clk_allow_idle(struct clk *clk);
59extern void clk_deny_idle(struct clk *clk); 97extern void clk_deny_idle(struct clk *clk);
60extern int clk_get_usecount(struct clk *clk); 98extern int clk_get_usecount(struct clk *clk);
99extern void clk_enable_init_clocks(void);
61 100
62/* Clock flags */ 101/* Clock flags */
63#define RATE_CKCTL (1 << 0) /* Main fixed ratio clocks */ 102#define RATE_CKCTL (1 << 0) /* Main fixed ratio clocks */
@@ -71,21 +110,33 @@ extern int clk_get_usecount(struct clk *clk);
71#define CLOCK_NO_IDLE_PARENT (1 << 8) 110#define CLOCK_NO_IDLE_PARENT (1 << 8)
72#define DELAYED_APP (1 << 9) /* Delay application of clock */ 111#define DELAYED_APP (1 << 9) /* Delay application of clock */
73#define CONFIG_PARTICIPANT (1 << 10) /* Fundamental clock */ 112#define CONFIG_PARTICIPANT (1 << 10) /* Fundamental clock */
74#define CM_MPU_SEL1 (1 << 11) /* Domain divider/source */ 113#define ENABLE_ON_INIT (1 << 11) /* Enable upon framework init */
75#define CM_DSP_SEL1 (1 << 12) 114#define INVERT_ENABLE (1 << 12) /* 0 enables, 1 disables */
76#define CM_GFX_SEL1 (1 << 13) 115/* bits 13-20 are currently free */
77#define CM_MODEM_SEL1 (1 << 14)
78#define CM_CORE_SEL1 (1 << 15) /* Sets divider for many */
79#define CM_CORE_SEL2 (1 << 16) /* sets parent for GPT */
80#define CM_WKUP_SEL1 (1 << 17)
81#define CM_PLL_SEL1 (1 << 18)
82#define CM_PLL_SEL2 (1 << 19)
83#define CM_SYSCLKOUT_SEL1 (1 << 20)
84#define CLOCK_IN_OMAP310 (1 << 21) 116#define CLOCK_IN_OMAP310 (1 << 21)
85#define CLOCK_IN_OMAP730 (1 << 22) 117#define CLOCK_IN_OMAP730 (1 << 22)
86#define CLOCK_IN_OMAP1510 (1 << 23) 118#define CLOCK_IN_OMAP1510 (1 << 23)
87#define CLOCK_IN_OMAP16XX (1 << 24) 119#define CLOCK_IN_OMAP16XX (1 << 24)
88#define CLOCK_IN_OMAP242X (1 << 25) 120#define CLOCK_IN_OMAP242X (1 << 25)
89#define CLOCK_IN_OMAP243X (1 << 26) 121#define CLOCK_IN_OMAP243X (1 << 26)
122#define CLOCK_IN_OMAP343X (1 << 27) /* clocks common to all 343X */
123#define PARENT_CONTROLS_CLOCK (1 << 28)
124#define CLOCK_IN_OMAP3430ES1 (1 << 29) /* 3430ES1 clocks only */
125#define CLOCK_IN_OMAP3430ES2 (1 << 30) /* 3430ES2 clocks only */
126
127/* Clksel_rate flags */
128#define DEFAULT_RATE (1 << 0)
129#define RATE_IN_242X (1 << 1)
130#define RATE_IN_243X (1 << 2)
131#define RATE_IN_343X (1 << 3) /* rates common to all 343X */
132#define RATE_IN_3430ES2 (1 << 4) /* 3430ES2 rates only */
133
134#define RATE_IN_24XX (RATE_IN_242X | RATE_IN_243X)
135
136
137/* CM_CLKSEL2_PLL.CORE_CLK_SRC options (24XX) */
138#define CORE_CLK_SRC_32K 0
139#define CORE_CLK_SRC_DPLL 1
140#define CORE_CLK_SRC_DPLL_X2 2
90 141
91#endif 142#endif
diff --git a/include/asm-arm/arch-omap/control.h b/include/asm-arm/arch-omap/control.h
new file mode 100644
index 000000000000..9944bb5d5330
--- /dev/null
+++ b/include/asm-arm/arch-omap/control.h
@@ -0,0 +1,191 @@
1#ifndef __ASM_ARCH_CONTROL_H
2#define __ASM_ARCH_CONTROL_H
3
4/*
5 * include/asm-arm/arch-omap/control.h
6 *
7 * OMAP2/3 System Control Module definitions
8 *
9 * Copyright (C) 2007 Texas Instruments, Inc.
10 * Copyright (C) 2007 Nokia Corporation
11 *
12 * Written by Paul Walmsley
13 *
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation.
17 */
18
19#include <asm/arch/io.h>
20
21#define OMAP242X_CTRL_REGADDR(reg) \
22 (void __iomem *)IO_ADDRESS(OMAP242X_CTRL_BASE + (reg))
23#define OMAP243X_CTRL_REGADDR(reg) \
24 (void __iomem *)IO_ADDRESS(OMAP243X_CTRL_BASE + (reg))
25#define OMAP343X_CTRL_REGADDR(reg) \
26 (void __iomem *)IO_ADDRESS(OMAP343X_CTRL_BASE + (reg))
27
28/*
29 * As elsewhere, the "OMAP2_" prefix indicates that the macro is valid for
30 * OMAP24XX and OMAP34XX.
31 */
32
33/* Control submodule offsets */
34
35#define OMAP2_CONTROL_INTERFACE 0x000
36#define OMAP2_CONTROL_PADCONFS 0x030
37#define OMAP2_CONTROL_GENERAL 0x270
38#define OMAP343X_CONTROL_MEM_WKUP 0x600
39#define OMAP343X_CONTROL_PADCONFS_WKUP 0xa00
40#define OMAP343X_CONTROL_GENERAL_WKUP 0xa60
41
42/* Control register offsets - read/write with omap_ctrl_{read,write}{bwl}() */
43
44#define OMAP2_CONTROL_SYSCONFIG (OMAP2_CONTROL_INTERFACE + 0x10)
45
46/* CONTROL_GENERAL register offsets common to OMAP2 & 3 */
47#define OMAP2_CONTROL_DEVCONF0 (OMAP2_CONTROL_GENERAL + 0x0004)
48#define OMAP2_CONTROL_MSUSPENDMUX_0 (OMAP2_CONTROL_GENERAL + 0x0020)
49#define OMAP2_CONTROL_MSUSPENDMUX_1 (OMAP2_CONTROL_GENERAL + 0x0024)
50#define OMAP2_CONTROL_MSUSPENDMUX_2 (OMAP2_CONTROL_GENERAL + 0x0028)
51#define OMAP2_CONTROL_MSUSPENDMUX_3 (OMAP2_CONTROL_GENERAL + 0x002c)
52#define OMAP2_CONTROL_MSUSPENDMUX_4 (OMAP2_CONTROL_GENERAL + 0x0030)
53#define OMAP2_CONTROL_MSUSPENDMUX_5 (OMAP2_CONTROL_GENERAL + 0x0034)
54#define OMAP2_CONTROL_SEC_CTRL (OMAP2_CONTROL_GENERAL + 0x0040)
55#define OMAP2_CONTROL_RPUB_KEY_H_0 (OMAP2_CONTROL_GENERAL + 0x0090)
56#define OMAP2_CONTROL_RPUB_KEY_H_1 (OMAP2_CONTROL_GENERAL + 0x0094)
57#define OMAP2_CONTROL_RPUB_KEY_H_2 (OMAP2_CONTROL_GENERAL + 0x0098)
58#define OMAP2_CONTROL_RPUB_KEY_H_3 (OMAP2_CONTROL_GENERAL + 0x009c)
59
60/* 242x-only CONTROL_GENERAL register offsets */
61#define OMAP242X_CONTROL_DEVCONF OMAP2_CONTROL_DEVCONF0 /* match TRM */
62#define OMAP242X_CONTROL_OCM_RAM_PERM (OMAP2_CONTROL_GENERAL + 0x0068)
63
64/* 243x-only CONTROL_GENERAL register offsets */
65/* CONTROL_IVA2_BOOT{ADDR,MOD} are at the same place on 343x - noted below */
66#define OMAP243X_CONTROL_DEVCONF1 (OMAP2_CONTROL_GENERAL + 0x0078)
67#define OMAP243X_CONTROL_CSIRXFE (OMAP2_CONTROL_GENERAL + 0x007c)
68#define OMAP243X_CONTROL_IVA2_BOOTADDR (OMAP2_CONTROL_GENERAL + 0x0190)
69#define OMAP243X_CONTROL_IVA2_BOOTMOD (OMAP2_CONTROL_GENERAL + 0x0194)
70#define OMAP243X_CONTROL_IVA2_GEMCFG (OMAP2_CONTROL_GENERAL + 0x0198)
71
72/* 24xx-only CONTROL_GENERAL register offsets */
73#define OMAP24XX_CONTROL_DEBOBS (OMAP2_CONTROL_GENERAL + 0x0000)
74#define OMAP24XX_CONTROL_EMU_SUPPORT (OMAP2_CONTROL_GENERAL + 0x0008)
75#define OMAP24XX_CONTROL_SEC_TEST (OMAP2_CONTROL_GENERAL + 0x0044)
76#define OMAP24XX_CONTROL_PSA_CTRL (OMAP2_CONTROL_GENERAL + 0x0048)
77#define OMAP24XX_CONTROL_PSA_CMD (OMAP2_CONTROL_GENERAL + 0x004c)
78#define OMAP24XX_CONTROL_PSA_VALUE (OMAP2_CONTROL_GENERAL + 0x0050)
79#define OMAP24XX_CONTROL_SEC_EMU (OMAP2_CONTROL_GENERAL + 0x0060)
80#define OMAP24XX_CONTROL_SEC_TAP (OMAP2_CONTROL_GENERAL + 0x0064)
81#define OMAP24XX_CONTROL_OCM_PUB_RAM_ADD (OMAP2_CONTROL_GENERAL + 0x006c)
82#define OMAP24XX_CONTROL_EXT_SEC_RAM_START_ADD (OMAP2_CONTROL_GENERAL + 0x0070)
83#define OMAP24XX_CONTROL_EXT_SEC_RAM_STOP_ADD (OMAP2_CONTROL_GENERAL + 0x0074
84#define OMAP24XX_CONTROL_SEC_STATUS (OMAP2_CONTROL_GENERAL + 0x0080)
85#define OMAP24XX_CONTROL_SEC_ERR_STATUS (OMAP2_CONTROL_GENERAL + 0x0084)
86#define OMAP24XX_CONTROL_STATUS (OMAP2_CONTROL_GENERAL + 0x0088)
87#define OMAP24XX_CONTROL_GENERAL_PURPOSE_STATUS (OMAP2_CONTROL_GENERAL + 0x008c)
88#define OMAP24XX_CONTROL_RAND_KEY_0 (OMAP2_CONTROL_GENERAL + 0x00a0)
89#define OMAP24XX_CONTROL_RAND_KEY_1 (OMAP2_CONTROL_GENERAL + 0x00a4)
90#define OMAP24XX_CONTROL_RAND_KEY_2 (OMAP2_CONTROL_GENERAL + 0x00a8)
91#define OMAP24XX_CONTROL_RAND_KEY_3 (OMAP2_CONTROL_GENERAL + 0x00ac)
92#define OMAP24XX_CONTROL_CUST_KEY_0 (OMAP2_CONTROL_GENERAL + 0x00b0)
93#define OMAP24XX_CONTROL_CUST_KEY_1 (OMAP2_CONTROL_GENERAL + 0x00b4)
94#define OMAP24XX_CONTROL_TEST_KEY_0 (OMAP2_CONTROL_GENERAL + 0x00c0)
95#define OMAP24XX_CONTROL_TEST_KEY_1 (OMAP2_CONTROL_GENERAL + 0x00c4)
96#define OMAP24XX_CONTROL_TEST_KEY_2 (OMAP2_CONTROL_GENERAL + 0x00c8)
97#define OMAP24XX_CONTROL_TEST_KEY_3 (OMAP2_CONTROL_GENERAL + 0x00cc)
98#define OMAP24XX_CONTROL_TEST_KEY_4 (OMAP2_CONTROL_GENERAL + 0x00d0)
99#define OMAP24XX_CONTROL_TEST_KEY_5 (OMAP2_CONTROL_GENERAL + 0x00d4)
100#define OMAP24XX_CONTROL_TEST_KEY_6 (OMAP2_CONTROL_GENERAL + 0x00d8)
101#define OMAP24XX_CONTROL_TEST_KEY_7 (OMAP2_CONTROL_GENERAL + 0x00dc)
102#define OMAP24XX_CONTROL_TEST_KEY_8 (OMAP2_CONTROL_GENERAL + 0x00e0)
103#define OMAP24XX_CONTROL_TEST_KEY_9 (OMAP2_CONTROL_GENERAL + 0x00e4)
104
105/* 34xx-only CONTROL_GENERAL register offsets */
106#define OMAP343X_CONTROL_PADCONF_OFF (OMAP2_CONTROL_GENERAL + 0x0000)
107#define OMAP343X_CONTROL_MEM_DFTRW0 (OMAP2_CONTROL_GENERAL + 0x0008)
108#define OMAP343X_CONTROL_MEM_DFTRW1 (OMAP2_CONTROL_GENERAL + 0x000c)
109#define OMAP343X_CONTROL_DEVCONF1 (OMAP2_CONTROL_GENERAL + 0x0068)
110#define OMAP343X_CONTROL_CSIRXFE (OMAP2_CONTROL_GENERAL + 0x006c)
111#define OMAP343X_CONTROL_SEC_STATUS (OMAP2_CONTROL_GENERAL + 0x0070)
112#define OMAP343X_CONTROL_SEC_ERR_STATUS (OMAP2_CONTROL_GENERAL + 0x0074)
113#define OMAP343X_CONTROL_SEC_ERR_STATUS_DEBUG (OMAP2_CONTROL_GENERAL + 0x0078)
114#define OMAP343X_CONTROL_STATUS (OMAP2_CONTROL_GENERAL + 0x0080)
115#define OMAP343X_CONTROL_GENERAL_PURPOSE_STATUS (OMAP2_CONTROL_GENERAL + 0x0084)
116#define OMAP343X_CONTROL_RPUB_KEY_H_4 (OMAP2_CONTROL_GENERAL + 0x00a0)
117#define OMAP343X_CONTROL_RAND_KEY_0 (OMAP2_CONTROL_GENERAL + 0x00a8)
118#define OMAP343X_CONTROL_RAND_KEY_1 (OMAP2_CONTROL_GENERAL + 0x00ac)
119#define OMAP343X_CONTROL_RAND_KEY_2 (OMAP2_CONTROL_GENERAL + 0x00b0)
120#define OMAP343X_CONTROL_RAND_KEY_3 (OMAP2_CONTROL_GENERAL + 0x00b4)
121#define OMAP343X_CONTROL_TEST_KEY_0 (OMAP2_CONTROL_GENERAL + 0x00c8)
122#define OMAP343X_CONTROL_TEST_KEY_1 (OMAP2_CONTROL_GENERAL + 0x00cc)
123#define OMAP343X_CONTROL_TEST_KEY_2 (OMAP2_CONTROL_GENERAL + 0x00d0)
124#define OMAP343X_CONTROL_TEST_KEY_3 (OMAP2_CONTROL_GENERAL + 0x00d4)
125#define OMAP343X_CONTROL_TEST_KEY_4 (OMAP2_CONTROL_GENERAL + 0x00d8)
126#define OMAP343X_CONTROL_TEST_KEY_5 (OMAP2_CONTROL_GENERAL + 0x00dc)
127#define OMAP343X_CONTROL_TEST_KEY_6 (OMAP2_CONTROL_GENERAL + 0x00e0)
128#define OMAP343X_CONTROL_TEST_KEY_7 (OMAP2_CONTROL_GENERAL + 0x00e4)
129#define OMAP343X_CONTROL_TEST_KEY_8 (OMAP2_CONTROL_GENERAL + 0x00e8)
130#define OMAP343X_CONTROL_TEST_KEY_9 (OMAP2_CONTROL_GENERAL + 0x00ec)
131#define OMAP343X_CONTROL_TEST_KEY_10 (OMAP2_CONTROL_GENERAL + 0x00f0)
132#define OMAP343X_CONTROL_TEST_KEY_11 (OMAP2_CONTROL_GENERAL + 0x00f4)
133#define OMAP343X_CONTROL_TEST_KEY_12 (OMAP2_CONTROL_GENERAL + 0x00f8)
134#define OMAP343X_CONTROL_TEST_KEY_13 (OMAP2_CONTROL_GENERAL + 0x00fc)
135#define OMAP343X_CONTROL_IVA2_BOOTADDR (OMAP2_CONTROL_GENERAL + 0x0190)
136#define OMAP343X_CONTROL_IVA2_BOOTMOD (OMAP2_CONTROL_GENERAL + 0x0194)
137
138/*
139 * REVISIT: This list of registers is not comprehensive - there are more
140 * that should be added.
141 */
142
143/*
144 * Control module register bit defines - these should eventually go into
145 * their own regbits file. Some of these will be complicated, depending
146 * on the device type (general-purpose, emulator, test, secure, bad, other)
147 * and the security mode (secure, non-secure, don't care)
148 */
149/* CONTROL_DEVCONF0 bits */
150#define OMAP24XX_USBSTANDBYCTRL (1 << 15)
151#define OMAP2_MCBSP2_CLKS_MASK (1 << 6)
152#define OMAP2_MCBSP1_CLKS_MASK (1 << 2)
153
154/* CONTROL_DEVCONF1 bits */
155#define OMAP2_MCBSP5_CLKS_MASK (1 << 4) /* > 242x */
156#define OMAP2_MCBSP4_CLKS_MASK (1 << 2) /* > 242x */
157#define OMAP2_MCBSP3_CLKS_MASK (1 << 0) /* > 242x */
158
159/* CONTROL_STATUS bits */
160#define OMAP2_DEVICETYPE_MASK (0x7 << 8)
161#define OMAP2_SYSBOOT_5_MASK (1 << 5)
162#define OMAP2_SYSBOOT_4_MASK (1 << 4)
163#define OMAP2_SYSBOOT_3_MASK (1 << 3)
164#define OMAP2_SYSBOOT_2_MASK (1 << 2)
165#define OMAP2_SYSBOOT_1_MASK (1 << 1)
166#define OMAP2_SYSBOOT_0_MASK (1 << 0)
167
168#ifndef __ASSEMBLY__
169#if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3)
170extern void omap_ctrl_base_set(u32 base);
171extern u32 omap_ctrl_base_get(void);
172extern u8 omap_ctrl_readb(u16 offset);
173extern u16 omap_ctrl_readw(u16 offset);
174extern u32 omap_ctrl_readl(u16 offset);
175extern void omap_ctrl_writeb(u8 val, u16 offset);
176extern void omap_ctrl_writew(u16 val, u16 offset);
177extern void omap_ctrl_writel(u32 val, u16 offset);
178#else
179#define omap_ctrl_base_set(x) WARN_ON(1)
180#define omap_ctrl_base_get() 0
181#define omap_ctrl_readb(x) 0
182#define omap_ctrl_readw(x) 0
183#define omap_ctrl_readl(x) 0
184#define omap_ctrl_writeb(x, y) WARN_ON(1)
185#define omap_ctrl_writew(x, y) WARN_ON(1)
186#define omap_ctrl_writel(x, y) WARN_ON(1)
187#endif
188#endif /* __ASSEMBLY__ */
189
190#endif /* __ASM_ARCH_CONTROL_H */
191
diff --git a/include/asm-arm/arch-omap/entry-macro.S b/include/asm-arm/arch-omap/entry-macro.S
index f6967c8df323..74cd57221c8e 100644
--- a/include/asm-arm/arch-omap/entry-macro.S
+++ b/include/asm-arm/arch-omap/entry-macro.S
@@ -68,7 +68,7 @@
68 .endm 68 .endm
69 69
70 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp 70 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
71 ldr \base, =VA_IC_BASE 71 ldr \base, =OMAP2_VA_IC_BASE
72 ldr \irqnr, [\base, #0x98] /* IRQ pending reg 1 */ 72 ldr \irqnr, [\base, #0x98] /* IRQ pending reg 1 */
73 cmp \irqnr, #0x0 73 cmp \irqnr, #0x0
74 bne 2222f 74 bne 2222f
diff --git a/include/asm-arm/arch-omap/gpio.h b/include/asm-arm/arch-omap/gpio.h
index 164da09be095..86621a04cd8f 100644
--- a/include/asm-arm/arch-omap/gpio.h
+++ b/include/asm-arm/arch-omap/gpio.h
@@ -82,62 +82,35 @@ extern void omap_set_gpio_debounce_time(int gpio, int enable);
82 82
83/*-------------------------------------------------------------------------*/ 83/*-------------------------------------------------------------------------*/
84 84
85/* wrappers for "new style" GPIO calls. the old OMAP-specfic ones should 85/* Wrappers for "new style" GPIO calls, using the new infrastructure
86 * eventually be removed (along with this errno.h inclusion), and maybe 86 * which lets us plug in FPGA, I2C, and other implementations.
87 * gpios should put MPUIOs last too. 87 * *
88 * The original OMAP-specfic calls should eventually be removed.
88 */ 89 */
89 90
90#include <asm/errno.h> 91#include <linux/errno.h>
91 92#include <asm-generic/gpio.h>
92static inline int gpio_request(unsigned gpio, const char *label)
93{
94 return omap_request_gpio(gpio);
95}
96
97static inline void gpio_free(unsigned gpio)
98{
99 omap_free_gpio(gpio);
100}
101
102static inline int __gpio_set_direction(unsigned gpio, int is_input)
103{
104 if (cpu_class_is_omap2()) {
105 if (gpio > OMAP_MAX_GPIO_LINES)
106 return -EINVAL;
107 } else {
108 if (gpio > (OMAP_MAX_GPIO_LINES + 16 /* MPUIO */))
109 return -EINVAL;
110 }
111 omap_set_gpio_direction(gpio, is_input);
112 return 0;
113}
114
115static inline int gpio_direction_input(unsigned gpio)
116{
117 return __gpio_set_direction(gpio, 1);
118}
119
120static inline int gpio_direction_output(unsigned gpio, int value)
121{
122 omap_set_gpio_dataout(gpio, value);
123 return __gpio_set_direction(gpio, 0);
124}
125 93
126static inline int gpio_get_value(unsigned gpio) 94static inline int gpio_get_value(unsigned gpio)
127{ 95{
128 return omap_get_gpio_datain(gpio); 96 return __gpio_get_value(gpio);
129} 97}
130 98
131static inline void gpio_set_value(unsigned gpio, int value) 99static inline void gpio_set_value(unsigned gpio, int value)
132{ 100{
133 omap_set_gpio_dataout(gpio, value); 101 __gpio_set_value(gpio, value);
134} 102}
135 103
136#include <asm-generic/gpio.h> /* cansleep wrappers */ 104static inline int gpio_cansleep(unsigned gpio)
105{
106 return __gpio_cansleep(gpio);
107}
137 108
138static inline int gpio_to_irq(unsigned gpio) 109static inline int gpio_to_irq(unsigned gpio)
139{ 110{
140 return OMAP_GPIO_IRQ(gpio); 111 if (gpio < (OMAP_MAX_GPIO_LINES + 16))
112 return OMAP_GPIO_IRQ(gpio);
113 return -EINVAL;
141} 114}
142 115
143static inline int irq_to_gpio(unsigned irq) 116static inline int irq_to_gpio(unsigned irq)
diff --git a/include/asm-arm/arch-omap/io.h b/include/asm-arm/arch-omap/io.h
index 289082d07f14..160578e1f557 100644
--- a/include/asm-arm/arch-omap/io.h
+++ b/include/asm-arm/arch-omap/io.h
@@ -80,6 +80,13 @@
80#define OMAP243X_GPMC_PHYS OMAP243X_GPMC_BASE /* 0x49000000 */ 80#define OMAP243X_GPMC_PHYS OMAP243X_GPMC_BASE /* 0x49000000 */
81#define OMAP243X_GPMC_VIRT 0xFE000000 81#define OMAP243X_GPMC_VIRT 0xFE000000
82#define OMAP243X_GPMC_SIZE SZ_1M 82#define OMAP243X_GPMC_SIZE SZ_1M
83#define OMAP243X_SDRC_PHYS OMAP243X_SDRC_BASE
84#define OMAP243X_SDRC_VIRT 0xFD000000
85#define OMAP243X_SDRC_SIZE SZ_1M
86#define OMAP243X_SMS_PHYS OMAP243X_SMS_BASE
87#define OMAP243X_SMS_VIRT 0xFC000000
88#define OMAP243X_SMS_SIZE SZ_1M
89
83#endif 90#endif
84 91
85#define IO_OFFSET 0x90000000 92#define IO_OFFSET 0x90000000
@@ -88,16 +95,73 @@
88#define io_v2p(va) ((va) - IO_OFFSET) /* Works for L3 and L4 */ 95#define io_v2p(va) ((va) - IO_OFFSET) /* Works for L3 and L4 */
89 96
90/* DSP */ 97/* DSP */
91#define DSP_MEM_24XX_PHYS OMAP24XX_DSP_MEM_BASE /* 0x58000000 */ 98#define DSP_MEM_24XX_PHYS OMAP2420_DSP_MEM_BASE /* 0x58000000 */
92#define DSP_MEM_24XX_VIRT 0xe0000000 99#define DSP_MEM_24XX_VIRT 0xe0000000
93#define DSP_MEM_24XX_SIZE 0x28000 100#define DSP_MEM_24XX_SIZE 0x28000
94#define DSP_IPI_24XX_PHYS OMAP24XX_DSP_IPI_BASE /* 0x59000000 */ 101#define DSP_IPI_24XX_PHYS OMAP2420_DSP_IPI_BASE /* 0x59000000 */
95#define DSP_IPI_24XX_VIRT 0xe1000000 102#define DSP_IPI_24XX_VIRT 0xe1000000
96#define DSP_IPI_24XX_SIZE SZ_4K 103#define DSP_IPI_24XX_SIZE SZ_4K
97#define DSP_MMU_24XX_PHYS OMAP24XX_DSP_MMU_BASE /* 0x5a000000 */ 104#define DSP_MMU_24XX_PHYS OMAP2420_DSP_MMU_BASE /* 0x5a000000 */
98#define DSP_MMU_24XX_VIRT 0xe2000000 105#define DSP_MMU_24XX_VIRT 0xe2000000
99#define DSP_MMU_24XX_SIZE SZ_4K 106#define DSP_MMU_24XX_SIZE SZ_4K
100 107
108#elif defined(CONFIG_ARCH_OMAP3)
109
110/* We map both L3 and L4 on OMAP3 */
111#define L3_34XX_PHYS L3_34XX_BASE /* 0x68000000 */
112#define L3_34XX_VIRT 0xf8000000
113#define L3_34XX_SIZE SZ_1M /* 44kB of 128MB used, want 1MB sect */
114
115#define L4_34XX_PHYS L4_34XX_BASE /* 0x48000000 */
116#define L4_34XX_VIRT 0xd8000000
117#define L4_34XX_SIZE SZ_4M /* 1MB of 128MB used, want 1MB sect */
118
119/*
120 * Need to look at the Size 4M for L4.
121 * VPOM3430 was not working for Int controller
122 */
123
124#define L4_WK_34XX_PHYS L4_WK_34XX_BASE /* 0x48300000 */
125#define L4_WK_34XX_VIRT 0xd8300000
126#define L4_WK_34XX_SIZE SZ_1M
127
128#define L4_PER_34XX_PHYS L4_PER_34XX_BASE /* 0x49000000 */
129#define L4_PER_34XX_VIRT 0xd9000000
130#define L4_PER_34XX_SIZE SZ_1M
131
132#define L4_EMU_34XX_PHYS L4_EMU_34XX_BASE /* 0x54000000 */
133#define L4_EMU_34XX_VIRT 0xe4000000
134#define L4_EMU_34XX_SIZE SZ_64M
135
136#define OMAP34XX_GPMC_PHYS OMAP34XX_GPMC_BASE /* 0x6E000000 */
137#define OMAP34XX_GPMC_VIRT 0xFE000000
138#define OMAP34XX_GPMC_SIZE SZ_1M
139
140#define OMAP343X_SMS_PHYS OMAP343X_SMS_BASE /* 0x6C000000 */
141#define OMAP343X_SMS_VIRT 0xFC000000
142#define OMAP343X_SMS_SIZE SZ_1M
143
144#define OMAP343X_SDRC_PHYS OMAP343X_SDRC_BASE /* 0x6D000000 */
145#define OMAP343X_SDRC_VIRT 0xFD000000
146#define OMAP343X_SDRC_SIZE SZ_1M
147
148
149#define IO_OFFSET 0x90000000
150#define IO_ADDRESS(pa) ((pa) + IO_OFFSET)/* Works for L3 and L4 */
151#define io_p2v(pa) ((pa) + IO_OFFSET)/* Works for L3 and L4 */
152#define io_v2p(va) ((va) - IO_OFFSET)/* Works for L3 and L4 */
153
154/* DSP */
155#define DSP_MEM_34XX_PHYS OMAP34XX_DSP_MEM_BASE /* 0x58000000 */
156#define DSP_MEM_34XX_VIRT 0xe0000000
157#define DSP_MEM_34XX_SIZE 0x28000
158#define DSP_IPI_34XX_PHYS OMAP34XX_DSP_IPI_BASE /* 0x59000000 */
159#define DSP_IPI_34XX_VIRT 0xe1000000
160#define DSP_IPI_34XX_SIZE SZ_4K
161#define DSP_MMU_34XX_PHYS OMAP34XX_DSP_MMU_BASE /* 0x5a000000 */
162#define DSP_MMU_34XX_VIRT 0xe2000000
163#define DSP_MMU_34XX_SIZE SZ_4K
164
101#endif 165#endif
102 166
103#ifndef __ASSEMBLER__ 167#ifndef __ASSEMBLER__
diff --git a/include/asm-arm/arch-omap/mux.h b/include/asm-arm/arch-omap/mux.h
index b8fff50e6a87..ff9a5b5575fd 100644
--- a/include/asm-arm/arch-omap/mux.h
+++ b/include/asm-arm/arch-omap/mux.h
@@ -4,9 +4,10 @@
4 * Table of the Omap register configurations for the FUNC_MUX and 4 * Table of the Omap register configurations for the FUNC_MUX and
5 * PULL_DWN combinations. 5 * PULL_DWN combinations.
6 * 6 *
7 * Copyright (C) 2003 - 2005 Nokia Corporation 7 * Copyright (C) 2004 - 2008 Texas Instruments Inc.
8 * Copyright (C) 2003 - 2008 Nokia Corporation
8 * 9 *
9 * Written by Tony Lindgren <tony.lindgren@nokia.com> 10 * Written by Tony Lindgren
10 * 11 *
11 * This program is free software; you can redistribute it and/or modify 12 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by 13 * it under the terms of the GNU General Public License as published by
@@ -27,14 +28,6 @@
27 * - W8 = ball 28 * - W8 = ball
28 * - 1610 = 1510 or 1610, none if common for both 1510 and 1610 29 * - 1610 = 1510 or 1610, none if common for both 1510 and 1610
29 * - MMC2_DAT0 = function 30 * - MMC2_DAT0 = function
30 *
31 * Change log:
32 * Added entry for the I2C interface. (02Feb 2004)
33 * Copyright (C) 2004 Texas Instruments
34 *
35 * Added entry for the keypad and uwire CS1. (09Mar 2004)
36 * Copyright (C) 2004 Texas Instruments
37 *
38 */ 31 */
39 32
40#ifndef __ASM_ARCH_MUX_H 33#ifndef __ASM_ARCH_MUX_H
@@ -469,7 +462,12 @@ enum omap24xx_index {
469 AA8_242X_GPIO58, 462 AA8_242X_GPIO58,
470 Y20_24XX_GPIO60, 463 Y20_24XX_GPIO60,
471 W4__24XX_GPIO74, 464 W4__24XX_GPIO74,
465 N15_24XX_GPIO85,
472 M15_24XX_GPIO92, 466 M15_24XX_GPIO92,
467 P20_24XX_GPIO93,
468 P18_24XX_GPIO95,
469 M18_24XX_GPIO96,
470 L14_24XX_GPIO97,
473 J15_24XX_GPIO99, 471 J15_24XX_GPIO99,
474 V14_24XX_GPIO117, 472 V14_24XX_GPIO117,
475 P14_24XX_GPIO125, 473 P14_24XX_GPIO125,
@@ -494,8 +492,6 @@ enum omap24xx_index {
494 D3_242X_DMAREQ4, 492 D3_242X_DMAREQ4,
495 E3_242X_DMAREQ5, 493 E3_242X_DMAREQ5,
496 494
497 P20_24XX_TSC_IRQ,
498
499 /* UART3 */ 495 /* UART3 */
500 K15_24XX_UART3_TX, 496 K15_24XX_UART3_TX,
501 K14_24XX_UART3_RX, 497 K14_24XX_UART3_RX,
@@ -557,13 +553,57 @@ enum omap24xx_index {
557 B3__24XX_KBR5, 553 B3__24XX_KBR5,
558 AA4_24XX_KBC2, 554 AA4_24XX_KBC2,
559 B13_24XX_KBC6, 555 B13_24XX_KBC6,
556
557 /* 2430 USB */
558 AD9_2430_USB0_PUEN,
559 Y11_2430_USB0_VP,
560 AD7_2430_USB0_VM,
561 AE7_2430_USB0_RCV,
562 AD4_2430_USB0_TXEN,
563 AF9_2430_USB0_SE0,
564 AE6_2430_USB0_DAT,
565 AD24_2430_USB1_SE0,
566 AB24_2430_USB1_RCV,
567 Y25_2430_USB1_TXEN,
568 AA26_2430_USB1_DAT,
569
570 /* 2430 HS-USB */
571 AD9_2430_USB0HS_DATA3,
572 Y11_2430_USB0HS_DATA4,
573 AD7_2430_USB0HS_DATA5,
574 AE7_2430_USB0HS_DATA6,
575 AD4_2430_USB0HS_DATA2,
576 AF9_2430_USB0HS_DATA0,
577 AE6_2430_USB0HS_DATA1,
578 AE8_2430_USB0HS_CLK,
579 AD8_2430_USB0HS_DIR,
580 AE5_2430_USB0HS_STP,
581 AE9_2430_USB0HS_NXT,
582 AC7_2430_USB0HS_DATA7,
583
584 /* 2430 McBSP */
585 AC10_2430_MCBSP2_FSX,
586 AD16_2430_MCBSP2_CLX,
587 AE13_2430_MCBSP2_DX,
588 AD13_2430_MCBSP2_DR,
589 AC10_2430_MCBSP2_FSX_OFF,
590 AD16_2430_MCBSP2_CLX_OFF,
591 AE13_2430_MCBSP2_DX_OFF,
592 AD13_2430_MCBSP2_DR_OFF,
593
594};
595
596struct omap_mux_cfg {
597 struct pin_config *pins;
598 unsigned long size;
599 int (*cfg_reg)(const struct pin_config *cfg);
560}; 600};
561 601
562#ifdef CONFIG_OMAP_MUX 602#ifdef CONFIG_OMAP_MUX
563/* setup pin muxing in Linux */ 603/* setup pin muxing in Linux */
564extern int omap1_mux_init(void); 604extern int omap1_mux_init(void);
565extern int omap2_mux_init(void); 605extern int omap2_mux_init(void);
566extern int omap_mux_register(struct pin_config * pins, unsigned long size); 606extern int omap_mux_register(struct omap_mux_cfg *);
567extern int omap_cfg_reg(unsigned long reg_cfg); 607extern int omap_cfg_reg(unsigned long reg_cfg);
568#else 608#else
569/* boot loader does it all (no warnings from CONFIG_OMAP_MUX_WARNINGS) */ 609/* boot loader does it all (no warnings from CONFIG_OMAP_MUX_WARNINGS) */
diff --git a/include/asm-arm/arch-omap/omap24xx.h b/include/asm-arm/arch-omap/omap24xx.h
index 14c0f9496579..b9fcaae287c8 100644
--- a/include/asm-arm/arch-omap/omap24xx.h
+++ b/include/asm-arm/arch-omap/omap24xx.h
@@ -1,3 +1,28 @@
1/*
2 * include/asm-arm/arch-omap/omap24xx.h
3 *
4 * This file contains the processor specific definitions
5 * of the TI OMAP24XX.
6 *
7 * Copyright (C) 2007 Texas Instruments.
8 * Copyright (C) 2007 Nokia Corporation.
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 *
24 */
25
1#ifndef __ASM_ARCH_OMAP24XX_H 26#ifndef __ASM_ARCH_OMAP24XX_H
2#define __ASM_ARCH_OMAP24XX_H 27#define __ASM_ARCH_OMAP24XX_H
3 28
@@ -13,33 +38,70 @@
13 38
14/* interrupt controller */ 39/* interrupt controller */
15#define OMAP24XX_IC_BASE (L4_24XX_BASE + 0xfe000) 40#define OMAP24XX_IC_BASE (L4_24XX_BASE + 0xfe000)
16#define VA_IC_BASE IO_ADDRESS(OMAP24XX_IC_BASE)
17#define OMAP24XX_IVA_INTC_BASE 0x40000000 41#define OMAP24XX_IVA_INTC_BASE 0x40000000
18#define IRQ_SIR_IRQ 0x0040 42#define IRQ_SIR_IRQ 0x0040
19 43
20#ifdef CONFIG_ARCH_OMAP2420 44#define OMAP2420_CTRL_BASE L4_24XX_BASE
21#define OMAP24XX_32KSYNCT_BASE (L4_24XX_BASE + 0x4000) 45#define OMAP2420_32KSYNCT_BASE (L4_24XX_BASE + 0x4000)
22#define OMAP24XX_PRCM_BASE (L4_24XX_BASE + 0x8000) 46#define OMAP2420_PRCM_BASE (L4_24XX_BASE + 0x8000)
23#define OMAP24XX_SDRC_BASE (L3_24XX_BASE + 0x9000) 47#define OMAP2420_CM_BASE (L4_24XX_BASE + 0x8000)
24#define OMAP242X_CONTROL_STATUS (L4_24XX_BASE + 0x2f8) 48#define OMAP2420_PRM_BASE OMAP2420_CM_BASE
25#endif 49#define OMAP2420_SDRC_BASE (L3_24XX_BASE + 0x9000)
50#define OMAP2420_SMS_BASE 0x68008000
26 51
27#ifdef CONFIG_ARCH_OMAP2430 52#define OMAP2430_32KSYNCT_BASE (L4_WK_243X_BASE + 0x20000)
28#define OMAP24XX_32KSYNCT_BASE (L4_WK_243X_BASE + 0x20000) 53#define OMAP2430_PRCM_BASE (L4_WK_243X_BASE + 0x6000)
29#define OMAP24XX_PRCM_BASE (L4_WK_243X_BASE + 0x6000) 54#define OMAP2430_CM_BASE (L4_WK_243X_BASE + 0x6000)
30#define OMAP24XX_SDRC_BASE (0x6D000000) 55#define OMAP2430_PRM_BASE OMAP2430_CM_BASE
31#define OMAP242X_CONTROL_STATUS (L4_24XX_BASE + 0x2f8) 56
57#define OMAP243X_SMS_BASE 0x6C000000
58#define OMAP243X_SDRC_BASE 0x6D000000
32#define OMAP243X_GPMC_BASE 0x6E000000 59#define OMAP243X_GPMC_BASE 0x6E000000
33#endif 60#define OMAP243X_SCM_BASE (L4_WK_243X_BASE + 0x2000)
61#define OMAP243X_CTRL_BASE OMAP243X_SCM_BASE
62#define OMAP243X_HS_BASE (L4_24XX_BASE + 0x000ac000)
34 63
35/* DSP SS */ 64/* DSP SS */
36#define OMAP24XX_DSP_BASE 0x58000000 65#define OMAP2420_DSP_BASE 0x58000000
37#define OMAP24XX_DSP_MEM_BASE (OMAP24XX_DSP_BASE + 0x0) 66#define OMAP2420_DSP_MEM_BASE (OMAP2420_DSP_BASE + 0x0)
38#define OMAP24XX_DSP_IPI_BASE (OMAP24XX_DSP_BASE + 0x1000000) 67#define OMAP2420_DSP_IPI_BASE (OMAP2420_DSP_BASE + 0x1000000)
39#define OMAP24XX_DSP_MMU_BASE (OMAP24XX_DSP_BASE + 0x2000000) 68#define OMAP2420_DSP_MMU_BASE (OMAP2420_DSP_BASE + 0x2000000)
69
70#define OMAP243X_DSP_BASE 0x5C000000
71#define OMAP243X_DSP_MEM_BASE (OMAP243X_DSP_BASE + 0x0)
72#define OMAP243X_DSP_MMU_BASE (OMAP243X_DSP_BASE + 0x1000000)
40 73
41/* Mailbox */ 74/* Mailbox */
42#define OMAP24XX_MAILBOX_BASE (L4_24XX_BASE + 0x94000) 75#define OMAP24XX_MAILBOX_BASE (L4_24XX_BASE + 0x94000)
43 76
77/* Camera */
78#define OMAP24XX_CAMERA_BASE (L4_24XX_BASE + 0x52000)
79
80/* Security */
81#define OMAP24XX_SEC_BASE (L4_24XX_BASE + 0xA0000)
82#define OMAP24XX_SEC_RNG_BASE (OMAP24XX_SEC_BASE + 0x0000)
83#define OMAP24XX_SEC_DES_BASE (OMAP24XX_SEC_BASE + 0x2000)
84#define OMAP24XX_SEC_SHA1MD5_BASE (OMAP24XX_SEC_BASE + 0x4000)
85#define OMAP24XX_SEC_AES_BASE (OMAP24XX_SEC_BASE + 0x6000)
86#define OMAP24XX_SEC_PKA_BASE (OMAP24XX_SEC_BASE + 0x8000)
87
88#if defined(CONFIG_ARCH_OMAP2420)
89
90#define OMAP2_32KSYNCT_BASE OMAP2420_32KSYNCT_BASE
91#define OMAP2_PRCM_BASE OMAP2420_PRCM_BASE
92#define OMAP2_CM_BASE OMAP2420_CM_BASE
93#define OMAP2_PRM_BASE OMAP2420_PRM_BASE
94#define OMAP2_VA_IC_BASE IO_ADDRESS(OMAP24XX_IC_BASE)
95
96#elif defined(CONFIG_ARCH_OMAP2430)
97
98#define OMAP2_32KSYNCT_BASE OMAP2430_32KSYNCT_BASE
99#define OMAP2_PRCM_BASE OMAP2430_PRCM_BASE
100#define OMAP2_CM_BASE OMAP2430_CM_BASE
101#define OMAP2_PRM_BASE OMAP2430_PRM_BASE
102#define OMAP2_VA_IC_BASE IO_ADDRESS(OMAP24XX_IC_BASE)
103
104#endif
105
44#endif /* __ASM_ARCH_OMAP24XX_H */ 106#endif /* __ASM_ARCH_OMAP24XX_H */
45 107
diff --git a/include/asm-arm/arch-omap/sdrc.h b/include/asm-arm/arch-omap/sdrc.h
new file mode 100644
index 000000000000..673b3965befc
--- /dev/null
+++ b/include/asm-arm/arch-omap/sdrc.h
@@ -0,0 +1,75 @@
1#ifndef ____ASM_ARCH_SDRC_H
2#define ____ASM_ARCH_SDRC_H
3
4/*
5 * OMAP2/3 SDRC/SMS register definitions
6 *
7 * Copyright (C) 2007 Texas Instruments, Inc.
8 * Copyright (C) 2007 Nokia Corporation
9 *
10 * Written by Paul Walmsley
11 *
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License version 2 as
14 * published by the Free Software Foundation.
15 */
16
17#include <asm/arch/io.h>
18
19/* SDRC register offsets - read/write with sdrc_{read,write}_reg() */
20
21#define SDRC_SYSCONFIG 0x010
22#define SDRC_DLLA_CTRL 0x060
23#define SDRC_DLLA_STATUS 0x064
24#define SDRC_DLLB_CTRL 0x068
25#define SDRC_DLLB_STATUS 0x06C
26#define SDRC_POWER 0x070
27#define SDRC_MR_0 0x084
28#define SDRC_RFR_CTRL_0 0x0a4
29
30/*
31 * These values represent the number of memory clock cycles between
32 * autorefresh initiation. They assume 1 refresh per 64 ms (JEDEC), 8192
33 * rows per device, and include a subtraction of a 50 cycle window in the
34 * event that the autorefresh command is delayed due to other SDRC activity.
35 * The '| 1' sets the ARE field to send one autorefresh when the autorefresh
36 * counter reaches 0.
37 *
38 * These represent optimal values for common parts, it won't work for all.
39 * As long as you scale down, most parameters are still work, they just
40 * become sub-optimal. The RFR value goes in the opposite direction. If you
41 * don't adjust it down as your clock period increases the refresh interval
42 * will not be met. Setting all parameters for complete worst case may work,
43 * but may cut memory performance by 2x. Due to errata the DLLs need to be
44 * unlocked and their value needs run time calibration. A dynamic call is
45 * need for that as no single right value exists acorss production samples.
46 *
47 * Only the FULL speed values are given. Current code is such that rate
48 * changes must be made at DPLLoutx2. The actual value adjustment for low
49 * frequency operation will be handled by omap_set_performance()
50 *
51 * By having the boot loader boot up in the fastest L4 speed available likely
52 * will result in something which you can switch between.
53 */
54#define SDRC_RFR_CTRL_165MHz (0x00044c00 | 1)
55#define SDRC_RFR_CTRL_133MHz (0x0003de00 | 1)
56#define SDRC_RFR_CTRL_100MHz (0x0002da01 | 1)
57#define SDRC_RFR_CTRL_110MHz (0x0002da01 | 1) /* Need to calc */
58#define SDRC_RFR_CTRL_BYPASS (0x00005000 | 1) /* Need to calc */
59
60
61/*
62 * SMS register access
63 */
64
65
66#define OMAP242X_SMS_REGADDR(reg) (void __iomem *)IO_ADDRESS(OMAP2420_SMS_BASE + reg)
67#define OMAP243X_SMS_REGADDR(reg) (void __iomem *)IO_ADDRESS(OMAP243X_SMS_BASE + reg)
68#define OMAP343X_SMS_REGADDR(reg) (void __iomem *)IO_ADDRESS(OMAP343X_SMS_BASE + reg)
69
70/* SMS register offsets - read/write with sms_{read,write}_reg() */
71
72#define SMS_SYSCONFIG 0x010
73/* REVISIT: fill in other SMS registers here */
74
75#endif
diff --git a/include/asm-arm/arch-omap/usb.h b/include/asm-arm/arch-omap/usb.h
index 99ae9eabaf71..2147d18aaeae 100644
--- a/include/asm-arm/arch-omap/usb.h
+++ b/include/asm-arm/arch-omap/usb.h
@@ -132,14 +132,11 @@
132# define CONF_USB_PWRDN_DP_R (1 << 1) 132# define CONF_USB_PWRDN_DP_R (1 << 1)
133 133
134/* OMAP2 */ 134/* OMAP2 */
135#define CONTROL_DEVCONF_REG __REG32(L4_24XX_BASE + 0x0274)
136# define USB_UNIDIR 0x0 135# define USB_UNIDIR 0x0
137# define USB_UNIDIR_TLL 0x1 136# define USB_UNIDIR_TLL 0x1
138# define USB_BIDIR 0x2 137# define USB_BIDIR 0x2
139# define USB_BIDIR_TLL 0x3 138# define USB_BIDIR_TLL 0x3
140# define USBT0WRMODEI(x) ((x) << 22) 139# define USBTXWRMODEI(port, x) ((x) << (22 - (port * 2)))
141# define USBT1WRMODEI(x) ((x) << 20)
142# define USBT2WRMODEI(x) ((x) << 18)
143# define USBT2TLL5PI (1 << 17) 140# define USBT2TLL5PI (1 << 17)
144# define USB0PUENACTLOI (1 << 16) 141# define USB0PUENACTLOI (1 << 16)
145# define USBSTANDBYCTRL (1 << 15) 142# define USBSTANDBYCTRL (1 << 15)
diff --git a/include/asm-arm/arch-orion/io.h b/include/asm-arm/arch-orion/io.h
deleted file mode 100644
index e0b8c39b9167..000000000000
--- a/include/asm-arm/arch-orion/io.h
+++ /dev/null
@@ -1,27 +0,0 @@
1/*
2 * include/asm-arm/arch-orion/io.h
3 *
4 * Tzachi Perelstein <tzachi@marvell.com>
5 *
6 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without any
8 * warranty of any kind, whether express or implied.
9 */
10
11#ifndef __ASM_ARM_ARCH_IO_H
12#define __ASM_ARM_ARCH_IO_H
13
14#include "orion.h"
15
16#define IO_SPACE_LIMIT 0xffffffff
17#define IO_SPACE_REMAP ORION_PCI_SYS_IO_BASE
18
19static inline void __iomem *__io(unsigned long addr)
20{
21 return (void __iomem *)addr;
22}
23
24#define __io(a) __io(a)
25#define __mem_pci(a) (a)
26
27#endif
diff --git a/include/asm-arm/arch-orion/irqs.h b/include/asm-arm/arch-orion/irqs.h
deleted file mode 100644
index eea65ca6076a..000000000000
--- a/include/asm-arm/arch-orion/irqs.h
+++ /dev/null
@@ -1,61 +0,0 @@
1/*
2 * include/asm-arm/arch-orion/irqs.h
3 *
4 * IRQ definitions for Orion SoC
5 *
6 * Maintainer: Tzachi Perelstein <tzachi@marvell.com>
7 *
8 * This file is licensed under the terms of the GNU General Public
9 * License version 2. This program is licensed "as is" without any
10 * warranty of any kind, whether express or implied.
11 */
12
13#ifndef __ASM_ARCH_IRQS_H__
14#define __ASM_ARCH_IRQS_H__
15
16#include "orion.h" /* need GPIO_MAX */
17
18/*
19 * Orion Main Interrupt Controller
20 */
21#define IRQ_ORION_BRIDGE 0
22#define IRQ_ORION_DOORBELL_H2C 1
23#define IRQ_ORION_DOORBELL_C2H 2
24#define IRQ_ORION_UART0 3
25#define IRQ_ORION_UART1 4
26#define IRQ_ORION_I2C 5
27#define IRQ_ORION_GPIO_0_7 6
28#define IRQ_ORION_GPIO_8_15 7
29#define IRQ_ORION_GPIO_16_23 8
30#define IRQ_ORION_GPIO_24_31 9
31#define IRQ_ORION_PCIE0_ERR 10
32#define IRQ_ORION_PCIE0_INT 11
33#define IRQ_ORION_USB1_CTRL 12
34#define IRQ_ORION_DEV_BUS_ERR 14
35#define IRQ_ORION_PCI_ERR 15
36#define IRQ_ORION_USB_BR_ERR 16
37#define IRQ_ORION_USB0_CTRL 17
38#define IRQ_ORION_ETH_RX 18
39#define IRQ_ORION_ETH_TX 19
40#define IRQ_ORION_ETH_MISC 20
41#define IRQ_ORION_ETH_SUM 21
42#define IRQ_ORION_ETH_ERR 22
43#define IRQ_ORION_IDMA_ERR 23
44#define IRQ_ORION_IDMA_0 24
45#define IRQ_ORION_IDMA_1 25
46#define IRQ_ORION_IDMA_2 26
47#define IRQ_ORION_IDMA_3 27
48#define IRQ_ORION_CESA 28
49#define IRQ_ORION_SATA 29
50#define IRQ_ORION_XOR0 30
51#define IRQ_ORION_XOR1 31
52
53/*
54 * Orion General Purpose Pins
55 */
56#define IRQ_ORION_GPIO_START 32
57#define NR_GPIO_IRQS GPIO_MAX
58
59#define NR_IRQS (IRQ_ORION_GPIO_START + NR_GPIO_IRQS)
60
61#endif /* __ASM_ARCH_IRQS_H__ */
diff --git a/include/asm-arm/arch-orion/orion.h b/include/asm-arm/arch-orion/orion.h
deleted file mode 100644
index 673a418a7419..000000000000
--- a/include/asm-arm/arch-orion/orion.h
+++ /dev/null
@@ -1,165 +0,0 @@
1/*
2 * include/asm-arm/arch-orion/orion.h
3 *
4 * Generic definitions of Orion SoC flavors:
5 * Orion-1, Orion-NAS, Orion-VoIP, and Orion-2.
6 *
7 * Maintainer: Tzachi Perelstein <tzachi@marvell.com>
8 *
9 * This file is licensed under the terms of the GNU General Public
10 * License version 2. This program is licensed "as is" without any
11 * warranty of any kind, whether express or implied.
12 */
13
14#ifndef __ASM_ARCH_ORION_H__
15#define __ASM_ARCH_ORION_H__
16
17/*****************************************************************************
18 * Orion Address Map
19 *
20 * virt phys size
21 * fdd00000 f1000000 1M on-chip peripheral registers
22 * fde00000 f2000000 1M PCIe I/O space
23 * fdf00000 f2100000 1M PCI I/O space
24 * fe000000 f0000000 16M PCIe WA space (Orion-NAS only)
25 ****************************************************************************/
26#define ORION_REGS_PHYS_BASE 0xf1000000
27#define ORION_REGS_VIRT_BASE 0xfdd00000
28#define ORION_REGS_SIZE SZ_1M
29
30#define ORION_PCIE_IO_PHYS_BASE 0xf2000000
31#define ORION_PCIE_IO_VIRT_BASE 0xfde00000
32#define ORION_PCIE_IO_BUS_BASE 0x00000000
33#define ORION_PCIE_IO_SIZE SZ_1M
34
35#define ORION_PCI_IO_PHYS_BASE 0xf2100000
36#define ORION_PCI_IO_VIRT_BASE 0xfdf00000
37#define ORION_PCI_IO_BUS_BASE 0x00100000
38#define ORION_PCI_IO_SIZE SZ_1M
39
40/* Relevant only for Orion-NAS */
41#define ORION_PCIE_WA_PHYS_BASE 0xf0000000
42#define ORION_PCIE_WA_VIRT_BASE 0xfe000000
43#define ORION_PCIE_WA_SIZE SZ_16M
44
45#define ORION_PCIE_MEM_PHYS_BASE 0xe0000000
46#define ORION_PCIE_MEM_SIZE SZ_128M
47
48#define ORION_PCI_MEM_PHYS_BASE 0xe8000000
49#define ORION_PCI_MEM_SIZE SZ_128M
50
51/*******************************************************************************
52 * Supported Devices & Revisions
53 ******************************************************************************/
54/* Orion-1 (88F5181) */
55#define MV88F5181_DEV_ID 0x5181
56#define MV88F5181_REV_B1 3
57/* Orion-NAS (88F5182) */
58#define MV88F5182_DEV_ID 0x5182
59#define MV88F5182_REV_A2 2
60/* Orion-2 (88F5281) */
61#define MV88F5281_DEV_ID 0x5281
62#define MV88F5281_REV_D1 5
63#define MV88F5281_REV_D2 6
64
65/*******************************************************************************
66 * Orion Registers Map
67 ******************************************************************************/
68#define ORION_DDR_VIRT_BASE (ORION_REGS_VIRT_BASE | 0x00000)
69#define ORION_DDR_REG(x) (ORION_DDR_VIRT_BASE | (x))
70
71#define ORION_DEV_BUS_PHYS_BASE (ORION_REGS_PHYS_BASE | 0x10000)
72#define ORION_DEV_BUS_VIRT_BASE (ORION_REGS_VIRT_BASE | 0x10000)
73#define ORION_DEV_BUS_REG(x) (ORION_DEV_BUS_VIRT_BASE | (x))
74#define I2C_PHYS_BASE (ORION_DEV_BUS_PHYS_BASE | 0x1000)
75#define UART0_PHYS_BASE (ORION_DEV_BUS_PHYS_BASE | 0x2000)
76#define UART0_VIRT_BASE (ORION_DEV_BUS_VIRT_BASE | 0x2000)
77#define UART1_PHYS_BASE (ORION_DEV_BUS_PHYS_BASE | 0x2100)
78#define UART1_VIRT_BASE (ORION_DEV_BUS_VIRT_BASE | 0x2100)
79
80#define ORION_BRIDGE_VIRT_BASE (ORION_REGS_VIRT_BASE | 0x20000)
81#define ORION_BRIDGE_REG(x) (ORION_BRIDGE_VIRT_BASE | (x))
82
83#define ORION_PCI_VIRT_BASE (ORION_REGS_VIRT_BASE | 0x30000)
84#define ORION_PCI_REG(x) (ORION_PCI_VIRT_BASE | (x))
85
86#define ORION_PCIE_VIRT_BASE (ORION_REGS_VIRT_BASE | 0x40000)
87#define ORION_PCIE_REG(x) (ORION_PCIE_VIRT_BASE | (x))
88
89#define ORION_USB0_PHYS_BASE (ORION_REGS_PHYS_BASE | 0x50000)
90#define ORION_USB0_VIRT_BASE (ORION_REGS_VIRT_BASE | 0x50000)
91#define ORION_USB0_REG(x) (ORION_USB0_VIRT_BASE | (x))
92
93#define ORION_ETH_PHYS_BASE (ORION_REGS_PHYS_BASE | 0x70000)
94#define ORION_ETH_VIRT_BASE (ORION_REGS_VIRT_BASE | 0x70000)
95#define ORION_ETH_REG(x) (ORION_ETH_VIRT_BASE | (x))
96
97#define ORION_SATA_PHYS_BASE (ORION_REGS_PHYS_BASE | 0x80000)
98#define ORION_SATA_VIRT_BASE (ORION_REGS_VIRT_BASE | 0x80000)
99#define ORION_SATA_REG(x) (ORION_SATA_VIRT_BASE | (x))
100
101#define ORION_USB1_PHYS_BASE (ORION_REGS_PHYS_BASE | 0xa0000)
102#define ORION_USB1_VIRT_BASE (ORION_REGS_VIRT_BASE | 0xa0000)
103#define ORION_USB1_REG(x) (ORION_USB1_VIRT_BASE | (x))
104
105/*******************************************************************************
106 * Device Bus Registers
107 ******************************************************************************/
108#define MPP_0_7_CTRL ORION_DEV_BUS_REG(0x000)
109#define MPP_8_15_CTRL ORION_DEV_BUS_REG(0x004)
110#define MPP_16_19_CTRL ORION_DEV_BUS_REG(0x050)
111#define MPP_DEV_CTRL ORION_DEV_BUS_REG(0x008)
112#define MPP_RESET_SAMPLE ORION_DEV_BUS_REG(0x010)
113#define GPIO_OUT ORION_DEV_BUS_REG(0x100)
114#define GPIO_IO_CONF ORION_DEV_BUS_REG(0x104)
115#define GPIO_BLINK_EN ORION_DEV_BUS_REG(0x108)
116#define GPIO_IN_POL ORION_DEV_BUS_REG(0x10c)
117#define GPIO_DATA_IN ORION_DEV_BUS_REG(0x110)
118#define GPIO_EDGE_CAUSE ORION_DEV_BUS_REG(0x114)
119#define GPIO_EDGE_MASK ORION_DEV_BUS_REG(0x118)
120#define GPIO_LEVEL_MASK ORION_DEV_BUS_REG(0x11c)
121#define DEV_BANK_0_PARAM ORION_DEV_BUS_REG(0x45c)
122#define DEV_BANK_1_PARAM ORION_DEV_BUS_REG(0x460)
123#define DEV_BANK_2_PARAM ORION_DEV_BUS_REG(0x464)
124#define DEV_BANK_BOOT_PARAM ORION_DEV_BUS_REG(0x46c)
125#define DEV_BUS_CTRL ORION_DEV_BUS_REG(0x4c0)
126#define DEV_BUS_INT_CAUSE ORION_DEV_BUS_REG(0x4d0)
127#define DEV_BUS_INT_MASK ORION_DEV_BUS_REG(0x4d4)
128#define GPIO_MAX 32
129
130/***************************************************************************
131 * Orion CPU Bridge Registers
132 **************************************************************************/
133#define CPU_CONF ORION_BRIDGE_REG(0x100)
134#define CPU_CTRL ORION_BRIDGE_REG(0x104)
135#define CPU_RESET_MASK ORION_BRIDGE_REG(0x108)
136#define CPU_SOFT_RESET ORION_BRIDGE_REG(0x10c)
137#define POWER_MNG_CTRL_REG ORION_BRIDGE_REG(0x11C)
138#define BRIDGE_CAUSE ORION_BRIDGE_REG(0x110)
139#define BRIDGE_MASK ORION_BRIDGE_REG(0x114)
140#define MAIN_IRQ_CAUSE ORION_BRIDGE_REG(0x200)
141#define MAIN_IRQ_MASK ORION_BRIDGE_REG(0x204)
142#define TIMER_CTRL ORION_BRIDGE_REG(0x300)
143#define TIMER_VAL(x) ORION_BRIDGE_REG(0x314 + ((x) * 8))
144#define TIMER_VAL_RELOAD(x) ORION_BRIDGE_REG(0x310 + ((x) * 8))
145
146#ifndef __ASSEMBLY__
147
148/*******************************************************************************
149 * Helpers to access Orion registers
150 ******************************************************************************/
151#include <asm/types.h>
152#include <asm/io.h>
153
154#define orion_read(r) __raw_readl(r)
155#define orion_write(r, val) __raw_writel(val, r)
156
157/*
158 * These are not preempt safe. Locks, if needed, must be taken care by caller.
159 */
160#define orion_setbits(r, mask) orion_write((r), orion_read(r) | (mask))
161#define orion_clrbits(r, mask) orion_write((r), orion_read(r) & ~(mask))
162
163#endif /* __ASSEMBLY__ */
164
165#endif /* __ASM_ARCH_ORION_H__ */
diff --git a/include/asm-arm/arch-orion/timex.h b/include/asm-arm/arch-orion/timex.h
deleted file mode 100644
index 26c2c91eecf0..000000000000
--- a/include/asm-arm/arch-orion/timex.h
+++ /dev/null
@@ -1,12 +0,0 @@
1/*
2 * include/asm-arm/arch-orion/timex.h
3 *
4 * Tzachi Perelstein <tzachi@marvell.com>
5 *
6 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without any
8 * warranty of any kind, whether express or implied.
9 */
10
11#define ORION_TCLK 166666667
12#define CLOCK_TICK_RATE ORION_TCLK
diff --git a/include/asm-arm/arch-orion/debug-macro.S b/include/asm-arm/arch-orion5x/debug-macro.S
index 2746220f5d85..4f98f3ba2929 100644
--- a/include/asm-arm/arch-orion/debug-macro.S
+++ b/include/asm-arm/arch-orion5x/debug-macro.S
@@ -1,5 +1,5 @@
1/* 1/*
2 * linux/include/asm-arm/arch-orion/debug-macro.S 2 * include/asm-arm/arch-orion5x/debug-macro.S
3 * 3 *
4 * Debugging macro include header 4 * Debugging macro include header
5 * 5 *
@@ -8,13 +8,13 @@
8 * published by the Free Software Foundation. 8 * published by the Free Software Foundation.
9*/ 9*/
10 10
11#include <asm/arch/orion.h> 11#include <asm/arch/orion5x.h>
12 12
13 .macro addruart,rx 13 .macro addruart,rx
14 mrc p15, 0, \rx, c1, c0 14 mrc p15, 0, \rx, c1, c0
15 tst \rx, #1 @ MMU enabled? 15 tst \rx, #1 @ MMU enabled?
16 ldreq \rx, =ORION_REGS_PHYS_BASE 16 ldreq \rx, =ORION5X_REGS_PHYS_BASE
17 ldrne \rx, =ORION_REGS_VIRT_BASE 17 ldrne \rx, =ORION5X_REGS_VIRT_BASE
18 orr \rx, \rx, #0x00012000 18 orr \rx, \rx, #0x00012000
19 .endm 19 .endm
20 20
diff --git a/include/asm-arm/arch-orion/dma.h b/include/asm-arm/arch-orion5x/dma.h
index 40a8c178f10d..40a8c178f10d 100644
--- a/include/asm-arm/arch-orion/dma.h
+++ b/include/asm-arm/arch-orion5x/dma.h
diff --git a/include/asm-arm/arch-orion/entry-macro.S b/include/asm-arm/arch-orion5x/entry-macro.S
index cda096b2acfd..d8ef54c0ee9a 100644
--- a/include/asm-arm/arch-orion/entry-macro.S
+++ b/include/asm-arm/arch-orion5x/entry-macro.S
@@ -1,5 +1,5 @@
1/* 1/*
2 * include/asm-arm/arch-orion/entry-macro.S 2 * include/asm-arm/arch-orion5x/entry-macro.S
3 * 3 *
4 * Low-level IRQ helper macros for Orion platforms 4 * Low-level IRQ helper macros for Orion platforms
5 * 5 *
@@ -8,7 +8,7 @@
8 * warranty of any kind, whether express or implied. 8 * warranty of any kind, whether express or implied.
9 */ 9 */
10 10
11#include <asm/arch/orion.h> 11#include <asm/arch/orion5x.h>
12 12
13 .macro disable_fiq 13 .macro disable_fiq
14 .endm 14 .endm
diff --git a/include/asm-arm/arch-orion/gpio.h b/include/asm-arm/arch-orion5x/gpio.h
index d66284f9a14c..c85e498388b6 100644
--- a/include/asm-arm/arch-orion/gpio.h
+++ b/include/asm-arm/arch-orion5x/gpio.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * include/asm-arm/arch-orion/gpio.h 2 * include/asm-arm/arch-orion5x/gpio.h
3 * 3 *
4 * This file is licensed under the terms of the GNU General Public 4 * This file is licensed under the terms of the GNU General Public
5 * License version 2. This program is licensed "as is" without any 5 * License version 2. This program is licensed "as is" without any
@@ -12,17 +12,17 @@ extern int gpio_direction_input(unsigned pin);
12extern int gpio_direction_output(unsigned pin, int value); 12extern int gpio_direction_output(unsigned pin, int value);
13extern int gpio_get_value(unsigned pin); 13extern int gpio_get_value(unsigned pin);
14extern void gpio_set_value(unsigned pin, int value); 14extern void gpio_set_value(unsigned pin, int value);
15extern void orion_gpio_set_blink(unsigned pin, int blink); 15extern void orion5x_gpio_set_blink(unsigned pin, int blink);
16extern void gpio_display(void); /* debug */ 16extern void gpio_display(void); /* debug */
17 17
18static inline int gpio_to_irq(int pin) 18static inline int gpio_to_irq(int pin)
19{ 19{
20 return pin + IRQ_ORION_GPIO_START; 20 return pin + IRQ_ORION5X_GPIO_START;
21} 21}
22 22
23static inline int irq_to_gpio(int irq) 23static inline int irq_to_gpio(int irq)
24{ 24{
25 return irq - IRQ_ORION_GPIO_START; 25 return irq - IRQ_ORION5X_GPIO_START;
26} 26}
27 27
28#include <asm-generic/gpio.h> /* cansleep wrappers */ 28#include <asm-generic/gpio.h> /* cansleep wrappers */
diff --git a/include/asm-arm/arch-orion/hardware.h b/include/asm-arm/arch-orion5x/hardware.h
index 65da374de735..5d2d8e0b5630 100644
--- a/include/asm-arm/arch-orion/hardware.h
+++ b/include/asm-arm/arch-orion5x/hardware.h
@@ -1,21 +1,21 @@
1/* 1/*
2 * include/asm-arm/arch-orion/hardware.h 2 * include/asm-arm/arch-orion5x/hardware.h
3 * 3 *
4 * This program is free software; you can redistribute it and/or modify 4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as 5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation. 6 * published by the Free Software Foundation.
7 */ 7 */
8 8
9#ifndef __ASM_ARCH_HARDWARE_H__ 9#ifndef __ASM_ARCH_HARDWARE_H
10#define __ASM_ARCH_HARDWARE_H__ 10#define __ASM_ARCH_HARDWARE_H
11 11
12#include "orion.h" 12#include "orion5x.h"
13 13
14#define pcibios_assign_all_busses() 1 14#define pcibios_assign_all_busses() 1
15 15
16#define PCIBIOS_MIN_IO 0x00001000 16#define PCIBIOS_MIN_IO 0x00001000
17#define PCIBIOS_MIN_MEM 0x01000000 17#define PCIBIOS_MIN_MEM 0x01000000
18#define PCIMEM_BASE ORION_PCIE_MEM_PHYS_BASE 18#define PCIMEM_BASE ORION5X_PCIE_MEM_PHYS_BASE
19 19
20 20
21#endif 21#endif
diff --git a/include/asm-arm/arch-orion5x/io.h b/include/asm-arm/arch-orion5x/io.h
new file mode 100644
index 000000000000..5148ab7ad1f8
--- /dev/null
+++ b/include/asm-arm/arch-orion5x/io.h
@@ -0,0 +1,68 @@
1/*
2 * include/asm-arm/arch-orion5x/io.h
3 *
4 * Tzachi Perelstein <tzachi@marvell.com>
5 *
6 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without any
8 * warranty of any kind, whether express or implied.
9 */
10
11#ifndef __ASM_ARCH_IO_H
12#define __ASM_ARCH_IO_H
13
14#include "orion5x.h"
15
16#define IO_SPACE_LIMIT 0xffffffff
17#define IO_SPACE_REMAP ORION5X_PCI_SYS_IO_BASE
18
19static inline void __iomem *
20__arch_ioremap(unsigned long paddr, size_t size, unsigned int mtype)
21{
22 void __iomem *retval;
23
24 if (mtype == MT_DEVICE && size && paddr >= ORION5X_REGS_PHYS_BASE &&
25 paddr + size <= ORION5X_REGS_PHYS_BASE + ORION5X_REGS_SIZE) {
26 retval = (void __iomem *)ORION5X_REGS_VIRT_BASE +
27 (paddr - ORION5X_REGS_PHYS_BASE);
28 } else {
29 retval = __arm_ioremap(paddr, size, mtype);
30 }
31
32 return retval;
33}
34
35static inline void
36__arch_iounmap(void __iomem *addr)
37{
38 if (addr < (void __iomem *)ORION5X_REGS_VIRT_BASE ||
39 addr >= (void __iomem *)(ORION5X_REGS_VIRT_BASE + ORION5X_REGS_SIZE))
40 __iounmap(addr);
41}
42
43static inline void __iomem *__io(unsigned long addr)
44{
45 return (void __iomem *)addr;
46}
47
48#define __arch_ioremap(p, s, m) __arch_ioremap(p, s, m)
49#define __arch_iounmap(a) __arch_iounmap(a)
50#define __io(a) __io(a)
51#define __mem_pci(a) (a)
52
53
54/*****************************************************************************
55 * Helpers to access Orion registers
56 ****************************************************************************/
57#define orion5x_read(r) __raw_readl(r)
58#define orion5x_write(r, val) __raw_writel(val, r)
59
60/*
61 * These are not preempt-safe. Locks, if needed, must be taken
62 * care of by the caller.
63 */
64#define orion5x_setbits(r, mask) orion5x_write((r), orion5x_read(r) | (mask))
65#define orion5x_clrbits(r, mask) orion5x_write((r), orion5x_read(r) & ~(mask))
66
67
68#endif
diff --git a/include/asm-arm/arch-orion5x/irqs.h b/include/asm-arm/arch-orion5x/irqs.h
new file mode 100644
index 000000000000..abdd61a4833a
--- /dev/null
+++ b/include/asm-arm/arch-orion5x/irqs.h
@@ -0,0 +1,62 @@
1/*
2 * include/asm-arm/arch-orion5x/irqs.h
3 *
4 * IRQ definitions for Orion SoC
5 *
6 * Maintainer: Tzachi Perelstein <tzachi@marvell.com>
7 *
8 * This file is licensed under the terms of the GNU General Public
9 * License version 2. This program is licensed "as is" without any
10 * warranty of any kind, whether express or implied.
11 */
12
13#ifndef __ASM_ARCH_IRQS_H
14#define __ASM_ARCH_IRQS_H
15
16#include "orion5x.h" /* need GPIO_MAX */
17
18/*
19 * Orion Main Interrupt Controller
20 */
21#define IRQ_ORION5X_BRIDGE 0
22#define IRQ_ORION5X_DOORBELL_H2C 1
23#define IRQ_ORION5X_DOORBELL_C2H 2
24#define IRQ_ORION5X_UART0 3
25#define IRQ_ORION5X_UART1 4
26#define IRQ_ORION5X_I2C 5
27#define IRQ_ORION5X_GPIO_0_7 6
28#define IRQ_ORION5X_GPIO_8_15 7
29#define IRQ_ORION5X_GPIO_16_23 8
30#define IRQ_ORION5X_GPIO_24_31 9
31#define IRQ_ORION5X_PCIE0_ERR 10
32#define IRQ_ORION5X_PCIE0_INT 11
33#define IRQ_ORION5X_USB1_CTRL 12
34#define IRQ_ORION5X_DEV_BUS_ERR 14
35#define IRQ_ORION5X_PCI_ERR 15
36#define IRQ_ORION5X_USB_BR_ERR 16
37#define IRQ_ORION5X_USB0_CTRL 17
38#define IRQ_ORION5X_ETH_RX 18
39#define IRQ_ORION5X_ETH_TX 19
40#define IRQ_ORION5X_ETH_MISC 20
41#define IRQ_ORION5X_ETH_SUM 21
42#define IRQ_ORION5X_ETH_ERR 22
43#define IRQ_ORION5X_IDMA_ERR 23
44#define IRQ_ORION5X_IDMA_0 24
45#define IRQ_ORION5X_IDMA_1 25
46#define IRQ_ORION5X_IDMA_2 26
47#define IRQ_ORION5X_IDMA_3 27
48#define IRQ_ORION5X_CESA 28
49#define IRQ_ORION5X_SATA 29
50#define IRQ_ORION5X_XOR0 30
51#define IRQ_ORION5X_XOR1 31
52
53/*
54 * Orion General Purpose Pins
55 */
56#define IRQ_ORION5X_GPIO_START 32
57#define NR_GPIO_IRQS GPIO_MAX
58
59#define NR_IRQS (IRQ_ORION5X_GPIO_START + NR_GPIO_IRQS)
60
61
62#endif
diff --git a/include/asm-arm/arch-orion/memory.h b/include/asm-arm/arch-orion5x/memory.h
index d954dba87ced..80053a7afc7a 100644
--- a/include/asm-arm/arch-orion/memory.h
+++ b/include/asm-arm/arch-orion5x/memory.h
@@ -1,15 +1,16 @@
1/* 1/*
2 * include/asm-arm/arch-orion/memory.h 2 * include/asm-arm/arch-orion5x/memory.h
3 * 3 *
4 * Marvell Orion memory definitions 4 * Marvell Orion memory definitions
5 */ 5 */
6 6
7#ifndef __ASM_ARCH_MMU_H 7#ifndef __ASM_ARCH_MEMORY_H
8#define __ASM_ARCH_MMU_H 8#define __ASM_ARCH_MEMORY_H
9 9
10#define PHYS_OFFSET UL(0x00000000) 10#define PHYS_OFFSET UL(0x00000000)
11 11
12#define __virt_to_bus(x) __virt_to_phys(x) 12#define __virt_to_bus(x) __virt_to_phys(x)
13#define __bus_to_virt(x) __phys_to_virt(x) 13#define __bus_to_virt(x) __phys_to_virt(x)
14 14
15
15#endif 16#endif
diff --git a/include/asm-arm/arch-orion5x/orion5x.h b/include/asm-arm/arch-orion5x/orion5x.h
new file mode 100644
index 000000000000..206ddd71e193
--- /dev/null
+++ b/include/asm-arm/arch-orion5x/orion5x.h
@@ -0,0 +1,159 @@
1/*
2 * include/asm-arm/arch-orion5x/orion5x.h
3 *
4 * Generic definitions of Orion SoC flavors:
5 * Orion-1, Orion-NAS, Orion-VoIP, and Orion-2.
6 *
7 * Maintainer: Tzachi Perelstein <tzachi@marvell.com>
8 *
9 * This file is licensed under the terms of the GNU General Public
10 * License version 2. This program is licensed "as is" without any
11 * warranty of any kind, whether express or implied.
12 */
13
14#ifndef __ASM_ARCH_ORION5X_H
15#define __ASM_ARCH_ORION5X_H
16
17/*****************************************************************************
18 * Orion Address Maps
19 *
20 * phys
21 * e0000000 PCIe MEM space
22 * e8000000 PCI MEM space
23 * f0000000 PCIe WA space (Orion-1/Orion-NAS only)
24 * f1000000 on-chip peripheral registers
25 * f2000000 PCIe I/O space
26 * f2100000 PCI I/O space
27 * f4000000 device bus mappings (boot)
28 * fa000000 device bus mappings (cs0)
29 * fa800000 device bus mappings (cs2)
30 * fc000000 device bus mappings (cs0/cs1)
31 *
32 * virt phys size
33 * fdd00000 f1000000 1M on-chip peripheral registers
34 * fde00000 f2000000 1M PCIe I/O space
35 * fdf00000 f2100000 1M PCI I/O space
36 * fe000000 f0000000 16M PCIe WA space (Orion-1/Orion-NAS only)
37 ****************************************************************************/
38#define ORION5X_REGS_PHYS_BASE 0xf1000000
39#define ORION5X_REGS_VIRT_BASE 0xfdd00000
40#define ORION5X_REGS_SIZE SZ_1M
41
42#define ORION5X_PCIE_IO_PHYS_BASE 0xf2000000
43#define ORION5X_PCIE_IO_VIRT_BASE 0xfde00000
44#define ORION5X_PCIE_IO_BUS_BASE 0x00000000
45#define ORION5X_PCIE_IO_SIZE SZ_1M
46
47#define ORION5X_PCI_IO_PHYS_BASE 0xf2100000
48#define ORION5X_PCI_IO_VIRT_BASE 0xfdf00000
49#define ORION5X_PCI_IO_BUS_BASE 0x00100000
50#define ORION5X_PCI_IO_SIZE SZ_1M
51
52/* Relevant only for Orion-1/Orion-NAS */
53#define ORION5X_PCIE_WA_PHYS_BASE 0xf0000000
54#define ORION5X_PCIE_WA_VIRT_BASE 0xfe000000
55#define ORION5X_PCIE_WA_SIZE SZ_16M
56
57#define ORION5X_PCIE_MEM_PHYS_BASE 0xe0000000
58#define ORION5X_PCIE_MEM_SIZE SZ_128M
59
60#define ORION5X_PCI_MEM_PHYS_BASE 0xe8000000
61#define ORION5X_PCI_MEM_SIZE SZ_128M
62
63/*******************************************************************************
64 * Supported Devices & Revisions
65 ******************************************************************************/
66/* Orion-1 (88F5181) */
67#define MV88F5181_DEV_ID 0x5181
68#define MV88F5181_REV_B1 3
69/* Orion-NAS (88F5182) */
70#define MV88F5182_DEV_ID 0x5182
71#define MV88F5182_REV_A2 2
72/* Orion-2 (88F5281) */
73#define MV88F5281_DEV_ID 0x5281
74#define MV88F5281_REV_D1 5
75#define MV88F5281_REV_D2 6
76
77/*******************************************************************************
78 * Orion Registers Map
79 ******************************************************************************/
80#define ORION5X_DDR_VIRT_BASE (ORION5X_REGS_VIRT_BASE | 0x00000)
81#define ORION5X_DDR_REG(x) (ORION5X_DDR_VIRT_BASE | (x))
82
83#define ORION5X_DEV_BUS_PHYS_BASE (ORION5X_REGS_PHYS_BASE | 0x10000)
84#define ORION5X_DEV_BUS_VIRT_BASE (ORION5X_REGS_VIRT_BASE | 0x10000)
85#define ORION5X_DEV_BUS_REG(x) (ORION5X_DEV_BUS_VIRT_BASE | (x))
86#define I2C_PHYS_BASE (ORION5X_DEV_BUS_PHYS_BASE | 0x1000)
87#define UART0_PHYS_BASE (ORION5X_DEV_BUS_PHYS_BASE | 0x2000)
88#define UART0_VIRT_BASE (ORION5X_DEV_BUS_VIRT_BASE | 0x2000)
89#define UART1_PHYS_BASE (ORION5X_DEV_BUS_PHYS_BASE | 0x2100)
90#define UART1_VIRT_BASE (ORION5X_DEV_BUS_VIRT_BASE | 0x2100)
91
92#define ORION5X_BRIDGE_VIRT_BASE (ORION5X_REGS_VIRT_BASE | 0x20000)
93#define ORION5X_BRIDGE_REG(x) (ORION5X_BRIDGE_VIRT_BASE | (x))
94#define TIMER_VIRT_BASE (ORION5X_BRIDGE_VIRT_BASE | 0x300)
95
96#define ORION5X_PCI_VIRT_BASE (ORION5X_REGS_VIRT_BASE | 0x30000)
97#define ORION5X_PCI_REG(x) (ORION5X_PCI_VIRT_BASE | (x))
98
99#define ORION5X_PCIE_VIRT_BASE (ORION5X_REGS_VIRT_BASE | 0x40000)
100#define ORION5X_PCIE_REG(x) (ORION5X_PCIE_VIRT_BASE | (x))
101
102#define ORION5X_USB0_PHYS_BASE (ORION5X_REGS_PHYS_BASE | 0x50000)
103#define ORION5X_USB0_VIRT_BASE (ORION5X_REGS_VIRT_BASE | 0x50000)
104#define ORION5X_USB0_REG(x) (ORION5X_USB0_VIRT_BASE | (x))
105
106#define ORION5X_ETH_PHYS_BASE (ORION5X_REGS_PHYS_BASE | 0x70000)
107#define ORION5X_ETH_VIRT_BASE (ORION5X_REGS_VIRT_BASE | 0x70000)
108#define ORION5X_ETH_REG(x) (ORION5X_ETH_VIRT_BASE | (x))
109
110#define ORION5X_SATA_PHYS_BASE (ORION5X_REGS_PHYS_BASE | 0x80000)
111#define ORION5X_SATA_VIRT_BASE (ORION5X_REGS_VIRT_BASE | 0x80000)
112#define ORION5X_SATA_REG(x) (ORION5X_SATA_VIRT_BASE | (x))
113
114#define ORION5X_USB1_PHYS_BASE (ORION5X_REGS_PHYS_BASE | 0xa0000)
115#define ORION5X_USB1_VIRT_BASE (ORION5X_REGS_VIRT_BASE | 0xa0000)
116#define ORION5X_USB1_REG(x) (ORION5X_USB1_VIRT_BASE | (x))
117
118/*******************************************************************************
119 * Device Bus Registers
120 ******************************************************************************/
121#define MPP_0_7_CTRL ORION5X_DEV_BUS_REG(0x000)
122#define MPP_8_15_CTRL ORION5X_DEV_BUS_REG(0x004)
123#define MPP_16_19_CTRL ORION5X_DEV_BUS_REG(0x050)
124#define MPP_DEV_CTRL ORION5X_DEV_BUS_REG(0x008)
125#define MPP_RESET_SAMPLE ORION5X_DEV_BUS_REG(0x010)
126#define GPIO_OUT ORION5X_DEV_BUS_REG(0x100)
127#define GPIO_IO_CONF ORION5X_DEV_BUS_REG(0x104)
128#define GPIO_BLINK_EN ORION5X_DEV_BUS_REG(0x108)
129#define GPIO_IN_POL ORION5X_DEV_BUS_REG(0x10c)
130#define GPIO_DATA_IN ORION5X_DEV_BUS_REG(0x110)
131#define GPIO_EDGE_CAUSE ORION5X_DEV_BUS_REG(0x114)
132#define GPIO_EDGE_MASK ORION5X_DEV_BUS_REG(0x118)
133#define GPIO_LEVEL_MASK ORION5X_DEV_BUS_REG(0x11c)
134#define DEV_BANK_0_PARAM ORION5X_DEV_BUS_REG(0x45c)
135#define DEV_BANK_1_PARAM ORION5X_DEV_BUS_REG(0x460)
136#define DEV_BANK_2_PARAM ORION5X_DEV_BUS_REG(0x464)
137#define DEV_BANK_BOOT_PARAM ORION5X_DEV_BUS_REG(0x46c)
138#define DEV_BUS_CTRL ORION5X_DEV_BUS_REG(0x4c0)
139#define DEV_BUS_INT_CAUSE ORION5X_DEV_BUS_REG(0x4d0)
140#define DEV_BUS_INT_MASK ORION5X_DEV_BUS_REG(0x4d4)
141#define GPIO_MAX 32
142
143/***************************************************************************
144 * Orion CPU Bridge Registers
145 **************************************************************************/
146#define CPU_CONF ORION5X_BRIDGE_REG(0x100)
147#define CPU_CTRL ORION5X_BRIDGE_REG(0x104)
148#define CPU_RESET_MASK ORION5X_BRIDGE_REG(0x108)
149#define CPU_SOFT_RESET ORION5X_BRIDGE_REG(0x10c)
150#define POWER_MNG_CTRL_REG ORION5X_BRIDGE_REG(0x11C)
151#define BRIDGE_CAUSE ORION5X_BRIDGE_REG(0x110)
152#define BRIDGE_MASK ORION5X_BRIDGE_REG(0x114)
153#define BRIDGE_INT_TIMER0 0x0002
154#define BRIDGE_INT_TIMER1 0x0004
155#define MAIN_IRQ_CAUSE ORION5X_BRIDGE_REG(0x200)
156#define MAIN_IRQ_MASK ORION5X_BRIDGE_REG(0x204)
157
158
159#endif
diff --git a/include/asm-arm/arch-orion/system.h b/include/asm-arm/arch-orion5x/system.h
index 17704c68f90e..3f1d1e2d38f8 100644
--- a/include/asm-arm/arch-orion/system.h
+++ b/include/asm-arm/arch-orion5x/system.h
@@ -1,10 +1,10 @@
1/* 1/*
2 * include/asm-arm/arch-orion/system.h 2 * include/asm-arm/arch-orion5x/system.h
3 * 3 *
4 * Tzachi Perelstein <tzachi@marvell.com> 4 * Tzachi Perelstein <tzachi@marvell.com>
5 * 5 *
6 * This file is licensed under the terms of the GNU General Public 6 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without any 7 * License version 2. This program is licensed "as is" without any
8 * warranty of any kind, whether express or implied. 8 * warranty of any kind, whether express or implied.
9 */ 9 */
10 10
@@ -12,7 +12,7 @@
12#define __ASM_ARCH_SYSTEM_H 12#define __ASM_ARCH_SYSTEM_H
13 13
14#include <asm/arch/hardware.h> 14#include <asm/arch/hardware.h>
15#include <asm/arch/orion.h> 15#include <asm/arch/orion5x.h>
16 16
17static inline void arch_idle(void) 17static inline void arch_idle(void)
18{ 18{
@@ -24,8 +24,9 @@ static inline void arch_reset(char mode)
24 /* 24 /*
25 * Enable and issue soft reset 25 * Enable and issue soft reset
26 */ 26 */
27 orion_setbits(CPU_RESET_MASK, (1 << 2)); 27 orion5x_setbits(CPU_RESET_MASK, (1 << 2));
28 orion_setbits(CPU_SOFT_RESET, 1); 28 orion5x_setbits(CPU_SOFT_RESET, 1);
29} 29}
30 30
31
31#endif 32#endif
diff --git a/include/asm-arm/arch-orion5x/timex.h b/include/asm-arm/arch-orion5x/timex.h
new file mode 100644
index 000000000000..31c568e28cc3
--- /dev/null
+++ b/include/asm-arm/arch-orion5x/timex.h
@@ -0,0 +1,13 @@
1/*
2 * include/asm-arm/arch-orion5x/timex.h
3 *
4 * Tzachi Perelstein <tzachi@marvell.com>
5 *
6 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without any
8 * warranty of any kind, whether express or implied.
9 */
10
11#define CLOCK_TICK_RATE (100 * HZ)
12
13#define ORION5X_TCLK 166666667
diff --git a/include/asm-arm/arch-orion/uncompress.h b/include/asm-arm/arch-orion5x/uncompress.h
index 59f44039909a..5c13d4fafb4e 100644
--- a/include/asm-arm/arch-orion/uncompress.h
+++ b/include/asm-arm/arch-orion5x/uncompress.h
@@ -1,14 +1,14 @@
1/* 1/*
2 * include/asm-arm/arch-orion/uncompress.h 2 * include/asm-arm/arch-orion5x/uncompress.h
3 * 3 *
4 * Tzachi Perelstein <tzachi@marvell.com> 4 * Tzachi Perelstein <tzachi@marvell.com>
5 * 5 *
6 * This file is licensed under the terms of the GNU General Public 6 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without any 7 * License version 2. This program is licensed "as is" without any
8 * warranty of any kind, whether express or implied. 8 * warranty of any kind, whether express or implied.
9 */ 9 */
10 10
11#include <asm/arch/orion.h> 11#include <asm/arch/orion5x.h>
12 12
13#define MV_UART_THR ((volatile unsigned char *)(UART0_PHYS_BASE + 0x0)) 13#define MV_UART_THR ((volatile unsigned char *)(UART0_PHYS_BASE + 0x0))
14#define MV_UART_LSR ((volatile unsigned char *)(UART0_PHYS_BASE + 0x14)) 14#define MV_UART_LSR ((volatile unsigned char *)(UART0_PHYS_BASE + 0x14))
diff --git a/include/asm-arm/arch-orion/vmalloc.h b/include/asm-arm/arch-orion5x/vmalloc.h
index 9d580278d2bc..2b3061e90dc1 100644
--- a/include/asm-arm/arch-orion/vmalloc.h
+++ b/include/asm-arm/arch-orion5x/vmalloc.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * include/asm-arm/arch-orion/vmalloc.h 2 * include/asm-arm/arch-orion5x/vmalloc.h
3 */ 3 */
4 4
5#define VMALLOC_END 0xfd800000 5#define VMALLOC_END 0xfd800000
diff --git a/include/asm-arm/arch-pxa/camera.h b/include/asm-arm/arch-pxa/camera.h
new file mode 100644
index 000000000000..39516ced8b1f
--- /dev/null
+++ b/include/asm-arm/arch-pxa/camera.h
@@ -0,0 +1,48 @@
1/*
2 camera.h - PXA camera driver header file
3
4 Copyright (C) 2003, Intel Corporation
5 Copyright (C) 2008, Guennadi Liakhovetski <kernel@pengutronix.de>
6
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
11
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20*/
21
22#ifndef __ASM_ARCH_CAMERA_H_
23#define __ASM_ARCH_CAMERA_H_
24
25#define PXA_CAMERA_MASTER 1
26#define PXA_CAMERA_DATAWIDTH_4 2
27#define PXA_CAMERA_DATAWIDTH_5 4
28#define PXA_CAMERA_DATAWIDTH_8 8
29#define PXA_CAMERA_DATAWIDTH_9 0x10
30#define PXA_CAMERA_DATAWIDTH_10 0x20
31#define PXA_CAMERA_PCLK_EN 0x40
32#define PXA_CAMERA_MCLK_EN 0x80
33#define PXA_CAMERA_PCP 0x100
34#define PXA_CAMERA_HSP 0x200
35#define PXA_CAMERA_VSP 0x400
36
37struct pxacamera_platform_data {
38 int (*init)(struct device *);
39 int (*power)(struct device *, int);
40 int (*reset)(struct device *, int);
41
42 unsigned long flags;
43 unsigned long mclk_10khz;
44};
45
46extern void pxa_set_camera_info(struct pxacamera_platform_data *);
47
48#endif /* __ASM_ARCH_CAMERA_H_ */
diff --git a/include/asm-arm/arch-pxa/gumstix.h b/include/asm-arm/arch-pxa/gumstix.h
new file mode 100644
index 000000000000..6fa85c4f94f8
--- /dev/null
+++ b/include/asm-arm/arch-pxa/gumstix.h
@@ -0,0 +1,96 @@
1/*
2 * linux/include/asm-arm/arch-pxa/gumstix.h
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 */
8
9
10/* BTRESET - Reset line to Bluetooth module, active low signal. */
11#define GPIO_GUMSTIX_BTRESET 7
12#define GPIO_GUMSTIX_BTRESET_MD (GPIO_GUMSTIX_BTRESET | GPIO_OUT)
13
14
15/*
16GPIOn - Input from MAX823 (or equiv), normalizing USB +5V into a clean
17interrupt signal for determining cable presence. On the original gumstix,
18this is GPIO81, and GPIO83 needs to be defined as well. On the gumstix F,
19this moves to GPIO17 and GPIO37. */
20
21/* GPIOx - Connects to USB D+ and used as a pull-up after GPIOn
22has detected a cable insertion; driven low otherwise. */
23
24#ifdef CONFIG_ARCH_GUMSTIX_ORIG
25
26#define GPIO_GUMSTIX_USB_GPIOn 81
27#define GPIO_GUMSTIX_USB_GPIOx 83
28
29#else
30
31#define GPIO_GUMSTIX_USB_GPIOn 35
32#define GPIO_GUMSTIX_USB_GPIOx 41
33
34#endif
35
36/* usb state change */
37#define GUMSTIX_USB_INTR_IRQ IRQ_GPIO(GPIO_GUMSTIX_USB_GPIOn)
38
39#define GPIO_GUMSTIX_USB_GPIOn_MD (GPIO_GUMSTIX_USB_GPIOn | GPIO_IN)
40#define GPIO_GUMSTIX_USB_GPIOx_CON_MD (GPIO_GUMSTIX_USB_GPIOx | GPIO_OUT)
41#define GPIO_GUMSTIX_USB_GPIOx_DIS_MD (GPIO_GUMSTIX_USB_GPIOx | GPIO_IN)
42
43/*
44 * SD/MMC definitions
45 */
46#define GUMSTIX_GPIO_nSD_WP 22 /* SD Write Protect */
47#define GUMSTIX_GPIO_nSD_DETECT 11 /* MMC/SD Card Detect */
48#define GUMSTIX_IRQ_GPIO_nSD_DETECT IRQ_GPIO(GUMSTIX_GPIO_nSD_DETECT)
49
50/*
51 * SMC Ethernet definitions
52 * ETH_RST provides a hardware reset line to the ethernet chip
53 * ETH is the IRQ line in from the ethernet chip to the PXA
54 */
55#define GPIO_GUMSTIX_ETH0_RST 80
56#define GPIO_GUMSTIX_ETH0_RST_MD (GPIO_GUMSTIX_ETH0_RST | GPIO_OUT)
57#define GPIO_GUMSTIX_ETH1_RST 52
58#define GPIO_GUMSTIX_ETH1_RST_MD (GPIO_GUMSTIX_ETH1_RST | GPIO_OUT)
59
60#define GPIO_GUMSTIX_ETH0 36
61#define GPIO_GUMSTIX_ETH0_MD (GPIO_GUMSTIX_ETH0 | GPIO_IN)
62#define GUMSTIX_ETH0_IRQ IRQ_GPIO(GPIO_GUMSTIX_ETH0)
63#define GPIO_GUMSTIX_ETH1 27
64#define GPIO_GUMSTIX_ETH1_MD (GPIO_GUMSTIX_ETH1 | GPIO_IN)
65#define GUMSTIX_ETH1_IRQ IRQ_GPIO(GPIO_GUMSTIX_ETH1)
66
67
68/* CF reset line */
69#define GPIO8_RESET 8
70
71/* CF slot 0 */
72#define GPIO4_nBVD1 4
73#define GPIO4_nSTSCHG GPIO4_nBVD1
74#define GPIO11_nCD 11
75#define GPIO26_PRDY_nBSY 26
76#define GUMSTIX_S0_nSTSCHG_IRQ IRQ_GPIO(GPIO4_nSTSCHG)
77#define GUMSTIX_S0_nCD_IRQ IRQ_GPIO(GPIO11_nCD)
78#define GUMSTIX_S0_PRDY_nBSY_IRQ IRQ_GPIO(GPIO26_PRDY_nBSY)
79
80/* CF slot 1 */
81#define GPIO18_nBVD1 18
82#define GPIO18_nSTSCHG GPIO18_nBVD1
83#define GPIO36_nCD 36
84#define GPIO27_PRDY_nBSY 27
85#define GUMSTIX_S1_nSTSCHG_IRQ IRQ_GPIO(GPIO18_nSTSCHG)
86#define GUMSTIX_S1_nCD_IRQ IRQ_GPIO(GPIO36_nCD)
87#define GUMSTIX_S1_PRDY_nBSY_IRQ IRQ_GPIO(GPIO27_PRDY_nBSY)
88
89/* CF GPIO line modes */
90#define GPIO4_nSTSCHG_MD (GPIO4_nSTSCHG | GPIO_IN)
91#define GPIO8_RESET_MD (GPIO8_RESET | GPIO_OUT)
92#define GPIO11_nCD_MD (GPIO11_nCD | GPIO_IN)
93#define GPIO18_nSTSCHG_MD (GPIO18_nSTSCHG | GPIO_IN)
94#define GPIO26_PRDY_nBSY_MD (GPIO26_PRDY_nBSY | GPIO_IN)
95#define GPIO27_PRDY_nBSY_MD (GPIO27_PRDY_nBSY | GPIO_IN)
96#define GPIO36_nCD_MD (GPIO36_nCD | GPIO_IN)
diff --git a/include/asm-arm/arch-pxa/irda.h b/include/asm-arm/arch-pxa/irda.h
index 748406f384c2..99f4f423a8e1 100644
--- a/include/asm-arm/arch-pxa/irda.h
+++ b/include/asm-arm/arch-pxa/irda.h
@@ -10,6 +10,8 @@
10struct pxaficp_platform_data { 10struct pxaficp_platform_data {
11 int transceiver_cap; 11 int transceiver_cap;
12 void (*transceiver_mode)(struct device *dev, int mode); 12 void (*transceiver_mode)(struct device *dev, int mode);
13 int (*startup)(struct device *dev);
14 void (*shutdown)(struct device *dev);
13}; 15};
14 16
15extern void pxa_set_ficp_info(struct pxaficp_platform_data *info); 17extern void pxa_set_ficp_info(struct pxaficp_platform_data *info);
diff --git a/include/asm-arm/arch-pxa/irqs.h b/include/asm-arm/arch-pxa/irqs.h
index c562b972a4a6..50c77eacbd5e 100644
--- a/include/asm-arm/arch-pxa/irqs.h
+++ b/include/asm-arm/arch-pxa/irqs.h
@@ -181,7 +181,8 @@
181#elif defined(CONFIG_ARCH_LUBBOCK) || \ 181#elif defined(CONFIG_ARCH_LUBBOCK) || \
182 defined(CONFIG_MACH_LOGICPD_PXA270) || \ 182 defined(CONFIG_MACH_LOGICPD_PXA270) || \
183 defined(CONFIG_MACH_MAINSTONE) || \ 183 defined(CONFIG_MACH_MAINSTONE) || \
184 defined(CONFIG_MACH_PCM027) 184 defined(CONFIG_MACH_PCM027) || \
185 defined(CONFIG_MACH_MAGICIAN)
185#define NR_IRQS (IRQ_BOARD_END) 186#define NR_IRQS (IRQ_BOARD_END)
186#else 187#else
187#define NR_IRQS (IRQ_BOARD_START) 188#define NR_IRQS (IRQ_BOARD_START)
diff --git a/include/asm-arm/arch-pxa/magician.h b/include/asm-arm/arch-pxa/magician.h
index 337f51f06b3a..b34fd5683e2d 100644
--- a/include/asm-arm/arch-pxa/magician.h
+++ b/include/asm-arm/arch-pxa/magician.h
@@ -12,7 +12,8 @@
12#ifndef _MAGICIAN_H_ 12#ifndef _MAGICIAN_H_
13#define _MAGICIAN_H_ 13#define _MAGICIAN_H_
14 14
15#include <asm/arch/pxa-regs.h> 15#include <asm/arch/irqs.h>
16#include <asm/arch/pxa2xx-gpio.h>
16 17
17/* 18/*
18 * PXA GPIOs 19 * PXA GPIOs
@@ -34,6 +35,7 @@
34#define GPIO48_MAGICIAN_UNKNOWN 48 35#define GPIO48_MAGICIAN_UNKNOWN 48
35#define GPIO56_MAGICIAN_UNKNOWN 56 36#define GPIO56_MAGICIAN_UNKNOWN 56
36#define GPIO57_MAGICIAN_CAM_RESET 57 37#define GPIO57_MAGICIAN_CAM_RESET 57
38#define GPIO75_MAGICIAN_SAMSUNG_POWER 75
37#define GPIO83_MAGICIAN_nIR_EN 83 39#define GPIO83_MAGICIAN_nIR_EN 83
38#define GPIO86_MAGICIAN_GSM_RESET 86 40#define GPIO86_MAGICIAN_GSM_RESET 86
39#define GPIO87_MAGICIAN_GSM_SELECT 87 41#define GPIO87_MAGICIAN_GSM_SELECT 87
@@ -81,6 +83,7 @@
81#define GPIO48_MAGICIAN_UNKNOWN_MD (48 | GPIO_OUT) 83#define GPIO48_MAGICIAN_UNKNOWN_MD (48 | GPIO_OUT)
82#define GPIO56_MAGICIAN_UNKNOWN_MD (56 | GPIO_OUT) 84#define GPIO56_MAGICIAN_UNKNOWN_MD (56 | GPIO_OUT)
83#define GPIO57_MAGICIAN_CAM_RESET_MD (57 | GPIO_OUT) 85#define GPIO57_MAGICIAN_CAM_RESET_MD (57 | GPIO_OUT)
86#define GPIO75_MAGICIAN_SAMSUNG_POWER_MD (75 | GPIO_OUT)
84#define GPIO83_MAGICIAN_nIR_EN_MD (83 | GPIO_OUT) 87#define GPIO83_MAGICIAN_nIR_EN_MD (83 | GPIO_OUT)
85#define GPIO86_MAGICIAN_GSM_RESET_MD (86 | GPIO_OUT) 88#define GPIO86_MAGICIAN_GSM_RESET_MD (86 | GPIO_OUT)
86#define GPIO87_MAGICIAN_GSM_SELECT_MD (87 | GPIO_OUT) 89#define GPIO87_MAGICIAN_GSM_SELECT_MD (87 | GPIO_OUT)
@@ -108,4 +111,56 @@
108#define GPIO119_MAGICIAN_UNKNOWN_MD (119 | GPIO_OUT) 111#define GPIO119_MAGICIAN_UNKNOWN_MD (119 | GPIO_OUT)
109#define GPIO120_MAGICIAN_UNKNOWN_MD (120 | GPIO_OUT) 112#define GPIO120_MAGICIAN_UNKNOWN_MD (120 | GPIO_OUT)
110 113
114/*
115 * CPLD IRQs
116 */
117
118#define IRQ_MAGICIAN_SD (IRQ_BOARD_START + 0)
119#define IRQ_MAGICIAN_EP (IRQ_BOARD_START + 1)
120#define IRQ_MAGICIAN_BT (IRQ_BOARD_START + 2)
121#define IRQ_MAGICIAN_AC (IRQ_BOARD_START + 3)
122
123/*
124 * CPLD EGPIOs
125 */
126
127#define MAGICIAN_EGPIO_BASE 0x80 /* GPIO_BOARD_START */
128#define MAGICIAN_EGPIO(reg,bit) \
129 (MAGICIAN_EGPIO_BASE + 8*reg + bit)
130
131/* output */
132
133#define EGPIO_MAGICIAN_TOPPOLY_POWER MAGICIAN_EGPIO(0, 2)
134#define EGPIO_MAGICIAN_LED_POWER MAGICIAN_EGPIO(0, 5)
135#define EGPIO_MAGICIAN_GSM_RESET MAGICIAN_EGPIO(0, 6)
136#define EGPIO_MAGICIAN_LCD_POWER MAGICIAN_EGPIO(0, 7)
137#define EGPIO_MAGICIAN_SPK_POWER MAGICIAN_EGPIO(1, 0)
138#define EGPIO_MAGICIAN_EP_POWER MAGICIAN_EGPIO(1, 1)
139#define EGPIO_MAGICIAN_IN_SEL0 MAGICIAN_EGPIO(1, 2)
140#define EGPIO_MAGICIAN_IN_SEL1 MAGICIAN_EGPIO(1, 3)
141#define EGPIO_MAGICIAN_MIC_POWER MAGICIAN_EGPIO(1, 4)
142#define EGPIO_MAGICIAN_CODEC_RESET MAGICIAN_EGPIO(1, 5)
143#define EGPIO_MAGICIAN_CODEC_POWER MAGICIAN_EGPIO(1, 6)
144#define EGPIO_MAGICIAN_BL_POWER MAGICIAN_EGPIO(1, 7)
145#define EGPIO_MAGICIAN_SD_POWER MAGICIAN_EGPIO(2, 0)
146#define EGPIO_MAGICIAN_CARKIT_MIC MAGICIAN_EGPIO(2, 1)
147#define EGPIO_MAGICIAN_UNKNOWN_WAVEDEV_DLL MAGICIAN_EGPIO(2, 2)
148#define EGPIO_MAGICIAN_FLASH_VPP MAGICIAN_EGPIO(2, 3)
149#define EGPIO_MAGICIAN_BL_POWER2 MAGICIAN_EGPIO(2, 4)
150#define EGPIO_MAGICIAN_CHARGE_EN MAGICIAN_EGPIO(2, 5)
151#define EGPIO_MAGICIAN_GSM_POWER MAGICIAN_EGPIO(2, 7)
152
153/* input */
154
155#define EGPIO_MAGICIAN_CABLE_STATE_AC MAGICIAN_EGPIO(4, 0)
156#define EGPIO_MAGICIAN_CABLE_STATE_USB MAGICIAN_EGPIO(4, 1)
157
158#define EGPIO_MAGICIAN_BOARD_ID0 MAGICIAN_EGPIO(5, 0)
159#define EGPIO_MAGICIAN_BOARD_ID1 MAGICIAN_EGPIO(5, 1)
160#define EGPIO_MAGICIAN_BOARD_ID2 MAGICIAN_EGPIO(5, 2)
161#define EGPIO_MAGICIAN_LCD_SELECT MAGICIAN_EGPIO(5, 3)
162#define EGPIO_MAGICIAN_nSD_READONLY MAGICIAN_EGPIO(5, 4)
163
164#define EGPIO_MAGICIAN_EP_INSERT MAGICIAN_EGPIO(6, 1)
165
111#endif /* _MAGICIAN_H_ */ 166#endif /* _MAGICIAN_H_ */
diff --git a/include/asm-arm/arch-pxa/mfp-pxa25x.h b/include/asm-arm/arch-pxa/mfp-pxa25x.h
new file mode 100644
index 000000000000..0499323010ba
--- /dev/null
+++ b/include/asm-arm/arch-pxa/mfp-pxa25x.h
@@ -0,0 +1,161 @@
1#ifndef __ASM_ARCH_MFP_PXA25X_H
2#define __ASM_ARCH_MFP_PXA25X_H
3
4#include <asm/arch/mfp.h>
5#include <asm/arch/mfp-pxa2xx.h>
6
7/* GPIO */
8#define GPIO2_GPIO MFP_CFG_IN(GPIO2, AF0)
9#define GPIO3_GPIO MFP_CFG_IN(GPIO3, AF0)
10#define GPIO4_GPIO MFP_CFG_IN(GPIO4, AF0)
11#define GPIO5_GPIO MFP_CFG_IN(GPIO5, AF0)
12#define GPIO6_GPIO MFP_CFG_IN(GPIO6, AF0)
13#define GPIO7_GPIO MFP_CFG_IN(GPIO7, AF0)
14#define GPIO8_GPIO MFP_CFG_IN(GPIO8, AF0)
15
16#define GPIO1_RST MFP_CFG_IN(GPIO1, AF1)
17
18/* Crystal and Clock Signals */
19#define GPIO10_RTCCLK MFP_CFG_OUT(GPIO10, AF1, DRIVE_LOW)
20#define GPIO70_RTC_CLK MFP_CFG_OUT(GPIO70, AF1, DRIVE_LOW)
21#define GPIO7_48MHz MFP_CFG_OUT(GPIO7, AF1, DRIVE_LOW)
22#define GPIO11_3_6MHz MFP_CFG_OUT(GPIO11, AF1, DRIVE_LOW)
23#define GPIO71_3_6MHz MFP_CFG_OUT(GPIO71, AF1, DRIVE_LOW)
24#define GPIO12_32KHz MFP_CFG_OUT(GPIO12, AF1, DRIVE_LOW)
25#define GPIO72_32kHz MFP_CFG_OUT(GPIO72, AF1, DRIVE_LOW)
26
27/* SDRAM and Static Memory I/O Signals */
28#define GPIO15_nCS_1 MFP_CFG_OUT(GPIO15, AF2, DRIVE_HIGH)
29#define GPIO78_nCS_2 MFP_CFG_OUT(GPIO78, AF2, DRIVE_HIGH)
30#define GPIO79_nCS_3 MFP_CFG_OUT(GPIO79, AF2, DRIVE_HIGH)
31#define GPIO80_nCS_4 MFP_CFG_OUT(GPIO80, AF2, DRIVE_HIGH)
32#define GPIO33_nCS_5 MFP_CFG_OUT(GPIO33, AF2, DRIVE_HIGH)
33
34/* Miscellaneous I/O and DMA Signals */
35#define GPIO18_RDY MFP_CFG_IN(GPIO18, AF1)
36#define GPIO20_DREQ_0 MFP_CFG_IN(GPIO20, AF1)
37#define GPIO19_DREQ_1 MFP_CFG_IN(GPIO19, AF1)
38
39/* Alternate Bus Master Mode I/O Signals */
40#define GPIO13_MBGNT MFP_CFG_OUT(GPIO13, AF2, DRIVE_LOW)
41#define GPIO73_MBGNT MFP_CFG_OUT(GPIO73, AF1, DRIVE_LOW)
42#define GPIO14_MBREQ MFP_CFG_IN(GPIO14, AF1)
43#define GPIO66_MBREQ MFP_CFG_IN(GPIO66, AF1)
44
45/* PC CARD */
46#define GPIO52_nPCE_1 MFP_CFG_OUT(GPIO52, AF2, DRIVE_HIGH)
47#define GPIO53_nPCE_2 MFP_CFG_OUT(GPIO53, AF2, DRIVE_HIGH)
48#define GPIO55_nPREG MFP_CFG_OUT(GPIO55, AF2, DRIVE_HIGH)
49#define GPIO50_nPIOR MFP_CFG_OUT(GPIO50, AF2, DRIVE_HIGH)
50#define GPIO51_nPIOW MFP_CFG_OUT(GPIO51, AF2, DRIVE_HIGH)
51#define GPIO49_nPWE MFP_CFG_OUT(GPIO49, AF2, DRIVE_HIGH)
52#define GPIO48_nPOE MFP_CFG_OUT(GPIO48, AF2, DRIVE_HIGH)
53#define GPIO57_nIOIS16 MFP_CFG_IN(GPIO57, AF1)
54#define GPIO56_nPWAIT MFP_CFG_IN(GPIO56, AF1)
55#define GPIO54_nPSKTSEL MFP_CFG_OUT(GPIO54, AF2, DRIVE_HIGH)
56
57/* FFUART */
58#define GPIO34_FFUART_RXD MFP_CFG_IN(GPIO34, AF1)
59#define GPIO35_FFUART_CTS MFP_CFG_IN(GPIO35, AF1)
60#define GPIO36_FFUART_DCD MFP_CFG_IN(GPIO36, AF1)
61#define GPIO37_FFUART_DSR MFP_CFG_IN(GPIO37, AF1)
62#define GPIO38_FFUART_RI MFP_CFG_IN(GPIO38, AF1)
63#define GPIO39_FFUART_TXD MFP_CFG_OUT(GPIO39, AF2, DRIVE_HIGH)
64#define GPIO40_FFUART_DTR MFP_CFG_OUT(GPIO40, AF2, DRIVE_HIGH)
65#define GPIO41_FFUART_RTS MFP_CFG_OUT(GPIO41, AF2, DRIVE_HIGH)
66
67/* BTUART */
68#define GPIO42_BTUART_RXD MFP_CFG_IN(GPIO42, AF1)
69#define GPIO43_BTUART_TXD MFP_CFG_OUT(GPIO43, AF2, DRIVE_HIGH)
70#define GPIO44_BTUART_CTS MFP_CFG_IN(GPIO44, AF1)
71#define GPIO45_BTUART_RTS MFP_CFG_OUT(GPIO45, AF2, DRIVE_HIGH)
72
73/* STUART */
74#define GPIO46_STUART_RXD MFP_CFG_IN(GPIO46, AF2)
75#define GPIO47_STUART_TXD MFP_CFG_OUT(GPIO47, AF1, DRIVE_HIGH)
76
77/* HWUART */
78#define GPIO42_HWUART_RXD MFP_CFG_IN(GPIO42, AF3)
79#define GPIO43_HWUART_TXD MFP_CFG_OUT(GPIO43, AF3, DRIVE_HIGH)
80#define GPIO44_HWUART_CTS MFP_CFG_IN(GPIO44, AF3)
81#define GPIO45_HWUART_RTS MFP_CFG_OUT(GPIO45, AF3, DRIVE_HIGH)
82#define GPIO48_HWUART_TXD MFP_CFG_OUT(GPIO48, AF1, DRIVE_HIGH)
83#define GPIO49_HWUART_RXD MFP_CFG_IN(GPIO49, AF1)
84#define GPIO50_HWUART_CTS MFP_CFG_IN(GPIO50, AF1)
85#define GPIO51_HWUART_RTS MFP_CFG_OUT(GPIO51, AF1, DRIVE_HIGH)
86
87/* FICP */
88#define GPIO46_FICP_RXD MFP_CFG_IN(GPIO46, AF1)
89#define GPIO47_FICP_TXD MFP_CFG_OUT(GPIO47, AF2, DRIVE_HIGH)
90
91/* PWM 0/1 */
92#define GPIO16_PWM0_OUT MFP_CFG_OUT(GPIO16, AF2, DRIVE_LOW)
93#define GPIO17_PWM1_OUT MFP_CFG_OUT(GPIO17, AF2, DRIVE_LOW)
94
95/* AC97 */
96#define GPIO28_AC97_BITCLK MFP_CFG_IN(GPIO28, AF1)
97#define GPIO29_AC97_SDATA_IN_0 MFP_CFG_IN(GPIO29, AF1)
98#define GPIO30_AC97_SDATA_OUT MFP_CFG_OUT(GPIO30, AF2, DRIVE_LOW)
99#define GPIO31_AC97_SYNC MFP_CFG_OUT(GPIO31, AF2, DRIVE_LOW)
100#define GPIO32_AC97_SDATA_IN_1 MFP_CFG_IN(GPIO32, AF1)
101
102/* I2S */
103#define GPIO28_I2S_BITCLK_IN MFP_CFG_IN(GPIO28, AF2)
104#define GPIO28_I2S_BITCLK_OUT MFP_CFG_OUT(GPIO28, AF1, DRIVE_LOW)
105#define GPIO29_I2S_SDATA_IN MFP_CFG_IN(GPIO29, AF2)
106#define GPIO30_I2S_SDATA_OUT MFP_CFG_OUT(GPIO30, AF1, DRIVE_LOW)
107#define GPIO31_I2S_SYNC MFP_CFG_OUT(GPIO31, AF1, DRIVE_LOW)
108#define GPIO32_I2S_SYSCLK MFP_CFG_OUT(GPIO32, AF1, DRIVE_LOW)
109
110/* SSP 1 */
111#define GPIO23_SSP1_SCLK MFP_CFG_OUT(GPIO23, AF2, DRIVE_LOW)
112#define GPIO24_SSP1_SFRM MFP_CFG_OUT(GPIO24, AF2, DRIVE_LOW)
113#define GPIO25_SSP1_TXD MFP_CFG_OUT(GPIO25, AF2, DRIVE_LOW)
114#define GPIO26_SSP1_RXD MFP_CFG_IN(GPIO26, AF1)
115#define GPIO27_SSP1_EXTCLK MFP_CFG_IN(GPIO27, AF1)
116
117/* SSP 2 - NSSP */
118#define GPIO81_SSP2_CLK_OUT MFP_CFG_OUT(GPIO81, AF1, DRIVE_LOW)
119#define GPIO81_SSP2_CLK_IN MFP_CFG_IN(GPIO81, AF1)
120#define GPIO82_SSP2_FRM_OUT MFP_CFG_OUT(GPIO82, AF1, DRIVE_LOW)
121#define GPIO82_SSP2_FRM_IN MFP_CFG_IN(GPIO82, AF1)
122#define GPIO83_SSP2_TXD MFP_CFG_OUT(GPIO83, AF1, DRIVE_LOW)
123#define GPIO83_SSP2_RXD MFP_CFG_IN(GPIO83, AF2)
124#define GPIO84_SSP2_TXD MFP_CFG_OUT(GPIO84, AF1, DRIVE_LOW)
125#define GPIO84_SSP2_RXD MFP_CFG_IN(GPIO84, AF2)
126
127/* MMC */
128#define GPIO6_MMC_CLK MFP_CFG_OUT(GPIO6, AF1, DRIVE_LOW)
129#define GPIO8_MMC_CS0 MFP_CFG_OUT(GPIO8, AF1, DRIVE_LOW)
130#define GPIO9_MMC_CS1 MFP_CFG_OUT(GPIO9, AF1, DRIVE_LOW)
131#define GPIO34_MMC_CS0 MFP_CFG_OUT(GPIO34, AF2, DRIVE_LOW)
132#define GPIO39_MMC_CS1 MFP_CFG_OUT(GPIO39, AF1, DRIVE_LOW)
133#define GPIO53_MMC_CLK MFP_CFG_OUT(GPIO53, AF1, DRIVE_LOW)
134#define GPIO54_MMC_CLK MFP_CFG_OUT(GPIO54, AF1, DRIVE_LOW)
135#define GPIO69_MMC_CLK MFP_CFG_OUT(GPIO69, AF1, DRIVE_LOW)
136#define GPIO67_MMC_CS0 MFP_CFG_OUT(GPIO67, AF1, DRIVE_LOW)
137#define GPIO68_MMC_CS1 MFP_CFG_OUT(GPIO68, AF1, DRIVE_LOW)
138
139/* LCD */
140#define GPIO58_LCD_LDD_0 MFP_CFG_OUT(GPIO58, AF2, DRIVE_LOW)
141#define GPIO59_LCD_LDD_1 MFP_CFG_OUT(GPIO59, AF2, DRIVE_LOW)
142#define GPIO60_LCD_LDD_2 MFP_CFG_OUT(GPIO60, AF2, DRIVE_LOW)
143#define GPIO61_LCD_LDD_3 MFP_CFG_OUT(GPIO61, AF2, DRIVE_LOW)
144#define GPIO62_LCD_LDD_4 MFP_CFG_OUT(GPIO62, AF2, DRIVE_LOW)
145#define GPIO63_LCD_LDD_5 MFP_CFG_OUT(GPIO63, AF2, DRIVE_LOW)
146#define GPIO64_LCD_LDD_6 MFP_CFG_OUT(GPIO64, AF2, DRIVE_LOW)
147#define GPIO65_LCD_LDD_7 MFP_CFG_OUT(GPIO65, AF2, DRIVE_LOW)
148#define GPIO66_LCD_LDD_8 MFP_CFG_OUT(GPIO66, AF2, DRIVE_LOW)
149#define GPIO67_LCD_LDD_9 MFP_CFG_OUT(GPIO67, AF2, DRIVE_LOW)
150#define GPIO68_LCD_LDD_10 MFP_CFG_OUT(GPIO68, AF2, DRIVE_LOW)
151#define GPIO69_LCD_LDD_11 MFP_CFG_OUT(GPIO69, AF2, DRIVE_LOW)
152#define GPIO70_LCD_LDD_12 MFP_CFG_OUT(GPIO70, AF2, DRIVE_LOW)
153#define GPIO71_LCD_LDD_13 MFP_CFG_OUT(GPIO71, AF2, DRIVE_LOW)
154#define GPIO72_LCD_LDD_14 MFP_CFG_OUT(GPIO72, AF2, DRIVE_LOW)
155#define GPIO73_LCD_LDD_15 MFP_CFG_OUT(GPIO73, AF2, DRIVE_LOW)
156#define GPIO74_LCD_FCLK MFP_CFG_OUT(GPIO74, AF2, DRIVE_LOW)
157#define GPIO75_LCD_LCLK MFP_CFG_OUT(GPIO75, AF2, DRIVE_LOW)
158#define GPIO76_LCD_PCLK MFP_CFG_OUT(GPIO76, AF2, DRIVE_LOW)
159#define GPIO77_LCD_ACBIAS MFP_CFG_OUT(GPIO77, AF2, DRIVE_LOW)
160
161#endif /* __ASM_ARCH_MFP_PXA25X_H */
diff --git a/include/asm-arm/arch-pxa/mfp-pxa27x.h b/include/asm-arm/arch-pxa/mfp-pxa27x.h
new file mode 100644
index 000000000000..eb6eaa174f8d
--- /dev/null
+++ b/include/asm-arm/arch-pxa/mfp-pxa27x.h
@@ -0,0 +1,432 @@
1#ifndef __ASM_ARCH_MFP_PXA27X_H
2#define __ASM_ARCH_MFP_PXA27X_H
3
4/*
5 * NOTE: for those special-function bidirectional GPIOs, as described
6 * in the "PXA27x Developer's Manual" Section 24.4.2.1, only its input
7 * alternative is preserved, the direction is actually selected by the
8 * specific controller, and this should work in most cases.
9 */
10
11#include <asm/arch/mfp.h>
12#include <asm/arch/mfp-pxa2xx.h>
13
14/* GPIO */
15#define GPIO85_GPIO MFP_CFG_IN(GPIO85, AF0)
16#define GPIO86_GPIO MFP_CFG_IN(GPIO86, AF0)
17#define GPIO87_GPIO MFP_CFG_IN(GPIO87, AF0)
18#define GPIO88_GPIO MFP_CFG_IN(GPIO88, AF0)
19#define GPIO89_GPIO MFP_CFG_IN(GPIO89, AF0)
20#define GPIO90_GPIO MFP_CFG_IN(GPIO90, AF0)
21#define GPIO91_GPIO MFP_CFG_IN(GPIO91, AF0)
22#define GPIO92_GPIO MFP_CFG_IN(GPIO92, AF0)
23#define GPIO93_GPIO MFP_CFG_IN(GPIO93, AF0)
24#define GPIO94_GPIO MFP_CFG_IN(GPIO94, AF0)
25#define GPIO95_GPIO MFP_CFG_IN(GPIO95, AF0)
26#define GPIO96_GPIO MFP_CFG_IN(GPIO96, AF0)
27#define GPIO97_GPIO MFP_CFG_IN(GPIO97, AF0)
28#define GPIO98_GPIO MFP_CFG_IN(GPIO98, AF0)
29#define GPIO99_GPIO MFP_CFG_IN(GPIO99, AF0)
30#define GPIO100_GPIO MFP_CFG_IN(GPIO100, AF0)
31#define GPIO101_GPIO MFP_CFG_IN(GPIO101, AF0)
32#define GPIO102_GPIO MFP_CFG_IN(GPIO102, AF0)
33#define GPIO103_GPIO MFP_CFG_IN(GPIO103, AF0)
34#define GPIO104_GPIO MFP_CFG_IN(GPIO104, AF0)
35#define GPIO105_GPIO MFP_CFG_IN(GPIO105, AF0)
36#define GPIO106_GPIO MFP_CFG_IN(GPIO106, AF0)
37#define GPIO107_GPIO MFP_CFG_IN(GPIO107, AF0)
38#define GPIO108_GPIO MFP_CFG_IN(GPIO108, AF0)
39#define GPIO109_GPIO MFP_CFG_IN(GPIO109, AF0)
40#define GPIO110_GPIO MFP_CFG_IN(GPIO110, AF0)
41#define GPIO111_GPIO MFP_CFG_IN(GPIO111, AF0)
42#define GPIO112_GPIO MFP_CFG_IN(GPIO112, AF0)
43#define GPIO113_GPIO MFP_CFG_IN(GPIO113, AF0)
44#define GPIO114_GPIO MFP_CFG_IN(GPIO114, AF0)
45#define GPIO115_GPIO MFP_CFG_IN(GPIO115, AF0)
46#define GPIO116_GPIO MFP_CFG_IN(GPIO116, AF0)
47#define GPIO117_GPIO MFP_CFG_IN(GPIO117, AF0)
48#define GPIO118_GPIO MFP_CFG_IN(GPIO118, AF0)
49#define GPIO119_GPIO MFP_CFG_IN(GPIO119, AF0)
50#define GPIO120_GPIO MFP_CFG_IN(GPIO120, AF0)
51
52/* Crystal and Clock Signals */
53#define GPIO9_HZ_CLK MFP_CFG_OUT(GPIO9, AF1, DRIVE_LOW)
54#define GPIO10_HZ_CLK MFP_CFG_OUT(GPIO10, AF1, DRIVE_LOW)
55#define GPIO11_48_MHz MFP_CFG_OUT(GPIO11, AF3, DRIVE_LOW)
56#define GPIO12_48_MHz MFP_CFG_OUT(GPIO12, AF3, DRIVE_LOW)
57#define GPIO13_CLK_EXT MFP_CFG_IN(GPIO13, AF1)
58
59/* OS Timer Signals */
60#define GPIO11_EXT_SYNC_0 MFP_CFG_IN(GPIO11, AF1)
61#define GPIO12_EXT_SYNC_1 MFP_CFG_IN(GPIO12, AF1)
62#define GPIO9_CHOUT_0 MFP_CFG_OUT(GPIO9, AF3, DRIVE_LOW)
63#define GPIO10_CHOUT_1 MFP_CFG_OUT(GPIO10, AF3, DRIVE_LOW)
64#define GPIO11_CHOUT_0 MFP_CFG_OUT(GPIO11, AF1, DRIVE_LOW)
65#define GPIO12_CHOUT_1 MFP_CFG_OUT(GPIO12, AF1, DRIVE_LOW)
66
67/* SDRAM and Static Memory I/O Signals */
68#define GPIO20_nSDCS_2 MFP_CFG_OUT(GPIO20, AF1, DRIVE_HIGH)
69#define GPIO21_nSDCS_3 MFP_CFG_OUT(GPIO21, AF1, DRIVE_HIGH)
70#define GPIO15_nCS_1 MFP_CFG_OUT(GPIO15, AF2, DRIVE_HIGH)
71#define GPIO78_nCS_2 MFP_CFG_OUT(GPIO78, AF2, DRIVE_HIGH)
72#define GPIO79_nCS_3 MFP_CFG_OUT(GPIO79, AF2, DRIVE_HIGH)
73#define GPIO80_nCS_4 MFP_CFG_OUT(GPIO80, AF2, DRIVE_HIGH)
74#define GPIO33_nCS_5 MFP_CFG_OUT(GPIO33, AF2, DRIVE_HIGH)
75
76/* Miscellaneous I/O and DMA Signals */
77#define GPIO21_DVAL_0 MFP_CFG_OUT(GPIO21, AF2, DRIVE_HIGH)
78#define GPIO116_DVAL_0 MFP_CFG_OUT(GPIO116, AF1, DRIVE_HIGH)
79#define GPIO33_DVAL_1 MFP_CFG_OUT(GPIO33, AF1, DRIVE_HIGH)
80#define GPIO96_DVAL_1 MFP_CFG_OUT(GPIO96, AF2, DRIVE_HIGH)
81#define GPIO18_RDY MFP_CFG_IN(GPIO18, AF1)
82#define GPIO20_DREQ_0 MFP_CFG_IN(GPIO20, AF1)
83#define GPIO115_DREQ_0 MFP_CFG_IN(GPIO115, AF1)
84#define GPIO80_DREQ_1 MFP_CFG_IN(GPIO80, AF1)
85#define GPIO97_DREQ_1 MFP_CFG_IN(GPIO97, AF2)
86#define GPIO85_DREQ_2 MFP_CFG_IN(GPIO85, AF2)
87#define GPIO100_DREQ_2 MFP_CFG_IN(GPIO100, AF2)
88
89/* Alternate Bus Master Mode I/O Signals */
90#define GPIO20_MBREQ MFP_CFG_IN(GPIO20, AF2)
91#define GPIO80_MBREQ MFP_CFG_IN(GPIO80, AF2)
92#define GPIO96_MBREQ MFP_CFG_IN(GPIO96, AF2)
93#define GPIO115_MBREQ MFP_CFG_IN(GPIO115, AF3)
94#define GPIO21_MBGNT MFP_CFG_OUT(GPIO21, AF3, DRIVE_LOW)
95#define GPIO33_MBGNT MFP_CFG_OUT(GPIO33, AF3, DRIVE_LOW)
96#define GPIO97_MBGNT MFP_CFG_OUT(GPIO97, AF2, DRIVE_LOW)
97#define GPIO116_MBGNT MFP_CFG_OUT(GPIO116, AF3, DRIVE_LOW)
98
99/* PC CARD */
100#define GPIO15_nPCE_1 MFP_CFG_OUT(GPIO15, AF1, DRIVE_HIGH)
101#define GPIO85_nPCE_1 MFP_CFG_OUT(GPIO85, AF1, DRIVE_HIGH)
102#define GPIO86_nPCE_1 MFP_CFG_OUT(GPIO86, AF1, DRIVE_HIGH)
103#define GPIO102_nPCE_1 MFP_CFG_OUT(GPIO102, AF1, DRIVE_HIGH)
104#define GPIO54_nPCE_2 MFP_CFG_OUT(GPIO54, AF2, DRIVE_HIGH)
105#define GPIO78_nPCE_2 MFP_CFG_OUT(GPIO78, AF1, DRIVE_HIGH)
106#define GPIO87_nPCE_2 MFP_CFG_IN(GPIO87, AF1)
107#define GPIO55_nPREG MFP_CFG_OUT(GPIO55, AF2, DRIVE_HIGH)
108#define GPIO50_nPIOR MFP_CFG_OUT(GPIO50, AF2, DRIVE_HIGH)
109#define GPIO51_nPIOW MFP_CFG_OUT(GPIO51, AF2, DRIVE_HIGH)
110#define GPIO49_nPWE MFP_CFG_OUT(GPIO49, AF2, DRIVE_HIGH)
111#define GPIO48_nPOE MFP_CFG_OUT(GPIO48, AF2, DRIVE_HIGH)
112#define GPIO57_nIOIS16 MFP_CFG_IN(GPIO57, AF1)
113#define GPIO56_nPWAIT MFP_CFG_IN(GPIO56, AF1)
114#define GPIO79_PSKTSEL MFP_CFG_OUT(GPIO79, AF1, DRIVE_HIGH)
115
116/* I2C */
117#define GPIO117_I2C_SCL MFP_CFG_IN(GPIO117, AF1)
118#define GPIO118_I2C_SDA MFP_CFG_IN(GPIO118, AF1)
119
120/* FFUART */
121#define GPIO9_FFUART_CTS MFP_CFG_IN(GPIO9, AF3)
122#define GPIO26_FFUART_CTS MFP_CFG_IN(GPIO26, AF3)
123#define GPIO35_FFUART_CTS MFP_CFG_IN(GPIO35, AF1)
124#define GPIO100_FFUART_CTS MFP_CFG_IN(GPIO100, AF3)
125#define GPIO10_FFUART_DCD MFP_CFG_IN(GPIO10, AF1)
126#define GPIO36_FFUART_DCD MFP_CFG_IN(GPIO36, AF1)
127#define GPIO33_FFUART_DSR MFP_CFG_IN(GPIO33, AF2)
128#define GPIO37_FFUART_DSR MFP_CFG_IN(GPIO37, AF1)
129#define GPIO38_FFUART_RI MFP_CFG_IN(GPIO38, AF1)
130#define GPIO89_FFUART_RI MFP_CFG_IN(GPIO89, AF3)
131#define GPIO19_FFUART_RXD MFP_CFG_IN(GPIO19, AF3)
132#define GPIO33_FFUART_RXD MFP_CFG_IN(GPIO33, AF1)
133#define GPIO34_FFUART_RXD MFP_CFG_IN(GPIO34, AF1)
134#define GPIO41_FFUART_RXD MFP_CFG_IN(GPIO41, AF1)
135#define GPIO53_FFUART_RXD MFP_CFG_IN(GPIO53, AF1)
136#define GPIO85_FFUART_RXD MFP_CFG_IN(GPIO85, AF1)
137#define GPIO96_FFUART_RXD MFP_CFG_IN(GPIO96, AF3)
138#define GPIO102_FFUART_RXD MFP_CFG_IN(GPIO102, AF3)
139#define GPIO16_FFUART_TXD MFP_CFG_OUT(GPIO16, AF3, DRIVE_HIGH)
140#define GPIO37_FFUART_TXD MFP_CFG_OUT(GPIO37, AF3, DRIVE_HIGH)
141#define GPIO39_FFUART_TXD MFP_CFG_OUT(GPIO39, AF2, DRIVE_HIGH)
142#define GPIO83_FFUART_TXD MFP_CFG_OUT(GPIO83, AF2, DRIVE_HIGH)
143#define GPIO99_FFUART_TXD MFP_CFG_OUT(GPIO99, AF3, DRIVE_HIGH)
144#define GPIO27_FFUART_RTS MFP_CFG_OUT(GPIO27, AF3, DRIVE_HIGH)
145#define GPIO41_FFUART_RTS MFP_CFG_OUT(GPIO41, AF2, DRIVE_HIGH)
146#define GPIO83_FFUART_RTS MFP_CFG_OUT(GPIO83, AF3, DRIVE_HIGH)
147#define GPIO98_FFUART_RTS MFP_CFG_OUT(GPIO98, AF3, DRIVE_HIGH)
148#define GPIO40_FFUART_DTR MFP_CFG_OUT(GPIO40, AF2, DRIVE_HIGH)
149#define GPIO82_FFUART_DTR MFP_CFG_OUT(GPIO82, AF3, DRIVE_HIGH)
150
151/* BTUART */
152#define GPIO44_BTUART_CTS MFP_CFG_IN(GPIO44, AF1)
153#define GPIO42_BTUART_RXD MFP_CFG_IN(GPIO42, AF1)
154#define GPIO45_BTUART_RTS MFP_CFG_OUT(GPIO45, AF2, DRIVE_HIGH)
155#define GPIO43_BTUART_TXD MFP_CFG_OUT(GPIO43, AF2, DRIVE_HIGH)
156
157/* STUART */
158#define GPIO46_STUART_RXD MFP_CFG_IN(GPIO46, AF2)
159#define GPIO47_STUART_TXD MFP_CFG_OUT(GPIO47, AF1, DRIVE_HIGH)
160
161/* FICP */
162#define GPIO42_FICP_RXD MFP_CFG_IN(GPIO42, AF2)
163#define GPIO46_FICP_RXD MFP_CFG_IN(GPIO46, AF1)
164#define GPIO43_FICP_TXD MFP_CFG_OUT(GPIO43, AF1, DRIVE_HIGH)
165#define GPIO47_FICP_TXD MFP_CFG_OUT(GPIO47, AF2, DRIVE_HIGH)
166
167/* PWM 0/1/2/3 */
168#define GPIO11_PWM2_OUT MFP_CFG_OUT(GPIO11, AF2, DRIVE_LOW)
169#define GPIO12_PWM3_OUT MFP_CFG_OUT(GPIO12, AF2, DRIVE_LOW)
170#define GPIO16_PWM0_OUT MFP_CFG_OUT(GPIO16, AF2, DRIVE_LOW)
171#define GPIO17_PWM1_OUT MFP_CFG_OUT(GPIO17, AF2, DRIVE_LOW)
172#define GPIO38_PWM1_OUT MFP_CFG_OUT(GPIO38, AF3, DRIVE_LOW)
173#define GPIO46_PWM2_OUT MFP_CFG_OUT(GPIO46, AF2, DRIVE_LOW)
174#define GPIO47_PWM3_OUT MFP_CFG_OUT(GPIO47, AF3, DRIVE_LOW)
175#define GPIO79_PWM2_OUT MFP_CFG_OUT(GPIO79, AF3, DRIVE_LOW)
176#define GPIO80_PWM3_OUT MFP_CFG_OUT(GPIO80, AF3, DRIVE_LOW)
177#define GPIO115_PWM1_OUT MFP_CFG_OUT(GPIO115, AF3, DRIVE_LOW)
178
179/* AC97 */
180#define GPIO31_AC97_SYNC MFP_CFG_OUT(GPIO31, AF2, DRIVE_LOW)
181#define GPIO94_AC97_SYNC MFP_CFG_OUT(GPIO94, AF1, DRIVE_LOW)
182#define GPIO30_AC97_SDATA_OUT MFP_CFG_OUT(GPIO30, AF2, DRIVE_LOW)
183#define GPIO93_AC97_SDATA_OUT MFP_CFG_OUT(GPIO93, AF1, DRIVE_LOW)
184#define GPIO45_AC97_SYSCLK MFP_CFG_OUT(GPIO45, AF1, DRIVE_LOW)
185#define GPIO89_AC97_SYSCLK MFP_CFG_OUT(GPIO89, AF1, DRIVE_LOW)
186#define GPIO98_AC97_SYSCLK MFP_CFG_OUT(GPIO98, AF1, DRIVE_LOW)
187#define GPIO95_AC97_nRESET MFP_CFG_OUT(GPIO95, AF1, DRIVE_LOW)
188#define GPIO113_AC97_nRESET MFP_CFG_OUT(GPIO113, AF2, DRIVE_LOW)
189#define GPIO28_AC97_BITCLK MFP_CFG_IN(GPIO28, AF1)
190#define GPIO29_AC97_SDATA_IN_0 MFP_CFG_IN(GPIO29, AF1)
191#define GPIO116_AC97_SDATA_IN_0 MFP_CFG_IN(GPIO116, AF2)
192#define GPIO99_AC97_SDATA_IN_1 MFP_CFG_IN(GPIO99, AF2)
193
194/* I2S */
195#define GPIO28_I2S_BITCLK_IN MFP_CFG_IN(GPIO28, AF2)
196#define GPIO28_I2S_BITCLK_OUT MFP_CFG_OUT(GPIO28, AF1, DRIVE_LOW)
197#define GPIO29_I2S_SDATA_IN MFP_CFG_IN(GPIO29, AF2)
198#define GPIO30_I2S_SDATA_OUT MFP_CFG_OUT(GPIO30, AF1, DRIVE_LOW)
199#define GPIO31_I2S_SYNC MFP_CFG_OUT(GPIO31, AF1, DRIVE_LOW)
200#define GPIO113_I2S_SYSCLK MFP_CFG_OUT(GPIO113, AF1, DRIVE_LOW)
201
202/* SSP 1 */
203#define GPIO23_SSP1_SCLK MFP_CFG_OUT(GPIO23, AF2, DRIVE_LOW)
204#define GPIO29_SSP1_SCLK MFP_CFG_IN(GPIO29, AF3)
205#define GPIO27_SSP1_SYSCLK MFP_CFG_OUT(GPIO27, AF1, DRIVE_LOW)
206#define GPIO53_SSP1_SYSCLK MFP_CFG_OUT(GPIO53, AF3, DRIVE_LOW)
207#define GPIO24_SSP1_SFRM MFP_CFG_IN(GPIO24, AF2)
208#define GPIO28_SSP1_SFRM MFP_CFG_IN(GPIO28, AF3)
209#define GPIO25_SSP1_TXD MFP_CFG_OUT(GPIO25, AF2, DRIVE_LOW)
210#define GPIO57_SSP1_TXD MFP_CFG_OUT(GPIO57, AF3, DRIVE_LOW)
211#define GPIO26_SSP1_RXD MFP_CFG_IN(GPIO26, AF1)
212#define GPIO27_SSP1_SCLKEN MFP_CFG_IN(GPIO27, AF2)
213
214/* SSP 2 */
215#define GPIO19_SSP2_SCLK MFP_CFG_IN(GPIO19, AF1)
216#define GPIO22_SSP2_SCLK MFP_CFG_IN(GPIO22, AF3)
217#define GPIO29_SSP2_SCLK MFP_CFG_OUT(GPIO29, AF3, DRIVE_LOW)
218#define GPIO36_SSP2_SCLK MFP_CFG_IN(GPIO36, AF2)
219#define GPIO50_SSP2_SCLK MFP_CFG_IN(GPIO50, AF3)
220#define GPIO22_SSP2_SYSCLK MFP_CFG_OUT(GPIO22, AF2, DRIVE_LOW)
221#define GPIO14_SSP2_SFRM MFP_CFG_IN(GPIO14, AF2)
222#define GPIO37_SSP2_SFRM MFP_CFG_IN(GPIO37, AF2)
223#define GPIO87_SSP2_SFRM MFP_CFG_OUT(GPIO87, AF3, DRIVE_LOW)
224#define GPIO88_SSP2_SFRM MFP_CFG_IN(GPIO88, AF3)
225#define GPIO13_SSP2_TXD MFP_CFG_OUT(GPIO13, AF1, DRIVE_LOW)
226#define GPIO38_SSP2_TXD MFP_CFG_OUT(GPIO38, AF2, DRIVE_LOW)
227#define GPIO87_SSP2_TXD MFP_CFG_OUT(GPIO87, AF1, DRIVE_LOW)
228#define GPIO89_SSP2_TXD MFP_CFG_OUT(GPIO89, AF3, DRIVE_LOW)
229#define GPIO11_SSP2_RXD MFP_CFG_IN(GPIO11, AF2)
230#define GPIO29_SSP2_RXD MFP_CFG_OUT(GPIO29, AF1, DRIVE_LOW)
231#define GPIO40_SSP2_RXD MFP_CFG_IN(GPIO40, AF1)
232#define GPIO86_SSP2_RXD MFP_CFG_IN(GPIO86, AF1)
233#define GPIO88_SSP2_RXD MFP_CFG_IN(GPIO88, AF2)
234#define GPIO22_SSP2_EXTCLK MFP_CFG_IN(GPIO22, AF1)
235#define GPIO27_SSP2_EXTCLK MFP_CFG_IN(GPIO27, AF1)
236#define GPIO22_SSP2_SCLKEN MFP_CFG_IN(GPIO22, AF2)
237#define GPIO23_SSP2_SCLKEN MFP_CFG_IN(GPIO23, AF2)
238
239/* SSP 3 */
240#define GPIO34_SSP3_SCLK MFP_CFG_IN(GPIO34, AF3)
241#define GPIO40_SSP3_SCLK MFP_CFG_OUT(GPIO40, AF3, DRIVE_LOW)
242#define GPIO52_SSP3_SCLK MFP_CFG_IN(GPIO52, AF2)
243#define GPIO84_SSP3_SCLK MFP_CFG_IN(GPIO84, AF1)
244#define GPIO45_SSP3_SYSCLK MFP_CFG_OUT(GPIO45, AF3, DRIVE_LOW)
245#define GPIO35_SSP3_SFRM MFP_CFG_IN(GPIO35, AF3)
246#define GPIO39_SSP3_SFRM MFP_CFG_IN(GPIO39, AF3)
247#define GPIO83_SSP3_SFRM MFP_CFG_IN(GPIO83, AF1)
248#define GPIO35_SSP3_TXD MFP_CFG_OUT(GPIO35, AF3, DRIVE_LOW)
249#define GPIO38_SSP3_TXD MFP_CFG_OUT(GPIO38, AF1, DRIVE_LOW)
250#define GPIO81_SSP3_TXD MFP_CFG_OUT(GPIO81, AF1, DRIVE_LOW)
251#define GPIO41_SSP3_RXD MFP_CFG_IN(GPIO41, AF3)
252#define GPIO82_SSP3_RXD MFP_CFG_IN(GPIO82, AF1)
253#define GPIO89_SSP3_RXD MFP_CFG_IN(GPIO89, AF1)
254
255/* MMC */
256#define GPIO32_MMC_CLK MFP_CFG_OUT(GPIO32, AF2, DRIVE_LOW)
257#define GPIO92_MMC_DAT_0 MFP_CFG_IN(GPIO92, AF1)
258#define GPIO109_MMC_DAT_1 MFP_CFG_IN(GPIO109, AF1)
259#define GPIO110_MMC_DAT_2 MFP_CFG_IN(GPIO110, AF1)
260#define GPIO111_MMC_DAT_3 MFP_CFG_IN(GPIO111, AF1)
261#define GPIO112_MMC_CMD MFP_CFG_IN(GPIO112, AF1)
262
263/* LCD */
264#define GPIO58_LCD_LDD_0 MFP_CFG_OUT(GPIO58, AF2, DRIVE_LOW)
265#define GPIO59_LCD_LDD_1 MFP_CFG_OUT(GPIO59, AF2, DRIVE_LOW)
266#define GPIO60_LCD_LDD_2 MFP_CFG_OUT(GPIO60, AF2, DRIVE_LOW)
267#define GPIO61_LCD_LDD_3 MFP_CFG_OUT(GPIO61, AF2, DRIVE_LOW)
268#define GPIO62_LCD_LDD_4 MFP_CFG_OUT(GPIO62, AF2, DRIVE_LOW)
269#define GPIO63_LCD_LDD_5 MFP_CFG_OUT(GPIO63, AF2, DRIVE_LOW)
270#define GPIO64_LCD_LDD_6 MFP_CFG_OUT(GPIO64, AF2, DRIVE_LOW)
271#define GPIO65_LCD_LDD_7 MFP_CFG_OUT(GPIO65, AF2, DRIVE_LOW)
272#define GPIO66_LCD_LDD_8 MFP_CFG_OUT(GPIO66, AF2, DRIVE_LOW)
273#define GPIO67_LCD_LDD_9 MFP_CFG_OUT(GPIO67, AF2, DRIVE_LOW)
274#define GPIO68_LCD_LDD_10 MFP_CFG_OUT(GPIO68, AF2, DRIVE_LOW)
275#define GPIO69_LCD_LDD_11 MFP_CFG_OUT(GPIO69, AF2, DRIVE_LOW)
276#define GPIO70_LCD_LDD_12 MFP_CFG_OUT(GPIO70, AF2, DRIVE_LOW)
277#define GPIO71_LCD_LDD_13 MFP_CFG_OUT(GPIO71, AF2, DRIVE_LOW)
278#define GPIO72_LCD_LDD_14 MFP_CFG_OUT(GPIO72, AF2, DRIVE_LOW)
279#define GPIO73_LCD_LDD_15 MFP_CFG_OUT(GPIO73, AF2, DRIVE_LOW)
280#define GPIO86_LCD_LDD_16 MFP_CFG_OUT(GPIO86, AF2, DRIVE_LOW)
281#define GPIO87_LCD_LDD_17 MFP_CFG_OUT(GPIO87, AF2, DRIVE_LOW)
282#define GPIO74_LCD_FCLK MFP_CFG_OUT(GPIO74, AF2, DRIVE_LOW)
283#define GPIO75_LCD_LCLK MFP_CFG_OUT(GPIO75, AF2, DRIVE_LOW)
284#define GPIO76_LCD_PCLK MFP_CFG_OUT(GPIO76, AF2, DRIVE_LOW)
285#define GPIO77_LCD_BIAS MFP_CFG_OUT(GPIO77, AF2, DRIVE_LOW)
286#define GPIO14_LCD_VSYNC MFP_CFG_IN(GPIO14, AF1)
287#define GPIO19_LCD_CS MFP_CFG_OUT(GPIO19, AF2, DRIVE_LOW)
288
289/* Keypad */
290#define GPIO93_KP_DKIN_0 MFP_CFG_IN(GPIO93, AF1)
291#define GPIO94_KP_DKIN_1 MFP_CFG_IN(GPIO94, AF1)
292#define GPIO95_KP_DKIN_2 MFP_CFG_IN(GPIO95, AF1)
293#define GPIO96_KP_DKIN_3 MFP_CFG_IN(GPIO96, AF1)
294#define GPIO97_KP_DKIN_4 MFP_CFG_IN(GPIO97, AF1)
295#define GPIO98_KP_DKIN_5 MFP_CFG_IN(GPIO98, AF1)
296#define GPIO99_KP_DKIN_6 MFP_CFG_IN(GPIO99, AF1)
297#define GPIO13_KP_KDIN_7 MFP_CFG_IN(GPIO13, AF2)
298#define GPIO100_KP_MKIN_0 MFP_CFG_IN(GPIO100, AF1)
299#define GPIO101_KP_MKIN_1 MFP_CFG_IN(GPIO101, AF1)
300#define GPIO102_KP_MKIN_2 MFP_CFG_IN(GPIO102, AF1)
301#define GPIO34_KP_MKIN_3 MFP_CFG_IN(GPIO34, AF2)
302#define GPIO37_KP_MKIN_3 MFP_CFG_IN(GPIO37, AF3)
303#define GPIO97_KP_MKIN_3 MFP_CFG_IN(GPIO97, AF3)
304#define GPIO98_KP_MKIN_4 MFP_CFG_IN(GPIO98, AF3)
305#define GPIO38_KP_MKIN_4 MFP_CFG_IN(GPIO38, AF2)
306#define GPIO39_KP_MKIN_4 MFP_CFG_IN(GPIO39, AF1)
307#define GPIO16_KP_MKIN_5 MFP_CFG_IN(GPIO16, AF1)
308#define GPIO90_KP_MKIN_5 MFP_CFG_IN(GPIO90, AF1)
309#define GPIO99_KP_MKIN_5 MFP_CFG_IN(GPIO99, AF3)
310#define GPIO17_KP_MKIN_6 MFP_CFG_IN(GPIO17, AF1)
311#define GPIO91_KP_MKIN_6 MFP_CFG_IN(GPIO91, AF1)
312#define GPIO95_KP_MKIN_6 MFP_CFG_IN(GPIO95, AF3)
313#define GPIO13_KP_MKIN_7 MFP_CFG_IN(GPIO13, AF3)
314#define GPIO36_KP_MKIN_7 MFP_CFG_IN(GPIO36, AF3)
315#define GPIO103_KP_MKOUT_0 MFP_CFG_OUT(GPIO103, AF2, DRIVE_HIGH)
316#define GPIO104_KP_MKOUT_1 MFP_CFG_OUT(GPIO104, AF2, DRIVE_HIGH)
317#define GPIO105_KP_MKOUT_2 MFP_CFG_OUT(GPIO105, AF2, DRIVE_HIGH)
318#define GPIO106_KP_MKOUT_3 MFP_CFG_OUT(GPIO106, AF2, DRIVE_HIGH)
319#define GPIO107_KP_MKOUT_4 MFP_CFG_OUT(GPIO107, AF2, DRIVE_HIGH)
320#define GPIO108_KP_MKOUT_5 MFP_CFG_OUT(GPIO108, AF2, DRIVE_HIGH)
321#define GPIO35_KP_MKOUT_6 MFP_CFG_OUT(GPIO35, AF2, DRIVE_HIGH)
322#define GPIO22_KP_MKOUT_7 MFP_CFG_OUT(GPIO22, AF1, DRIVE_HIGH)
323#define GPIO40_KP_MKOUT_6 MFP_CFG_OUT(GPIO40, AF1, DRIVE_HIGH)
324#define GPIO41_KP_MKOUT_7 MFP_CFG_OUT(GPIO41, AF1, DRIVE_HIGH)
325#define GPIO96_KP_MKOUT_6 MFP_CFG_OUT(GPIO96, AF3, DRIVE_HIGH)
326
327/* USB P3 */
328#define GPIO10_USB_P3_5 MFP_CFG_IN(GPIO10, AF3)
329#define GPIO11_USB_P3_1 MFP_CFG_IN(GPIO11, AF3)
330#define GPIO30_USB_P3_2 MFP_CFG_OUT(GPIO30, AF3, DRIVE_LOW)
331#define GPIO31_USB_P3_6 MFP_CFG_OUT(GPIO31, AF3, DRIVE_LOW)
332#define GPIO56_USB_P3_4 MFP_CFG_OUT(GPIO56, AF1, DRIVE_LOW)
333#define GPIO86_USB_P3_5 MFP_CFG_IN(GPIO86, AF3)
334#define GPIO87_USB_P3_1 MFP_CFG_IN(GPIO87, AF3)
335#define GPIO90_USB_P3_5 MFP_CFG_IN(GPIO90, AF2)
336#define GPIO91_USB_P3_1 MFP_CFG_IN(GPIO91, AF2)
337#define GPIO113_USB_P3_3 MFP_CFG_IN(GPIO113, AF3)
338
339/* USB P2 */
340#define GPIO34_USB_P2_2 MFP_CFG_OUT(GPIO34, AF1, DRIVE_LOW)
341#define GPIO35_USB_P2_1 MFP_CFG_IN(GPIO35, AF2)
342#define GPIO36_USB_P2_4 MFP_CFG_OUT(GPIO36, AF1, DRIVE_LOW)
343#define GPIO37_USB_P2_8 MFP_CFG_OUT(GPIO37, AF1, DRIVE_LOW)
344#define GPIO38_USB_P2_3 MFP_CFG_IN(GPIO38, AF3)
345#define GPIO39_USB_P2_6 MFP_CFG_OUT(GPIO39, AF1, DRIVE_LOW)
346#define GPIO40_USB_P2_5 MFP_CFG_IN(GPIO40, AF3)
347#define GPIO41_USB_P2_7 MFP_CFG_IN(GPIO41, AF2)
348#define GPIO53_USB_P2_3 MFP_CFG_IN(GPIO53, AF2)
349
350/* USB Host Port 1/2 */
351#define GPIO88_USBH1_PWR MFP_CFG_IN(GPIO88, AF1)
352#define GPIO89_USBH1_PEN MFP_CFG_OUT(GPIO89, AF2, DRIVE_LOW)
353#define GPIO119_USBH2_PWR MFP_CFG_IN(GPIO119, AF1)
354#define GPIO120_USBH2_PEN MFP_CFG_OUT(GPIO120, AF2, DRIVE_LOW)
355
356/* QCI - default to Master Mode: CIF_FV/CIF_LV Direction In */
357#define GPIO115_CIF_DD_3 MFP_CFG_IN(GPIO115, AF2)
358#define GPIO116_CIF_DD_2 MFP_CFG_IN(GPIO116, AF1)
359#define GPIO12_CIF_DD_7 MFP_CFG_IN(GPIO12, AF2)
360#define GPIO17_CIF_DD_6 MFP_CFG_IN(GPIO17, AF2)
361#define GPIO23_CIF_MCLK MFP_CFG_OUT(GPIO23, AF1, DRIVE_LOW)
362#define GPIO24_CIF_FV MFP_CFG_IN(GPIO24, AF1)
363#define GPIO25_CIF_LV MFP_CFG_IN(GPIO25, AF1)
364#define GPIO26_CIF_PCLK MFP_CFG_IN(GPIO26, AF2)
365#define GPIO27_CIF_DD_0 MFP_CFG_IN(GPIO27, AF3)
366#define GPIO42_CIF_MCLK MFP_CFG_OUT(GPIO42, AF3, DRIVE_LOW)
367#define GPIO43_CIF_FV MFP_CFG_IN(GPIO43, AF3)
368#define GPIO44_CIF_LV MFP_CFG_IN(GPIO44, AF3)
369#define GPIO45_CIF_PCLK MFP_CFG_IN(GPIO45, AF3)
370#define GPIO47_CIF_DD_0 MFP_CFG_IN(GPIO47, AF1)
371#define GPIO48_CIF_DD_5 MFP_CFG_IN(GPIO48, AF1)
372#define GPIO50_CIF_DD_3 MFP_CFG_IN(GPIO50, AF1)
373#define GPIO51_CIF_DD_2 MFP_CFG_IN(GPIO51, AF1)
374#define GPIO52_CIF_DD_4 MFP_CFG_IN(GPIO52, AF1)
375#define GPIO53_CIF_MCLK MFP_CFG_OUT(GPIO53, AF2, DRIVE_LOW)
376#define GPIO54_CIF_PCLK MFP_CFG_IN(GPIO54, AF3)
377#define GPIO55_CIF_DD_1 MFP_CFG_IN(GPIO55, AF1)
378#define GPIO81_CIF_DD_0 MFP_CFG_IN(GPIO81, AF2)
379#define GPIO82_CIF_DD_5 MFP_CFG_IN(GPIO82, AF3)
380#define GPIO83_CIF_DD_4 MFP_CFG_IN(GPIO83, AF3)
381#define GPIO84_CIF_FV MFP_CFG_IN(GPIO84, AF3)
382#define GPIO85_CIF_LV MFP_CFG_IN(GPIO85, AF3)
383#define GPIO90_CIF_DD_4 MFP_CFG_IN(GPIO90, AF3)
384#define GPIO91_CIF_DD_5 MFP_CFG_IN(GPIO91, AF3)
385#define GPIO93_CIF_DD_6 MFP_CFG_IN(GPIO93, AF2)
386#define GPIO94_CIF_DD_5 MFP_CFG_IN(GPIO94, AF2)
387#define GPIO95_CIF_DD_4 MFP_CFG_IN(GPIO95, AF2)
388#define GPIO98_CIF_DD_0 MFP_CFG_IN(GPIO98, AF2)
389#define GPIO103_CIF_DD_3 MFP_CFG_IN(GPIO103, AF1)
390#define GPIO104_CIF_DD_2 MFP_CFG_IN(GPIO104, AF1)
391#define GPIO105_CIF_DD_1 MFP_CFG_IN(GPIO105, AF1)
392#define GPIO106_CIF_DD_9 MFP_CFG_IN(GPIO106, AF1)
393#define GPIO107_CIF_DD_8 MFP_CFG_IN(GPIO107, AF1)
394#define GPIO108_CIF_DD_7 MFP_CFG_IN(GPIO108, AF1)
395#define GPIO114_CIF_DD_1 MFP_CFG_IN(GPIO114, AF1)
396
397/* Universal Subscriber ID Interface */
398#define GPIO114_UVS0 MFP_CFG_OUT(GPIO114, AF2, DRIVE_LOW)
399#define GPIO115_nUVS1 MFP_CFG_OUT(GPIO115, AF2, DRIVE_LOW)
400#define GPIO116_nUVS2 MFP_CFG_OUT(GPIO116, AF2, DRIVE_LOW)
401#define GPIO14_UCLK MFP_CFG_OUT(GPIO14, AF3, DRIVE_LOW)
402#define GPIO91_UCLK MFP_CFG_OUT(GPIO91, AF2, DRIVE_LOW)
403#define GPIO19_nURST MFP_CFG_OUT(GPIO19, AF3, DRIVE_LOW)
404#define GPIO90_nURST MFP_CFG_OUT(GPIO90, AF2, DRIVE_LOW)
405#define GPIO116_UDET MFP_CFG_IN(GPIO116, AF3)
406#define GPIO114_UEN MFP_CFG_OUT(GPIO114, AF1, DRIVE_LOW)
407#define GPIO115_UEN MFP_CFG_OUT(GPIO115, AF1, DRIVE_LOW)
408
409/* Mobile Scalable Link (MSL) Interface */
410#define GPIO81_BB_OB_DAT_0 MFP_CFG_OUT(GPIO81, AF2, DRIVE_LOW)
411#define GPIO48_BB_OB_DAT_1 MFP_CFG_OUT(GPIO48, AF1, DRIVE_LOW)
412#define GPIO50_BB_OB_DAT_2 MFP_CFG_OUT(GPIO50, AF1, DRIVE_LOW)
413#define GPIO51_BB_OB_DAT_3 MFP_CFG_OUT(GPIO51, AF1, DRIVE_LOW)
414#define GPIO52_BB_OB_CLK MFP_CFG_OUT(GPIO52, AF1, DRIVE_LOW)
415#define GPIO53_BB_OB_STB MFP_CFG_OUT(GPIO53, AF1, DRIVE_LOW)
416#define GPIO54_BB_OB_WAIT MFP_CFG_IN(GPIO54, AF2)
417#define GPIO82_BB_IB_DAT_0 MFP_CFG_IN(GPIO82, AF2)
418#define GPIO55_BB_IB_DAT_1 MFP_CFG_IN(GPIO55, AF2)
419#define GPIO56_BB_IB_DAT_2 MFP_CFG_IN(GPIO56, AF2)
420#define GPIO57_BB_IB_DAT_3 MFP_CFG_IN(GPIO57, AF2)
421#define GPIO83_BB_IB_CLK MFP_CFG_IN(GPIO83, AF2)
422#define GPIO84_BB_IB_STB MFP_CFG_IN(GPIO84, AF2)
423#define GPIO85_BB_IB_WAIT MFP_CFG_OUT(GPIO85, AF2, DRIVE_LOW)
424
425/* Memory Stick Host Controller */
426#define GPIO92_MSBS MFP_CFG_OUT(GPIO92, AF2, DRIVE_LOW)
427#define GPIO109_MSSDIO MFP_CFG_IN(GPIO109, AF2)
428#define GPIO112_nMSINS MFP_CFG_IN(GPIO112, AF2)
429#define GPIO32_MSSCLK MFP_CFG_OUT(GPIO32, AF1, DRIVE_LOW)
430
431extern int keypad_set_wake(unsigned int on);
432#endif /* __ASM_ARCH_MFP_PXA27X_H */
diff --git a/include/asm-arm/arch-pxa/mfp-pxa2xx.h b/include/asm-arm/arch-pxa/mfp-pxa2xx.h
new file mode 100644
index 000000000000..db8d890d237c
--- /dev/null
+++ b/include/asm-arm/arch-pxa/mfp-pxa2xx.h
@@ -0,0 +1,132 @@
1#ifndef __ASM_ARCH_MFP_PXA2XX_H
2#define __ASM_ARCH_MFP_PXA2XX_H
3
4#include <asm/arch/mfp.h>
5
6/*
7 * the following MFP_xxx bit definitions in mfp.h are re-used for pxa2xx:
8 *
9 * MFP_PIN(x)
10 * MFP_AFx
11 * MFP_LPM_DRIVE_{LOW, HIGH}
12 * MFP_LPM_EDGE_x
13 *
14 * other MFP_x bit definitions will be ignored
15 *
16 * and adds the below two bits specifically for pxa2xx:
17 *
18 * bit 23 - Input/Output (PXA2xx specific)
19 * bit 24 - Wakeup Enable(PXA2xx specific)
20 */
21
22#define MFP_DIR_IN (0x0 << 23)
23#define MFP_DIR_OUT (0x1 << 23)
24#define MFP_DIR_MASK (0x1 << 23)
25#define MFP_DIR(x) (((x) >> 23) & 0x1)
26
27#define MFP_LPM_CAN_WAKEUP (0x1 << 24)
28#define WAKEUP_ON_EDGE_RISE (MFP_LPM_CAN_WAKEUP | MFP_LPM_EDGE_RISE)
29#define WAKEUP_ON_EDGE_FALL (MFP_LPM_CAN_WAKEUP | MFP_LPM_EDGE_FALL)
30#define WAKEUP_ON_EDGE_BOTH (MFP_LPM_CAN_WAKEUP | MFP_LPM_EDGE_BOTH)
31
32/* specifically for enabling wakeup on keypad GPIOs */
33#define WAKEUP_ON_LEVEL_HIGH (MFP_LPM_CAN_WAKEUP)
34
35#define MFP_CFG_IN(pin, af) \
36 ((MFP_CFG_DEFAULT & ~(MFP_AF_MASK | MFP_DIR_MASK)) |\
37 (MFP_PIN(MFP_PIN_##pin) | MFP_##af | MFP_DIR_IN))
38
39/* NOTE: pins configured as output _must_ provide a low power state,
40 * and this state should help to minimize the power dissipation.
41 */
42#define MFP_CFG_OUT(pin, af, state) \
43 ((MFP_CFG_DEFAULT & ~(MFP_AF_MASK | MFP_DIR_MASK | MFP_LPM_STATE_MASK)) |\
44 (MFP_PIN(MFP_PIN_##pin) | MFP_##af | MFP_DIR_OUT | MFP_LPM_##state))
45
46/* Common configurations for pxa25x and pxa27x
47 *
48 * Note: pins configured as GPIO are always initialized to input
49 * so not to cause any side effect
50 */
51#define GPIO0_GPIO MFP_CFG_IN(GPIO0, AF0)
52#define GPIO1_GPIO MFP_CFG_IN(GPIO1, AF0)
53#define GPIO9_GPIO MFP_CFG_IN(GPIO9, AF0)
54#define GPIO10_GPIO MFP_CFG_IN(GPIO10, AF0)
55#define GPIO11_GPIO MFP_CFG_IN(GPIO11, AF0)
56#define GPIO12_GPIO MFP_CFG_IN(GPIO12, AF0)
57#define GPIO13_GPIO MFP_CFG_IN(GPIO13, AF0)
58#define GPIO14_GPIO MFP_CFG_IN(GPIO14, AF0)
59#define GPIO15_GPIO MFP_CFG_IN(GPIO15, AF0)
60#define GPIO16_GPIO MFP_CFG_IN(GPIO16, AF0)
61#define GPIO17_GPIO MFP_CFG_IN(GPIO17, AF0)
62#define GPIO18_GPIO MFP_CFG_IN(GPIO18, AF0)
63#define GPIO19_GPIO MFP_CFG_IN(GPIO19, AF0)
64#define GPIO20_GPIO MFP_CFG_IN(GPIO20, AF0)
65#define GPIO21_GPIO MFP_CFG_IN(GPIO21, AF0)
66#define GPIO22_GPIO MFP_CFG_IN(GPIO22, AF0)
67#define GPIO23_GPIO MFP_CFG_IN(GPIO23, AF0)
68#define GPIO24_GPIO MFP_CFG_IN(GPIO24, AF0)
69#define GPIO25_GPIO MFP_CFG_IN(GPIO25, AF0)
70#define GPIO26_GPIO MFP_CFG_IN(GPIO26, AF0)
71#define GPIO27_GPIO MFP_CFG_IN(GPIO27, AF0)
72#define GPIO28_GPIO MFP_CFG_IN(GPIO28, AF0)
73#define GPIO29_GPIO MFP_CFG_IN(GPIO29, AF0)
74#define GPIO30_GPIO MFP_CFG_IN(GPIO30, AF0)
75#define GPIO31_GPIO MFP_CFG_IN(GPIO31, AF0)
76#define GPIO32_GPIO MFP_CFG_IN(GPIO32, AF0)
77#define GPIO33_GPIO MFP_CFG_IN(GPIO33, AF0)
78#define GPIO34_GPIO MFP_CFG_IN(GPIO34, AF0)
79#define GPIO35_GPIO MFP_CFG_IN(GPIO35, AF0)
80#define GPIO36_GPIO MFP_CFG_IN(GPIO36, AF0)
81#define GPIO37_GPIO MFP_CFG_IN(GPIO37, AF0)
82#define GPIO38_GPIO MFP_CFG_IN(GPIO38, AF0)
83#define GPIO39_GPIO MFP_CFG_IN(GPIO39, AF0)
84#define GPIO40_GPIO MFP_CFG_IN(GPIO40, AF0)
85#define GPIO41_GPIO MFP_CFG_IN(GPIO41, AF0)
86#define GPIO42_GPIO MFP_CFG_IN(GPIO42, AF0)
87#define GPIO43_GPIO MFP_CFG_IN(GPIO43, AF0)
88#define GPIO44_GPIO MFP_CFG_IN(GPIO44, AF0)
89#define GPIO45_GPIO MFP_CFG_IN(GPIO45, AF0)
90#define GPIO46_GPIO MFP_CFG_IN(GPIO46, AF0)
91#define GPIO47_GPIO MFP_CFG_IN(GPIO47, AF0)
92#define GPIO48_GPIO MFP_CFG_IN(GPIO48, AF0)
93#define GPIO49_GPIO MFP_CFG_IN(GPIO49, AF0)
94#define GPIO50_GPIO MFP_CFG_IN(GPIO50, AF0)
95#define GPIO51_GPIO MFP_CFG_IN(GPIO51, AF0)
96#define GPIO52_GPIO MFP_CFG_IN(GPIO52, AF0)
97#define GPIO53_GPIO MFP_CFG_IN(GPIO53, AF0)
98#define GPIO54_GPIO MFP_CFG_IN(GPIO54, AF0)
99#define GPIO55_GPIO MFP_CFG_IN(GPIO55, AF0)
100#define GPIO56_GPIO MFP_CFG_IN(GPIO56, AF0)
101#define GPIO57_GPIO MFP_CFG_IN(GPIO57, AF0)
102#define GPIO58_GPIO MFP_CFG_IN(GPIO58, AF0)
103#define GPIO59_GPIO MFP_CFG_IN(GPIO59, AF0)
104#define GPIO60_GPIO MFP_CFG_IN(GPIO60, AF0)
105#define GPIO61_GPIO MFP_CFG_IN(GPIO61, AF0)
106#define GPIO62_GPIO MFP_CFG_IN(GPIO62, AF0)
107#define GPIO63_GPIO MFP_CFG_IN(GPIO63, AF0)
108#define GPIO64_GPIO MFP_CFG_IN(GPIO64, AF0)
109#define GPIO65_GPIO MFP_CFG_IN(GPIO65, AF0)
110#define GPIO66_GPIO MFP_CFG_IN(GPIO66, AF0)
111#define GPIO67_GPIO MFP_CFG_IN(GPIO67, AF0)
112#define GPIO68_GPIO MFP_CFG_IN(GPIO68, AF0)
113#define GPIO69_GPIO MFP_CFG_IN(GPIO69, AF0)
114#define GPIO70_GPIO MFP_CFG_IN(GPIO70, AF0)
115#define GPIO71_GPIO MFP_CFG_IN(GPIO71, AF0)
116#define GPIO72_GPIO MFP_CFG_IN(GPIO72, AF0)
117#define GPIO73_GPIO MFP_CFG_IN(GPIO73, AF0)
118#define GPIO74_GPIO MFP_CFG_IN(GPIO74, AF0)
119#define GPIO75_GPIO MFP_CFG_IN(GPIO75, AF0)
120#define GPIO76_GPIO MFP_CFG_IN(GPIO76, AF0)
121#define GPIO77_GPIO MFP_CFG_IN(GPIO77, AF0)
122#define GPIO78_GPIO MFP_CFG_IN(GPIO78, AF0)
123#define GPIO79_GPIO MFP_CFG_IN(GPIO79, AF0)
124#define GPIO80_GPIO MFP_CFG_IN(GPIO80, AF0)
125#define GPIO81_GPIO MFP_CFG_IN(GPIO81, AF0)
126#define GPIO82_GPIO MFP_CFG_IN(GPIO82, AF0)
127#define GPIO83_GPIO MFP_CFG_IN(GPIO83, AF0)
128#define GPIO84_GPIO MFP_CFG_IN(GPIO84, AF0)
129
130extern void pxa2xx_mfp_config(unsigned long *mfp_cfgs, int num);
131extern int gpio_set_wake(unsigned int gpio, unsigned int on);
132#endif /* __ASM_ARCH_MFP_PXA2XX_H */
diff --git a/include/asm-arm/arch-pxa/pxa-regs.h b/include/asm-arm/arch-pxa/pxa-regs.h
index 2357a73340d4..a322012f16ac 100644
--- a/include/asm-arm/arch-pxa/pxa-regs.h
+++ b/include/asm-arm/arch-pxa/pxa-regs.h
@@ -1129,6 +1129,11 @@
1129#define ICPR __REG(0x40D00010) /* Interrupt Controller Pending Register */ 1129#define ICPR __REG(0x40D00010) /* Interrupt Controller Pending Register */
1130#define ICCR __REG(0x40D00014) /* Interrupt Controller Control Register */ 1130#define ICCR __REG(0x40D00014) /* Interrupt Controller Control Register */
1131 1131
1132#define ICIP2 __REG(0x40D0009C) /* Interrupt Controller IRQ Pending Register 2 */
1133#define ICMR2 __REG(0x40D000A0) /* Interrupt Controller Mask Register 2 */
1134#define ICLR2 __REG(0x40D000A4) /* Interrupt Controller Level Register 2 */
1135#define ICFP2 __REG(0x40D000A8) /* Interrupt Controller FIQ Pending Register 2 */
1136#define ICPR2 __REG(0x40D000AC) /* Interrupt Controller Pending Register 2 */
1132 1137
1133/* 1138/*
1134 * General Purpose I/O 1139 * General Purpose I/O
@@ -1200,12 +1205,6 @@
1200 1205
1201/* Interrupt Controller */ 1206/* Interrupt Controller */
1202 1207
1203#define ICIP2 __REG(0x40D0009C) /* Interrupt Controller IRQ Pending Register 2 */
1204#define ICMR2 __REG(0x40D000A0) /* Interrupt Controller Mask Register 2 */
1205#define ICLR2 __REG(0x40D000A4) /* Interrupt Controller Level Register 2 */
1206#define ICFP2 __REG(0x40D000A8) /* Interrupt Controller FIQ Pending Register 2 */
1207#define ICPR2 __REG(0x40D000AC) /* Interrupt Controller Pending Register 2 */
1208
1209#define _GPLR(x) __REG2(0x40E00000, ((x) & 0x60) >> 3) 1208#define _GPLR(x) __REG2(0x40E00000, ((x) & 0x60) >> 3)
1210#define _GPDR(x) __REG2(0x40E0000C, ((x) & 0x60) >> 3) 1209#define _GPDR(x) __REG2(0x40E0000C, ((x) & 0x60) >> 3)
1211#define _GPSR(x) __REG2(0x40E00018, ((x) & 0x60) >> 3) 1210#define _GPSR(x) __REG2(0x40E00018, ((x) & 0x60) >> 3)
@@ -1237,267 +1236,6 @@
1237 1236
1238#endif 1237#endif
1239 1238
1240
1241/* GPIO alternate function assignments */
1242
1243#define GPIO1_RST 1 /* reset */
1244#define GPIO6_MMCCLK 6 /* MMC Clock */
1245#define GPIO7_48MHz 7 /* 48 MHz clock output */
1246#define GPIO8_MMCCS0 8 /* MMC Chip Select 0 */
1247#define GPIO9_MMCCS1 9 /* MMC Chip Select 1 */
1248#define GPIO10_RTCCLK 10 /* real time clock (1 Hz) */
1249#define GPIO11_3_6MHz 11 /* 3.6 MHz oscillator out */
1250#define GPIO12_32KHz 12 /* 32 kHz out */
1251#define GPIO13_MBGNT 13 /* memory controller grant */
1252#define GPIO14_MBREQ 14 /* alternate bus master request */
1253#define GPIO15_nCS_1 15 /* chip select 1 */
1254#define GPIO16_PWM0 16 /* PWM0 output */
1255#define GPIO17_PWM1 17 /* PWM1 output */
1256#define GPIO18_RDY 18 /* Ext. Bus Ready */
1257#define GPIO19_DREQ1 19 /* External DMA Request */
1258#define GPIO20_DREQ0 20 /* External DMA Request */
1259#define GPIO23_SCLK 23 /* SSP clock */
1260#define GPIO24_SFRM 24 /* SSP Frame */
1261#define GPIO25_STXD 25 /* SSP transmit */
1262#define GPIO26_SRXD 26 /* SSP receive */
1263#define GPIO27_SEXTCLK 27 /* SSP ext_clk */
1264#define GPIO28_BITCLK 28 /* AC97/I2S bit_clk */
1265#define GPIO29_SDATA_IN 29 /* AC97 Sdata_in0 / I2S Sdata_in */
1266#define GPIO30_SDATA_OUT 30 /* AC97/I2S Sdata_out */
1267#define GPIO31_SYNC 31 /* AC97/I2S sync */
1268#define GPIO32_SDATA_IN1 32 /* AC97 Sdata_in1 */
1269#define GPIO32_SYSCLK 32 /* I2S System Clock */
1270#define GPIO32_MMCCLK 32 /* MMC Clock (PXA270) */
1271#define GPIO33_nCS_5 33 /* chip select 5 */
1272#define GPIO34_FFRXD 34 /* FFUART receive */
1273#define GPIO34_MMCCS0 34 /* MMC Chip Select 0 */
1274#define GPIO35_FFCTS 35 /* FFUART Clear to send */
1275#define GPIO36_FFDCD 36 /* FFUART Data carrier detect */
1276#define GPIO37_FFDSR 37 /* FFUART data set ready */
1277#define GPIO38_FFRI 38 /* FFUART Ring Indicator */
1278#define GPIO39_MMCCS1 39 /* MMC Chip Select 1 */
1279#define GPIO39_FFTXD 39 /* FFUART transmit data */
1280#define GPIO40_FFDTR 40 /* FFUART data terminal Ready */
1281#define GPIO41_FFRTS 41 /* FFUART request to send */
1282#define GPIO42_BTRXD 42 /* BTUART receive data */
1283#define GPIO42_HWRXD 42 /* HWUART receive data */
1284#define GPIO43_BTTXD 43 /* BTUART transmit data */
1285#define GPIO43_HWTXD 43 /* HWUART transmit data */
1286#define GPIO44_BTCTS 44 /* BTUART clear to send */
1287#define GPIO44_HWCTS 44 /* HWUART clear to send */
1288#define GPIO45_BTRTS 45 /* BTUART request to send */
1289#define GPIO45_HWRTS 45 /* HWUART request to send */
1290#define GPIO45_AC97_SYSCLK 45 /* AC97 System Clock */
1291#define GPIO46_ICPRXD 46 /* ICP receive data */
1292#define GPIO46_STRXD 46 /* STD_UART receive data */
1293#define GPIO47_ICPTXD 47 /* ICP transmit data */
1294#define GPIO47_STTXD 47 /* STD_UART transmit data */
1295#define GPIO48_nPOE 48 /* Output Enable for Card Space */
1296#define GPIO49_nPWE 49 /* Write Enable for Card Space */
1297#define GPIO50_nPIOR 50 /* I/O Read for Card Space */
1298#define GPIO51_nPIOW 51 /* I/O Write for Card Space */
1299#define GPIO52_nPCE_1 52 /* Card Enable for Card Space */
1300#define GPIO53_nPCE_2 53 /* Card Enable for Card Space */
1301#define GPIO53_MMCCLK 53 /* MMC Clock */
1302#define GPIO54_MMCCLK 54 /* MMC Clock */
1303#define GPIO54_pSKTSEL 54 /* Socket Select for Card Space */
1304#define GPIO54_nPCE_2 54 /* Card Enable for Card Space (PXA27x) */
1305#define GPIO55_nPREG 55 /* Card Address bit 26 */
1306#define GPIO56_nPWAIT 56 /* Wait signal for Card Space */
1307#define GPIO57_nIOIS16 57 /* Bus Width select for I/O Card Space */
1308#define GPIO58_LDD_0 58 /* LCD data pin 0 */
1309#define GPIO59_LDD_1 59 /* LCD data pin 1 */
1310#define GPIO60_LDD_2 60 /* LCD data pin 2 */
1311#define GPIO61_LDD_3 61 /* LCD data pin 3 */
1312#define GPIO62_LDD_4 62 /* LCD data pin 4 */
1313#define GPIO63_LDD_5 63 /* LCD data pin 5 */
1314#define GPIO64_LDD_6 64 /* LCD data pin 6 */
1315#define GPIO65_LDD_7 65 /* LCD data pin 7 */
1316#define GPIO66_LDD_8 66 /* LCD data pin 8 */
1317#define GPIO66_MBREQ 66 /* alternate bus master req */
1318#define GPIO67_LDD_9 67 /* LCD data pin 9 */
1319#define GPIO67_MMCCS0 67 /* MMC Chip Select 0 */
1320#define GPIO68_LDD_10 68 /* LCD data pin 10 */
1321#define GPIO68_MMCCS1 68 /* MMC Chip Select 1 */
1322#define GPIO69_LDD_11 69 /* LCD data pin 11 */
1323#define GPIO69_MMCCLK 69 /* MMC_CLK */
1324#define GPIO70_LDD_12 70 /* LCD data pin 12 */
1325#define GPIO70_RTCCLK 70 /* Real Time clock (1 Hz) */
1326#define GPIO71_LDD_13 71 /* LCD data pin 13 */
1327#define GPIO71_3_6MHz 71 /* 3.6 MHz Oscillator clock */
1328#define GPIO72_LDD_14 72 /* LCD data pin 14 */
1329#define GPIO72_32kHz 72 /* 32 kHz clock */
1330#define GPIO73_LDD_15 73 /* LCD data pin 15 */
1331#define GPIO73_MBGNT 73 /* Memory controller grant */
1332#define GPIO74_LCD_FCLK 74 /* LCD Frame clock */
1333#define GPIO75_LCD_LCLK 75 /* LCD line clock */
1334#define GPIO76_LCD_PCLK 76 /* LCD Pixel clock */
1335#define GPIO77_LCD_ACBIAS 77 /* LCD AC Bias */
1336#define GPIO78_nCS_2 78 /* chip select 2 */
1337#define GPIO79_nCS_3 79 /* chip select 3 */
1338#define GPIO80_nCS_4 80 /* chip select 4 */
1339#define GPIO81_NSCLK 81 /* NSSP clock */
1340#define GPIO82_NSFRM 82 /* NSSP Frame */
1341#define GPIO83_NSTXD 83 /* NSSP transmit */
1342#define GPIO84_NSRXD 84 /* NSSP receive */
1343#define GPIO85_nPCE_1 85 /* Card Enable for Card Space (PXA27x) */
1344#define GPIO92_MMCDAT0 92 /* MMC DAT0 (PXA27x) */
1345#define GPIO102_nPCE_1 102 /* PCMCIA (PXA27x) */
1346#define GPIO109_MMCDAT1 109 /* MMC DAT1 (PXA27x) */
1347#define GPIO110_MMCDAT2 110 /* MMC DAT2 (PXA27x) */
1348#define GPIO110_MMCCS0 110 /* MMC Chip Select 0 (PXA27x) */
1349#define GPIO111_MMCDAT3 111 /* MMC DAT3 (PXA27x) */
1350#define GPIO111_MMCCS1 111 /* MMC Chip Select 1 (PXA27x) */
1351#define GPIO112_MMCCMD 112 /* MMC CMD (PXA27x) */
1352#define GPIO113_I2S_SYSCLK 113 /* I2S System Clock (PXA27x) */
1353#define GPIO113_AC97_RESET_N 113 /* AC97 NRESET on (PXA27x) */
1354
1355/* GPIO alternate function mode & direction */
1356
1357#define GPIO_IN 0x000
1358#define GPIO_OUT 0x080
1359#define GPIO_ALT_FN_1_IN 0x100
1360#define GPIO_ALT_FN_1_OUT 0x180
1361#define GPIO_ALT_FN_2_IN 0x200
1362#define GPIO_ALT_FN_2_OUT 0x280
1363#define GPIO_ALT_FN_3_IN 0x300
1364#define GPIO_ALT_FN_3_OUT 0x380
1365#define GPIO_MD_MASK_NR 0x07f
1366#define GPIO_MD_MASK_DIR 0x080
1367#define GPIO_MD_MASK_FN 0x300
1368#define GPIO_DFLT_LOW 0x400
1369#define GPIO_DFLT_HIGH 0x800
1370
1371#define GPIO1_RTS_MD ( 1 | GPIO_ALT_FN_1_IN)
1372#define GPIO6_MMCCLK_MD ( 6 | GPIO_ALT_FN_1_OUT)
1373#define GPIO7_48MHz_MD ( 7 | GPIO_ALT_FN_1_OUT)
1374#define GPIO8_MMCCS0_MD ( 8 | GPIO_ALT_FN_1_OUT)
1375#define GPIO9_MMCCS1_MD ( 9 | GPIO_ALT_FN_1_OUT)
1376#define GPIO10_RTCCLK_MD (10 | GPIO_ALT_FN_1_OUT)
1377#define GPIO11_3_6MHz_MD (11 | GPIO_ALT_FN_1_OUT)
1378#define GPIO12_32KHz_MD (12 | GPIO_ALT_FN_1_OUT)
1379#define GPIO13_MBGNT_MD (13 | GPIO_ALT_FN_2_OUT)
1380#define GPIO14_MBREQ_MD (14 | GPIO_ALT_FN_1_IN)
1381#define GPIO15_nCS_1_MD (15 | GPIO_ALT_FN_2_OUT)
1382#define GPIO16_PWM0_MD (16 | GPIO_ALT_FN_2_OUT)
1383#define GPIO17_PWM1_MD (17 | GPIO_ALT_FN_2_OUT)
1384#define GPIO18_RDY_MD (18 | GPIO_ALT_FN_1_IN)
1385#define GPIO19_DREQ1_MD (19 | GPIO_ALT_FN_1_IN)
1386#define GPIO20_DREQ0_MD (20 | GPIO_ALT_FN_1_IN)
1387#define GPIO23_SCLK_MD (23 | GPIO_ALT_FN_2_OUT)
1388#define GPIO24_SFRM_MD (24 | GPIO_ALT_FN_2_OUT)
1389#define GPIO25_STXD_MD (25 | GPIO_ALT_FN_2_OUT)
1390#define GPIO26_SRXD_MD (26 | GPIO_ALT_FN_1_IN)
1391#define GPIO27_SEXTCLK_MD (27 | GPIO_ALT_FN_1_IN)
1392#define GPIO28_BITCLK_AC97_MD (28 | GPIO_ALT_FN_1_IN)
1393#define GPIO28_BITCLK_IN_I2S_MD (28 | GPIO_ALT_FN_2_IN)
1394#define GPIO28_BITCLK_OUT_I2S_MD (28 | GPIO_ALT_FN_1_OUT)
1395#define GPIO29_SDATA_IN_AC97_MD (29 | GPIO_ALT_FN_1_IN)
1396#define GPIO29_SDATA_IN_I2S_MD (29 | GPIO_ALT_FN_2_IN)
1397#define GPIO30_SDATA_OUT_AC97_MD (30 | GPIO_ALT_FN_2_OUT)
1398#define GPIO30_SDATA_OUT_I2S_MD (30 | GPIO_ALT_FN_1_OUT)
1399#define GPIO31_SYNC_I2S_MD (31 | GPIO_ALT_FN_1_OUT)
1400#define GPIO31_SYNC_AC97_MD (31 | GPIO_ALT_FN_2_OUT)
1401#define GPIO32_SDATA_IN1_AC97_MD (32 | GPIO_ALT_FN_1_IN)
1402#define GPIO32_SYSCLK_I2S_MD (32 | GPIO_ALT_FN_1_OUT)
1403#define GPIO32_MMCCLK_MD ( 32 | GPIO_ALT_FN_2_OUT)
1404#define GPIO33_nCS_5_MD (33 | GPIO_ALT_FN_2_OUT)
1405#define GPIO34_FFRXD_MD (34 | GPIO_ALT_FN_1_IN)
1406#define GPIO34_MMCCS0_MD (34 | GPIO_ALT_FN_2_OUT)
1407#define GPIO35_FFCTS_MD (35 | GPIO_ALT_FN_1_IN)
1408#define GPIO36_FFDCD_MD (36 | GPIO_ALT_FN_1_IN)
1409#define GPIO37_FFDSR_MD (37 | GPIO_ALT_FN_1_IN)
1410#define GPIO38_FFRI_MD (38 | GPIO_ALT_FN_1_IN)
1411#define GPIO39_MMCCS1_MD (39 | GPIO_ALT_FN_1_OUT)
1412#define GPIO39_FFTXD_MD (39 | GPIO_ALT_FN_2_OUT)
1413#define GPIO40_FFDTR_MD (40 | GPIO_ALT_FN_2_OUT)
1414#define GPIO41_FFRTS_MD (41 | GPIO_ALT_FN_2_OUT)
1415#define GPIO42_BTRXD_MD (42 | GPIO_ALT_FN_1_IN)
1416#define GPIO42_HWRXD_MD (42 | GPIO_ALT_FN_3_IN)
1417#define GPIO43_BTTXD_MD (43 | GPIO_ALT_FN_2_OUT)
1418#define GPIO43_HWTXD_MD (43 | GPIO_ALT_FN_3_OUT)
1419#define GPIO44_BTCTS_MD (44 | GPIO_ALT_FN_1_IN)
1420#define GPIO44_HWCTS_MD (44 | GPIO_ALT_FN_3_IN)
1421#define GPIO45_BTRTS_MD (45 | GPIO_ALT_FN_2_OUT)
1422#define GPIO45_HWRTS_MD (45 | GPIO_ALT_FN_3_OUT)
1423#define GPIO45_SYSCLK_AC97_MD (45 | GPIO_ALT_FN_1_OUT)
1424#define GPIO46_ICPRXD_MD (46 | GPIO_ALT_FN_1_IN)
1425#define GPIO46_STRXD_MD (46 | GPIO_ALT_FN_2_IN)
1426#define GPIO47_ICPTXD_MD (47 | GPIO_ALT_FN_2_OUT)
1427#define GPIO47_STTXD_MD (47 | GPIO_ALT_FN_1_OUT)
1428#define GPIO48_nPOE_MD (48 | GPIO_ALT_FN_2_OUT)
1429#define GPIO48_HWTXD_MD (48 | GPIO_ALT_FN_1_OUT)
1430#define GPIO48_nPOE_MD (48 | GPIO_ALT_FN_2_OUT)
1431#define GPIO49_HWRXD_MD (49 | GPIO_ALT_FN_1_IN)
1432#define GPIO49_nPWE_MD (49 | GPIO_ALT_FN_2_OUT)
1433#define GPIO50_nPIOR_MD (50 | GPIO_ALT_FN_2_OUT)
1434#define GPIO50_HWCTS_MD (50 | GPIO_ALT_FN_1_IN)
1435#define GPIO51_HWRTS_MD (51 | GPIO_ALT_FN_1_OUT)
1436#define GPIO51_nPIOW_MD (51 | GPIO_ALT_FN_2_OUT)
1437#define GPIO52_nPCE_1_MD (52 | GPIO_ALT_FN_2_OUT)
1438#define GPIO53_nPCE_2_MD (53 | GPIO_ALT_FN_2_OUT)
1439#define GPIO53_MMCCLK_MD (53 | GPIO_ALT_FN_1_OUT)
1440#define GPIO54_MMCCLK_MD (54 | GPIO_ALT_FN_1_OUT)
1441#define GPIO54_nPCE_2_MD (54 | GPIO_ALT_FN_2_OUT)
1442#define GPIO54_pSKTSEL_MD (54 | GPIO_ALT_FN_2_OUT)
1443#define GPIO55_nPREG_MD (55 | GPIO_ALT_FN_2_OUT)
1444#define GPIO56_nPWAIT_MD (56 | GPIO_ALT_FN_1_IN)
1445#define GPIO57_nIOIS16_MD (57 | GPIO_ALT_FN_1_IN)
1446#define GPIO58_LDD_0_MD (58 | GPIO_ALT_FN_2_OUT)
1447#define GPIO59_LDD_1_MD (59 | GPIO_ALT_FN_2_OUT)
1448#define GPIO60_LDD_2_MD (60 | GPIO_ALT_FN_2_OUT)
1449#define GPIO61_LDD_3_MD (61 | GPIO_ALT_FN_2_OUT)
1450#define GPIO62_LDD_4_MD (62 | GPIO_ALT_FN_2_OUT)
1451#define GPIO63_LDD_5_MD (63 | GPIO_ALT_FN_2_OUT)
1452#define GPIO64_LDD_6_MD (64 | GPIO_ALT_FN_2_OUT)
1453#define GPIO65_LDD_7_MD (65 | GPIO_ALT_FN_2_OUT)
1454#define GPIO66_LDD_8_MD (66 | GPIO_ALT_FN_2_OUT)
1455#define GPIO66_MBREQ_MD (66 | GPIO_ALT_FN_1_IN)
1456#define GPIO67_LDD_9_MD (67 | GPIO_ALT_FN_2_OUT)
1457#define GPIO67_MMCCS0_MD (67 | GPIO_ALT_FN_1_OUT)
1458#define GPIO68_LDD_10_MD (68 | GPIO_ALT_FN_2_OUT)
1459#define GPIO68_MMCCS1_MD (68 | GPIO_ALT_FN_1_OUT)
1460#define GPIO69_LDD_11_MD (69 | GPIO_ALT_FN_2_OUT)
1461#define GPIO69_MMCCLK_MD (69 | GPIO_ALT_FN_1_OUT)
1462#define GPIO70_LDD_12_MD (70 | GPIO_ALT_FN_2_OUT)
1463#define GPIO70_RTCCLK_MD (70 | GPIO_ALT_FN_1_OUT)
1464#define GPIO71_LDD_13_MD (71 | GPIO_ALT_FN_2_OUT)
1465#define GPIO71_3_6MHz_MD (71 | GPIO_ALT_FN_1_OUT)
1466#define GPIO72_LDD_14_MD (72 | GPIO_ALT_FN_2_OUT)
1467#define GPIO72_32kHz_MD (72 | GPIO_ALT_FN_1_OUT)
1468#define GPIO73_LDD_15_MD (73 | GPIO_ALT_FN_2_OUT)
1469#define GPIO73_MBGNT_MD (73 | GPIO_ALT_FN_1_OUT)
1470#define GPIO74_LCD_FCLK_MD (74 | GPIO_ALT_FN_2_OUT)
1471#define GPIO75_LCD_LCLK_MD (75 | GPIO_ALT_FN_2_OUT)
1472#define GPIO76_LCD_PCLK_MD (76 | GPIO_ALT_FN_2_OUT)
1473#define GPIO77_LCD_ACBIAS_MD (77 | GPIO_ALT_FN_2_OUT)
1474#define GPIO78_nCS_2_MD (78 | GPIO_ALT_FN_2_OUT)
1475#define GPIO79_nCS_3_MD (79 | GPIO_ALT_FN_2_OUT)
1476#define GPIO79_pSKTSEL_MD (79 | GPIO_ALT_FN_1_OUT)
1477#define GPIO80_nCS_4_MD (80 | GPIO_ALT_FN_2_OUT)
1478#define GPIO81_NSSP_CLK_OUT (81 | GPIO_ALT_FN_1_OUT)
1479#define GPIO81_NSSP_CLK_IN (81 | GPIO_ALT_FN_1_IN)
1480#define GPIO82_NSSP_FRM_OUT (82 | GPIO_ALT_FN_1_OUT)
1481#define GPIO82_NSSP_FRM_IN (82 | GPIO_ALT_FN_1_IN)
1482#define GPIO83_NSSP_TX (83 | GPIO_ALT_FN_1_OUT)
1483#define GPIO83_NSSP_RX (83 | GPIO_ALT_FN_2_IN)
1484#define GPIO84_NSSP_TX (84 | GPIO_ALT_FN_1_OUT)
1485#define GPIO84_NSSP_RX (84 | GPIO_ALT_FN_2_IN)
1486#define GPIO85_nPCE_1_MD (85 | GPIO_ALT_FN_1_OUT)
1487#define GPIO92_MMCDAT0_MD (92 | GPIO_ALT_FN_1_OUT)
1488#define GPIO102_nPCE_1_MD (102 | GPIO_ALT_FN_1_OUT)
1489#define GPIO104_pSKTSEL_MD (104 | GPIO_ALT_FN_1_OUT)
1490#define GPIO109_MMCDAT1_MD (109 | GPIO_ALT_FN_1_OUT)
1491#define GPIO110_MMCDAT2_MD (110 | GPIO_ALT_FN_1_OUT)
1492#define GPIO110_MMCCS0_MD (110 | GPIO_ALT_FN_1_OUT)
1493#define GPIO111_MMCDAT3_MD (111 | GPIO_ALT_FN_1_OUT)
1494#define GPIO110_MMCCS1_MD (111 | GPIO_ALT_FN_1_OUT)
1495#define GPIO112_MMCCMD_MD (112 | GPIO_ALT_FN_1_OUT)
1496#define GPIO113_I2S_SYSCLK_MD (113 | GPIO_ALT_FN_1_OUT)
1497#define GPIO113_AC97_RESET_N_MD (113 | GPIO_ALT_FN_2_OUT)
1498#define GPIO117_I2CSCL_MD (117 | GPIO_ALT_FN_1_IN)
1499#define GPIO118_I2CSDA_MD (118 | GPIO_ALT_FN_1_IN)
1500
1501/* 1239/*
1502 * Power Manager 1240 * Power Manager
1503 */ 1241 */
@@ -1866,62 +1604,6 @@
1866 1604
1867#ifdef CONFIG_PXA27x 1605#ifdef CONFIG_PXA27x
1868 1606
1869/*
1870 * Keypad
1871 */
1872#define KPC __REG(0x41500000) /* Keypad Interface Control register */
1873#define KPDK __REG(0x41500008) /* Keypad Interface Direct Key register */
1874#define KPREC __REG(0x41500010) /* Keypad Interface Rotary Encoder register */
1875#define KPMK __REG(0x41500018) /* Keypad Interface Matrix Key register */
1876#define KPAS __REG(0x41500020) /* Keypad Interface Automatic Scan register */
1877#define KPASMKP0 __REG(0x41500028) /* Keypad Interface Automatic Scan Multiple Key Presser register 0 */
1878#define KPASMKP1 __REG(0x41500030) /* Keypad Interface Automatic Scan Multiple Key Presser register 1 */
1879#define KPASMKP2 __REG(0x41500038) /* Keypad Interface Automatic Scan Multiple Key Presser register 2 */
1880#define KPASMKP3 __REG(0x41500040) /* Keypad Interface Automatic Scan Multiple Key Presser register 3 */
1881#define KPKDI __REG(0x41500048) /* Keypad Interface Key Debounce Interval register */
1882
1883#define KPC_AS (0x1 << 30) /* Automatic Scan bit */
1884#define KPC_ASACT (0x1 << 29) /* Automatic Scan on Activity */
1885#define KPC_MI (0x1 << 22) /* Matrix interrupt bit */
1886#define KPC_IMKP (0x1 << 21) /* Ignore Multiple Key Press */
1887#define KPC_MS7 (0x1 << 20) /* Matrix scan line 7 */
1888#define KPC_MS6 (0x1 << 19) /* Matrix scan line 6 */
1889#define KPC_MS5 (0x1 << 18) /* Matrix scan line 5 */
1890#define KPC_MS4 (0x1 << 17) /* Matrix scan line 4 */
1891#define KPC_MS3 (0x1 << 16) /* Matrix scan line 3 */
1892#define KPC_MS2 (0x1 << 15) /* Matrix scan line 2 */
1893#define KPC_MS1 (0x1 << 14) /* Matrix scan line 1 */
1894#define KPC_MS0 (0x1 << 13) /* Matrix scan line 0 */
1895#define KPC_MS_ALL (KPC_MS0 | KPC_MS1 | KPC_MS2 | KPC_MS3 | KPC_MS4 | KPC_MS5 | KPC_MS6 | KPC_MS7)
1896#define KPC_ME (0x1 << 12) /* Matrix Keypad Enable */
1897#define KPC_MIE (0x1 << 11) /* Matrix Interrupt Enable */
1898#define KPC_DK_DEB_SEL (0x1 << 9) /* Direct Keypad Debounce Select */
1899#define KPC_DI (0x1 << 5) /* Direct key interrupt bit */
1900#define KPC_RE_ZERO_DEB (0x1 << 4) /* Rotary Encoder Zero Debounce */
1901#define KPC_REE1 (0x1 << 3) /* Rotary Encoder1 Enable */
1902#define KPC_REE0 (0x1 << 2) /* Rotary Encoder0 Enable */
1903#define KPC_DE (0x1 << 1) /* Direct Keypad Enable */
1904#define KPC_DIE (0x1 << 0) /* Direct Keypad interrupt Enable */
1905
1906#define KPDK_DKP (0x1 << 31)
1907#define KPDK_DK7 (0x1 << 7)
1908#define KPDK_DK6 (0x1 << 6)
1909#define KPDK_DK5 (0x1 << 5)
1910#define KPDK_DK4 (0x1 << 4)
1911#define KPDK_DK3 (0x1 << 3)
1912#define KPDK_DK2 (0x1 << 2)
1913#define KPDK_DK1 (0x1 << 1)
1914#define KPDK_DK0 (0x1 << 0)
1915
1916#define KPREC_OF1 (0x1 << 31)
1917#define kPREC_UF1 (0x1 << 30)
1918#define KPREC_OF0 (0x1 << 15)
1919#define KPREC_UF0 (0x1 << 14)
1920
1921#define KPMK_MKP (0x1 << 31)
1922#define KPAS_SO (0x1 << 31)
1923#define KPASMKPx_SO (0x1 << 31)
1924
1925/* Camera Interface */ 1607/* Camera Interface */
1926#define CICR0 __REG(0x50000000) 1608#define CICR0 __REG(0x50000000)
1927#define CICR1 __REG(0x50000004) 1609#define CICR1 __REG(0x50000004)
@@ -1953,7 +1635,7 @@
1953#define CICR0_FOM (1 << 0) /* FIFO-overrun mask */ 1635#define CICR0_FOM (1 << 0) /* FIFO-overrun mask */
1954 1636
1955#define CICR1_TBIT (1 << 31) /* Transparency bit */ 1637#define CICR1_TBIT (1 << 31) /* Transparency bit */
1956#define CICR1_RGBT_CONV (0x3 << 30) /* RGBT conversion mask */ 1638#define CICR1_RGBT_CONV (0x3 << 29) /* RGBT conversion mask */
1957#define CICR1_PPL (0x7ff << 15) /* Pixels per line mask */ 1639#define CICR1_PPL (0x7ff << 15) /* Pixels per line mask */
1958#define CICR1_RGB_CONV (0x7 << 12) /* RGB conversion mask */ 1640#define CICR1_RGB_CONV (0x7 << 12) /* RGB conversion mask */
1959#define CICR1_RGB_F (1 << 11) /* RGB format */ 1641#define CICR1_RGB_F (1 << 11) /* RGB format */
diff --git a/include/asm-arm/arch-pxa/pxa27x_keypad.h b/include/asm-arm/arch-pxa/pxa27x_keypad.h
index 644f7609b523..d5a48a96dea7 100644
--- a/include/asm-arm/arch-pxa/pxa27x_keypad.h
+++ b/include/asm-arm/arch-pxa/pxa27x_keypad.h
@@ -53,4 +53,6 @@ struct pxa27x_keypad_platform_data {
53 53
54#define KEY(row, col, val) (((row) << 28) | ((col) << 24) | (val)) 54#define KEY(row, col, val) (((row) << 28) | ((col) << 24) | (val))
55 55
56extern void pxa_set_keypad_info(struct pxa27x_keypad_platform_data *info);
57
56#endif /* __ASM_ARCH_PXA27x_KEYPAD_H */ 58#endif /* __ASM_ARCH_PXA27x_KEYPAD_H */
diff --git a/include/asm-arm/arch-pxa/pxa2xx-gpio.h b/include/asm-arm/arch-pxa/pxa2xx-gpio.h
new file mode 100644
index 000000000000..763313c5e6be
--- /dev/null
+++ b/include/asm-arm/arch-pxa/pxa2xx-gpio.h
@@ -0,0 +1,357 @@
1#ifndef __ASM_ARCH_PXA2XX_GPIO_H
2#define __ASM_ARCH_PXA2XX_GPIO_H
3
4/* GPIO alternate function assignments */
5
6#define GPIO1_RST 1 /* reset */
7#define GPIO6_MMCCLK 6 /* MMC Clock */
8#define GPIO7_48MHz 7 /* 48 MHz clock output */
9#define GPIO8_MMCCS0 8 /* MMC Chip Select 0 */
10#define GPIO9_MMCCS1 9 /* MMC Chip Select 1 */
11#define GPIO10_RTCCLK 10 /* real time clock (1 Hz) */
12#define GPIO11_3_6MHz 11 /* 3.6 MHz oscillator out */
13#define GPIO12_32KHz 12 /* 32 kHz out */
14#define GPIO12_CIF_DD_7 12 /* Camera data pin 7 */
15#define GPIO13_MBGNT 13 /* memory controller grant */
16#define GPIO14_MBREQ 14 /* alternate bus master request */
17#define GPIO15_nCS_1 15 /* chip select 1 */
18#define GPIO16_PWM0 16 /* PWM0 output */
19#define GPIO17_PWM1 17 /* PWM1 output */
20#define GPIO17_CIF_DD_6 17 /* Camera data pin 6 */
21#define GPIO18_RDY 18 /* Ext. Bus Ready */
22#define GPIO19_DREQ1 19 /* External DMA Request */
23#define GPIO20_DREQ0 20 /* External DMA Request */
24#define GPIO23_SCLK 23 /* SSP clock */
25#define GPIO23_CIF_MCLK 23 /* Camera Master Clock */
26#define GPIO24_SFRM 24 /* SSP Frame */
27#define GPIO24_CIF_FV 24 /* Camera frame start signal */
28#define GPIO25_STXD 25 /* SSP transmit */
29#define GPIO25_CIF_LV 25 /* Camera line start signal */
30#define GPIO26_SRXD 26 /* SSP receive */
31#define GPIO26_CIF_PCLK 26 /* Camera Pixel Clock */
32#define GPIO27_SEXTCLK 27 /* SSP ext_clk */
33#define GPIO27_CIF_DD_0 27 /* Camera data pin 0 */
34#define GPIO28_BITCLK 28 /* AC97/I2S bit_clk */
35#define GPIO29_SDATA_IN 29 /* AC97 Sdata_in0 / I2S Sdata_in */
36#define GPIO30_SDATA_OUT 30 /* AC97/I2S Sdata_out */
37#define GPIO31_SYNC 31 /* AC97/I2S sync */
38#define GPIO32_SDATA_IN1 32 /* AC97 Sdata_in1 */
39#define GPIO32_SYSCLK 32 /* I2S System Clock */
40#define GPIO32_MMCCLK 32 /* MMC Clock (PXA270) */
41#define GPIO33_nCS_5 33 /* chip select 5 */
42#define GPIO34_FFRXD 34 /* FFUART receive */
43#define GPIO34_MMCCS0 34 /* MMC Chip Select 0 */
44#define GPIO35_FFCTS 35 /* FFUART Clear to send */
45#define GPIO36_FFDCD 36 /* FFUART Data carrier detect */
46#define GPIO37_FFDSR 37 /* FFUART data set ready */
47#define GPIO38_FFRI 38 /* FFUART Ring Indicator */
48#define GPIO39_MMCCS1 39 /* MMC Chip Select 1 */
49#define GPIO39_FFTXD 39 /* FFUART transmit data */
50#define GPIO40_FFDTR 40 /* FFUART data terminal Ready */
51#define GPIO41_FFRTS 41 /* FFUART request to send */
52#define GPIO42_BTRXD 42 /* BTUART receive data */
53#define GPIO42_HWRXD 42 /* HWUART receive data */
54#define GPIO42_CIF_MCLK 42 /* Camera Master Clock */
55#define GPIO43_BTTXD 43 /* BTUART transmit data */
56#define GPIO43_HWTXD 43 /* HWUART transmit data */
57#define GPIO43_CIF_FV 43 /* Camera frame start signal */
58#define GPIO44_BTCTS 44 /* BTUART clear to send */
59#define GPIO44_HWCTS 44 /* HWUART clear to send */
60#define GPIO44_CIF_LV 44 /* Camera line start signal */
61#define GPIO45_BTRTS 45 /* BTUART request to send */
62#define GPIO45_HWRTS 45 /* HWUART request to send */
63#define GPIO45_AC97_SYSCLK 45 /* AC97 System Clock */
64#define GPIO45_CIF_PCLK 45 /* Camera Pixel Clock */
65#define GPIO46_ICPRXD 46 /* ICP receive data */
66#define GPIO46_STRXD 46 /* STD_UART receive data */
67#define GPIO47_ICPTXD 47 /* ICP transmit data */
68#define GPIO47_STTXD 47 /* STD_UART transmit data */
69#define GPIO47_CIF_DD_0 47 /* Camera data pin 0 */
70#define GPIO48_nPOE 48 /* Output Enable for Card Space */
71#define GPIO48_CIF_DD_5 48 /* Camera data pin 5 */
72#define GPIO49_nPWE 49 /* Write Enable for Card Space */
73#define GPIO50_nPIOR 50 /* I/O Read for Card Space */
74#define GPIO50_CIF_DD_3 50 /* Camera data pin 3 */
75#define GPIO51_nPIOW 51 /* I/O Write for Card Space */
76#define GPIO51_CIF_DD_2 51 /* Camera data pin 2 */
77#define GPIO52_nPCE_1 52 /* Card Enable for Card Space */
78#define GPIO52_CIF_DD_4 52 /* Camera data pin 4 */
79#define GPIO53_nPCE_2 53 /* Card Enable for Card Space */
80#define GPIO53_MMCCLK 53 /* MMC Clock */
81#define GPIO53_CIF_MCLK 53 /* Camera Master Clock */
82#define GPIO54_MMCCLK 54 /* MMC Clock */
83#define GPIO54_pSKTSEL 54 /* Socket Select for Card Space */
84#define GPIO54_nPCE_2 54 /* Card Enable for Card Space (PXA27x) */
85#define GPIO54_CIF_PCLK 54 /* Camera Pixel Clock */
86#define GPIO55_nPREG 55 /* Card Address bit 26 */
87#define GPIO55_CIF_DD_1 55 /* Camera data pin 1 */
88#define GPIO56_nPWAIT 56 /* Wait signal for Card Space */
89#define GPIO57_nIOIS16 57 /* Bus Width select for I/O Card Space */
90#define GPIO58_LDD_0 58 /* LCD data pin 0 */
91#define GPIO59_LDD_1 59 /* LCD data pin 1 */
92#define GPIO60_LDD_2 60 /* LCD data pin 2 */
93#define GPIO61_LDD_3 61 /* LCD data pin 3 */
94#define GPIO62_LDD_4 62 /* LCD data pin 4 */
95#define GPIO63_LDD_5 63 /* LCD data pin 5 */
96#define GPIO64_LDD_6 64 /* LCD data pin 6 */
97#define GPIO65_LDD_7 65 /* LCD data pin 7 */
98#define GPIO66_LDD_8 66 /* LCD data pin 8 */
99#define GPIO66_MBREQ 66 /* alternate bus master req */
100#define GPIO67_LDD_9 67 /* LCD data pin 9 */
101#define GPIO67_MMCCS0 67 /* MMC Chip Select 0 */
102#define GPIO68_LDD_10 68 /* LCD data pin 10 */
103#define GPIO68_MMCCS1 68 /* MMC Chip Select 1 */
104#define GPIO69_LDD_11 69 /* LCD data pin 11 */
105#define GPIO69_MMCCLK 69 /* MMC_CLK */
106#define GPIO70_LDD_12 70 /* LCD data pin 12 */
107#define GPIO70_RTCCLK 70 /* Real Time clock (1 Hz) */
108#define GPIO71_LDD_13 71 /* LCD data pin 13 */
109#define GPIO71_3_6MHz 71 /* 3.6 MHz Oscillator clock */
110#define GPIO72_LDD_14 72 /* LCD data pin 14 */
111#define GPIO72_32kHz 72 /* 32 kHz clock */
112#define GPIO73_LDD_15 73 /* LCD data pin 15 */
113#define GPIO73_MBGNT 73 /* Memory controller grant */
114#define GPIO74_LCD_FCLK 74 /* LCD Frame clock */
115#define GPIO75_LCD_LCLK 75 /* LCD line clock */
116#define GPIO76_LCD_PCLK 76 /* LCD Pixel clock */
117#define GPIO77_LCD_ACBIAS 77 /* LCD AC Bias */
118#define GPIO78_nCS_2 78 /* chip select 2 */
119#define GPIO79_nCS_3 79 /* chip select 3 */
120#define GPIO80_nCS_4 80 /* chip select 4 */
121#define GPIO81_NSCLK 81 /* NSSP clock */
122#define GPIO81_CIF_DD_0 81 /* Camera data pin 0 */
123#define GPIO82_NSFRM 82 /* NSSP Frame */
124#define GPIO82_CIF_DD_5 82 /* Camera data pin 5 */
125#define GPIO83_NSTXD 83 /* NSSP transmit */
126#define GPIO83_CIF_DD_4 83 /* Camera data pin 4 */
127#define GPIO84_NSRXD 84 /* NSSP receive */
128#define GPIO84_CIF_FV 84 /* Camera frame start signal */
129#define GPIO85_nPCE_1 85 /* Card Enable for Card Space (PXA27x) */
130#define GPIO85_CIF_LV 85 /* Camera line start signal */
131#define GPIO90_CIF_DD_4 90 /* Camera data pin 4 */
132#define GPIO91_CIF_DD_5 91 /* Camera data pin 5 */
133#define GPIO92_MMCDAT0 92 /* MMC DAT0 (PXA27x) */
134#define GPIO93_CIF_DD_6 93 /* Camera data pin 6 */
135#define GPIO94_CIF_DD_5 94 /* Camera data pin 5 */
136#define GPIO95_CIF_DD_4 95 /* Camera data pin 4 */
137#define GPIO98_CIF_DD_0 98 /* Camera data pin 0 */
138#define GPIO102_nPCE_1 102 /* PCMCIA (PXA27x) */
139#define GPIO103_CIF_DD_3 103 /* Camera data pin 3 */
140#define GPIO104_CIF_DD_2 104 /* Camera data pin 2 */
141#define GPIO105_CIF_DD_1 105 /* Camera data pin 1 */
142#define GPIO106_CIF_DD_9 106 /* Camera data pin 9 */
143#define GPIO107_CIF_DD_8 107 /* Camera data pin 8 */
144#define GPIO108_CIF_DD_7 108 /* Camera data pin 7 */
145#define GPIO109_MMCDAT1 109 /* MMC DAT1 (PXA27x) */
146#define GPIO110_MMCDAT2 110 /* MMC DAT2 (PXA27x) */
147#define GPIO110_MMCCS0 110 /* MMC Chip Select 0 (PXA27x) */
148#define GPIO111_MMCDAT3 111 /* MMC DAT3 (PXA27x) */
149#define GPIO111_MMCCS1 111 /* MMC Chip Select 1 (PXA27x) */
150#define GPIO112_MMCCMD 112 /* MMC CMD (PXA27x) */
151#define GPIO113_I2S_SYSCLK 113 /* I2S System Clock (PXA27x) */
152#define GPIO113_AC97_RESET_N 113 /* AC97 NRESET on (PXA27x) */
153#define GPIO114_CIF_DD_1 114 /* Camera data pin 1 */
154#define GPIO115_CIF_DD_3 115 /* Camera data pin 3 */
155#define GPIO116_CIF_DD_2 116 /* Camera data pin 2 */
156
157/* GPIO alternate function mode & direction */
158
159#define GPIO_IN 0x000
160#define GPIO_OUT 0x080
161#define GPIO_ALT_FN_1_IN 0x100
162#define GPIO_ALT_FN_1_OUT 0x180
163#define GPIO_ALT_FN_2_IN 0x200
164#define GPIO_ALT_FN_2_OUT 0x280
165#define GPIO_ALT_FN_3_IN 0x300
166#define GPIO_ALT_FN_3_OUT 0x380
167#define GPIO_MD_MASK_NR 0x07f
168#define GPIO_MD_MASK_DIR 0x080
169#define GPIO_MD_MASK_FN 0x300
170#define GPIO_DFLT_LOW 0x400
171#define GPIO_DFLT_HIGH 0x800
172
173#define GPIO1_RTS_MD ( 1 | GPIO_ALT_FN_1_IN)
174#define GPIO6_MMCCLK_MD ( 6 | GPIO_ALT_FN_1_OUT)
175#define GPIO7_48MHz_MD ( 7 | GPIO_ALT_FN_1_OUT)
176#define GPIO8_MMCCS0_MD ( 8 | GPIO_ALT_FN_1_OUT)
177#define GPIO9_MMCCS1_MD ( 9 | GPIO_ALT_FN_1_OUT)
178#define GPIO10_RTCCLK_MD (10 | GPIO_ALT_FN_1_OUT)
179#define GPIO11_3_6MHz_MD (11 | GPIO_ALT_FN_1_OUT)
180#define GPIO12_32KHz_MD (12 | GPIO_ALT_FN_1_OUT)
181#define GPIO12_CIF_DD_7_MD (12 | GPIO_ALT_FN_2_IN)
182#define GPIO13_MBGNT_MD (13 | GPIO_ALT_FN_2_OUT)
183#define GPIO14_MBREQ_MD (14 | GPIO_ALT_FN_1_IN)
184#define GPIO15_nCS_1_MD (15 | GPIO_ALT_FN_2_OUT)
185#define GPIO16_PWM0_MD (16 | GPIO_ALT_FN_2_OUT)
186#define GPIO17_PWM1_MD (17 | GPIO_ALT_FN_2_OUT)
187#define GPIO17_CIF_DD_6_MD (17 | GPIO_ALT_FN_2_IN)
188#define GPIO18_RDY_MD (18 | GPIO_ALT_FN_1_IN)
189#define GPIO19_DREQ1_MD (19 | GPIO_ALT_FN_1_IN)
190#define GPIO20_DREQ0_MD (20 | GPIO_ALT_FN_1_IN)
191#define GPIO23_CIF_MCLK_MD (23 | GPIO_ALT_FN_1_OUT)
192#define GPIO23_SCLK_MD (23 | GPIO_ALT_FN_2_OUT)
193#define GPIO24_CIF_FV_MD (24 | GPIO_ALT_FN_1_OUT)
194#define GPIO24_SFRM_MD (24 | GPIO_ALT_FN_2_OUT)
195#define GPIO25_CIF_LV_MD (25 | GPIO_ALT_FN_1_OUT)
196#define GPIO25_STXD_MD (25 | GPIO_ALT_FN_2_OUT)
197#define GPIO26_SRXD_MD (26 | GPIO_ALT_FN_1_IN)
198#define GPIO26_CIF_PCLK_MD (26 | GPIO_ALT_FN_2_IN)
199#define GPIO27_SEXTCLK_MD (27 | GPIO_ALT_FN_1_IN)
200#define GPIO27_CIF_DD_0_MD (27 | GPIO_ALT_FN_3_IN)
201#define GPIO28_BITCLK_AC97_MD (28 | GPIO_ALT_FN_1_IN)
202#define GPIO28_BITCLK_IN_I2S_MD (28 | GPIO_ALT_FN_2_IN)
203#define GPIO28_BITCLK_OUT_I2S_MD (28 | GPIO_ALT_FN_1_OUT)
204#define GPIO29_SDATA_IN_AC97_MD (29 | GPIO_ALT_FN_1_IN)
205#define GPIO29_SDATA_IN_I2S_MD (29 | GPIO_ALT_FN_2_IN)
206#define GPIO30_SDATA_OUT_AC97_MD (30 | GPIO_ALT_FN_2_OUT)
207#define GPIO30_SDATA_OUT_I2S_MD (30 | GPIO_ALT_FN_1_OUT)
208#define GPIO31_SYNC_I2S_MD (31 | GPIO_ALT_FN_1_OUT)
209#define GPIO31_SYNC_AC97_MD (31 | GPIO_ALT_FN_2_OUT)
210#define GPIO32_SDATA_IN1_AC97_MD (32 | GPIO_ALT_FN_1_IN)
211#define GPIO32_SYSCLK_I2S_MD (32 | GPIO_ALT_FN_1_OUT)
212#define GPIO32_MMCCLK_MD (32 | GPIO_ALT_FN_2_OUT)
213#define GPIO33_nCS_5_MD (33 | GPIO_ALT_FN_2_OUT)
214#define GPIO34_FFRXD_MD (34 | GPIO_ALT_FN_1_IN)
215#define GPIO34_MMCCS0_MD (34 | GPIO_ALT_FN_2_OUT)
216#define GPIO35_FFCTS_MD (35 | GPIO_ALT_FN_1_IN)
217#define GPIO35_KP_MKOUT6_MD (35 | GPIO_ALT_FN_2_OUT)
218#define GPIO36_FFDCD_MD (36 | GPIO_ALT_FN_1_IN)
219#define GPIO37_FFDSR_MD (37 | GPIO_ALT_FN_1_IN)
220#define GPIO38_FFRI_MD (38 | GPIO_ALT_FN_1_IN)
221#define GPIO39_MMCCS1_MD (39 | GPIO_ALT_FN_1_OUT)
222#define GPIO39_FFTXD_MD (39 | GPIO_ALT_FN_2_OUT)
223#define GPIO40_FFDTR_MD (40 | GPIO_ALT_FN_2_OUT)
224#define GPIO41_FFRTS_MD (41 | GPIO_ALT_FN_2_OUT)
225#define GPIO41_KP_MKOUT7_MD (41 | GPIO_ALT_FN_1_OUT)
226#define GPIO42_BTRXD_MD (42 | GPIO_ALT_FN_1_IN)
227#define GPIO42_HWRXD_MD (42 | GPIO_ALT_FN_3_IN)
228#define GPIO42_CIF_MCLK_MD (42 | GPIO_ALT_FN_3_OUT)
229#define GPIO43_BTTXD_MD (43 | GPIO_ALT_FN_2_OUT)
230#define GPIO43_HWTXD_MD (43 | GPIO_ALT_FN_3_OUT)
231#define GPIO43_CIF_FV_MD (43 | GPIO_ALT_FN_3_OUT)
232#define GPIO44_BTCTS_MD (44 | GPIO_ALT_FN_1_IN)
233#define GPIO44_HWCTS_MD (44 | GPIO_ALT_FN_3_IN)
234#define GPIO44_CIF_LV_MD (44 | GPIO_ALT_FN_3_OUT)
235#define GPIO45_CIF_PCLK_MD (45 | GPIO_ALT_FN_3_IN)
236#define GPIO45_BTRTS_MD (45 | GPIO_ALT_FN_2_OUT)
237#define GPIO45_HWRTS_MD (45 | GPIO_ALT_FN_3_OUT)
238#define GPIO45_SYSCLK_AC97_MD (45 | GPIO_ALT_FN_1_OUT)
239#define GPIO46_ICPRXD_MD (46 | GPIO_ALT_FN_1_IN)
240#define GPIO46_STRXD_MD (46 | GPIO_ALT_FN_2_IN)
241#define GPIO47_CIF_DD_0_MD (47 | GPIO_ALT_FN_1_IN)
242#define GPIO47_ICPTXD_MD (47 | GPIO_ALT_FN_2_OUT)
243#define GPIO47_STTXD_MD (47 | GPIO_ALT_FN_1_OUT)
244#define GPIO48_CIF_DD_5_MD (48 | GPIO_ALT_FN_1_IN)
245#define GPIO48_nPOE_MD (48 | GPIO_ALT_FN_2_OUT)
246#define GPIO48_HWTXD_MD (48 | GPIO_ALT_FN_1_OUT)
247#define GPIO48_nPOE_MD (48 | GPIO_ALT_FN_2_OUT)
248#define GPIO49_HWRXD_MD (49 | GPIO_ALT_FN_1_IN)
249#define GPIO49_nPWE_MD (49 | GPIO_ALT_FN_2_OUT)
250#define GPIO50_CIF_DD_3_MD (50 | GPIO_ALT_FN_1_IN)
251#define GPIO50_nPIOR_MD (50 | GPIO_ALT_FN_2_OUT)
252#define GPIO50_HWCTS_MD (50 | GPIO_ALT_FN_1_IN)
253#define GPIO50_CIF_DD_3_MD (50 | GPIO_ALT_FN_1_IN)
254#define GPIO51_CIF_DD_2_MD (51 | GPIO_ALT_FN_1_IN)
255#define GPIO51_nPIOW_MD (51 | GPIO_ALT_FN_2_OUT)
256#define GPIO51_HWRTS_MD (51 | GPIO_ALT_FN_1_OUT)
257#define GPIO51_CIF_DD_2_MD (51 | GPIO_ALT_FN_1_IN)
258#define GPIO52_nPCE_1_MD (52 | GPIO_ALT_FN_2_OUT)
259#define GPIO52_CIF_DD_4_MD (52 | GPIO_ALT_FN_1_IN)
260#define GPIO53_nPCE_2_MD (53 | GPIO_ALT_FN_2_OUT)
261#define GPIO53_MMCCLK_MD (53 | GPIO_ALT_FN_1_OUT)
262#define GPIO53_CIF_MCLK_MD (53 | GPIO_ALT_FN_2_OUT)
263#define GPIO54_MMCCLK_MD (54 | GPIO_ALT_FN_1_OUT)
264#define GPIO54_nPCE_2_MD (54 | GPIO_ALT_FN_2_OUT)
265#define GPIO54_pSKTSEL_MD (54 | GPIO_ALT_FN_2_OUT)
266#define GPIO54_CIF_PCLK_MD (54 | GPIO_ALT_FN_3_IN)
267#define GPIO55_nPREG_MD (55 | GPIO_ALT_FN_2_OUT)
268#define GPIO55_CIF_DD_1_MD (55 | GPIO_ALT_FN_1_IN)
269#define GPIO56_nPWAIT_MD (56 | GPIO_ALT_FN_1_IN)
270#define GPIO57_nIOIS16_MD (57 | GPIO_ALT_FN_1_IN)
271#define GPIO58_LDD_0_MD (58 | GPIO_ALT_FN_2_OUT)
272#define GPIO59_LDD_1_MD (59 | GPIO_ALT_FN_2_OUT)
273#define GPIO60_LDD_2_MD (60 | GPIO_ALT_FN_2_OUT)
274#define GPIO61_LDD_3_MD (61 | GPIO_ALT_FN_2_OUT)
275#define GPIO62_LDD_4_MD (62 | GPIO_ALT_FN_2_OUT)
276#define GPIO63_LDD_5_MD (63 | GPIO_ALT_FN_2_OUT)
277#define GPIO64_LDD_6_MD (64 | GPIO_ALT_FN_2_OUT)
278#define GPIO65_LDD_7_MD (65 | GPIO_ALT_FN_2_OUT)
279#define GPIO66_LDD_8_MD (66 | GPIO_ALT_FN_2_OUT)
280#define GPIO66_MBREQ_MD (66 | GPIO_ALT_FN_1_IN)
281#define GPIO67_LDD_9_MD (67 | GPIO_ALT_FN_2_OUT)
282#define GPIO67_MMCCS0_MD (67 | GPIO_ALT_FN_1_OUT)
283#define GPIO68_LDD_10_MD (68 | GPIO_ALT_FN_2_OUT)
284#define GPIO68_MMCCS1_MD (68 | GPIO_ALT_FN_1_OUT)
285#define GPIO69_LDD_11_MD (69 | GPIO_ALT_FN_2_OUT)
286#define GPIO69_MMCCLK_MD (69 | GPIO_ALT_FN_1_OUT)
287#define GPIO70_LDD_12_MD (70 | GPIO_ALT_FN_2_OUT)
288#define GPIO70_RTCCLK_MD (70 | GPIO_ALT_FN_1_OUT)
289#define GPIO71_LDD_13_MD (71 | GPIO_ALT_FN_2_OUT)
290#define GPIO71_3_6MHz_MD (71 | GPIO_ALT_FN_1_OUT)
291#define GPIO72_LDD_14_MD (72 | GPIO_ALT_FN_2_OUT)
292#define GPIO72_32kHz_MD (72 | GPIO_ALT_FN_1_OUT)
293#define GPIO73_LDD_15_MD (73 | GPIO_ALT_FN_2_OUT)
294#define GPIO73_MBGNT_MD (73 | GPIO_ALT_FN_1_OUT)
295#define GPIO74_LCD_FCLK_MD (74 | GPIO_ALT_FN_2_OUT)
296#define GPIO75_LCD_LCLK_MD (75 | GPIO_ALT_FN_2_OUT)
297#define GPIO76_LCD_PCLK_MD (76 | GPIO_ALT_FN_2_OUT)
298#define GPIO77_LCD_ACBIAS_MD (77 | GPIO_ALT_FN_2_OUT)
299#define GPIO78_nCS_2_MD (78 | GPIO_ALT_FN_2_OUT)
300#define GPIO78_nPCE_2_MD (78 | GPIO_ALT_FN_1_OUT)
301#define GPIO79_nCS_3_MD (79 | GPIO_ALT_FN_2_OUT)
302#define GPIO79_pSKTSEL_MD (79 | GPIO_ALT_FN_1_OUT)
303#define GPIO80_nCS_4_MD (80 | GPIO_ALT_FN_2_OUT)
304#define GPIO81_NSSP_CLK_OUT (81 | GPIO_ALT_FN_1_OUT)
305#define GPIO81_NSSP_CLK_IN (81 | GPIO_ALT_FN_1_IN)
306#define GPIO81_CIF_DD_0_MD (81 | GPIO_ALT_FN_2_IN)
307#define GPIO82_NSSP_FRM_OUT (82 | GPIO_ALT_FN_1_OUT)
308#define GPIO82_NSSP_FRM_IN (82 | GPIO_ALT_FN_1_IN)
309#define GPIO82_CIF_DD_5_MD (82 | GPIO_ALT_FN_3_IN)
310#define GPIO83_NSSP_TX (83 | GPIO_ALT_FN_1_OUT)
311#define GPIO83_NSSP_RX (83 | GPIO_ALT_FN_2_IN)
312#define GPIO83_CIF_DD_4_MD (83 | GPIO_ALT_FN_3_IN)
313#define GPIO84_NSSP_TX (84 | GPIO_ALT_FN_1_OUT)
314#define GPIO84_NSSP_RX (84 | GPIO_ALT_FN_2_IN)
315#define GPIO84_CIF_FV_MD (84 | GPIO_ALT_FN_3_IN)
316#define GPIO85_nPCE_1_MD (85 | GPIO_ALT_FN_1_OUT)
317#define GPIO85_CIF_LV_MD (85 | GPIO_ALT_FN_3_IN)
318#define GPIO86_nPCE_1_MD (86 | GPIO_ALT_FN_1_OUT)
319#define GPIO90_CIF_DD_4_MD (90 | GPIO_ALT_FN_3_IN)
320#define GPIO91_CIF_DD_5_MD (91 | GPIO_ALT_FN_3_IN)
321#define GPIO92_MMCDAT0_MD (92 | GPIO_ALT_FN_1_OUT)
322#define GPIO93_CIF_DD_6_MD (93 | GPIO_ALT_FN_2_IN)
323#define GPIO94_CIF_DD_5_MD (94 | GPIO_ALT_FN_2_IN)
324#define GPIO95_CIF_DD_4_MD (95 | GPIO_ALT_FN_2_IN)
325#define GPIO95_KP_MKIN6_MD (95 | GPIO_ALT_FN_3_IN)
326#define GPIO96_KP_DKIN3_MD (96 | GPIO_ALT_FN_1_IN)
327#define GPIO97_KP_MKIN3_MD (97 | GPIO_ALT_FN_3_IN)
328#define GPIO98_CIF_DD_0_MD (98 | GPIO_ALT_FN_2_IN)
329#define GPIO100_KP_MKIN0_MD (100 | GPIO_ALT_FN_1_IN)
330#define GPIO101_KP_MKIN1_MD (101 | GPIO_ALT_FN_1_IN)
331#define GPIO102_nPCE_1_MD (102 | GPIO_ALT_FN_1_OUT)
332#define GPIO102_KP_MKIN2_MD (102 | GPIO_ALT_FN_1_IN)
333#define GPIO103_CIF_DD_3_MD (103 | GPIO_ALT_FN_1_IN)
334#define GPIO103_KP_MKOUT0_MD (103 | GPIO_ALT_FN_2_OUT)
335#define GPIO104_CIF_DD_2_MD (104 | GPIO_ALT_FN_1_IN)
336#define GPIO104_pSKTSEL_MD (104 | GPIO_ALT_FN_1_OUT)
337#define GPIO104_KP_MKOUT1_MD (104 | GPIO_ALT_FN_2_OUT)
338#define GPIO105_CIF_DD_1_MD (105 | GPIO_ALT_FN_1_IN)
339#define GPIO105_KP_MKOUT2_MD (105 | GPIO_ALT_FN_2_OUT)
340#define GPIO106_CIF_DD_9_MD (106 | GPIO_ALT_FN_1_IN)
341#define GPIO106_KP_MKOUT3_MD (106 | GPIO_ALT_FN_2_OUT)
342#define GPIO107_CIF_DD_8_MD (107 | GPIO_ALT_FN_1_IN)
343#define GPIO107_KP_MKOUT4_MD (107 | GPIO_ALT_FN_2_OUT)
344#define GPIO108_CIF_DD_7_MD (108 | GPIO_ALT_FN_1_IN)
345#define GPIO108_KP_MKOUT5_MD (108 | GPIO_ALT_FN_2_OUT)
346#define GPIO109_MMCDAT1_MD (109 | GPIO_ALT_FN_1_OUT)
347#define GPIO110_MMCDAT2_MD (110 | GPIO_ALT_FN_1_OUT)
348#define GPIO110_MMCCS0_MD (110 | GPIO_ALT_FN_1_OUT)
349#define GPIO111_MMCDAT3_MD (111 | GPIO_ALT_FN_1_OUT)
350#define GPIO110_MMCCS1_MD (111 | GPIO_ALT_FN_1_OUT)
351#define GPIO112_MMCCMD_MD (112 | GPIO_ALT_FN_1_OUT)
352#define GPIO113_I2S_SYSCLK_MD (113 | GPIO_ALT_FN_1_OUT)
353#define GPIO113_AC97_RESET_N_MD (113 | GPIO_ALT_FN_2_OUT)
354#define GPIO117_I2CSCL_MD (117 | GPIO_ALT_FN_1_IN)
355#define GPIO118_I2CSDA_MD (118 | GPIO_ALT_FN_1_IN)
356
357#endif /* __ASM_ARCH_PXA2XX_GPIO_H */
diff --git a/include/asm-arm/arch-pxa/pxa3xx-regs.h b/include/asm-arm/arch-pxa/pxa3xx-regs.h
index 8e1b3ead827f..fe9364c83a28 100644
--- a/include/asm-arm/arch-pxa/pxa3xx-regs.h
+++ b/include/asm-arm/arch-pxa/pxa3xx-regs.h
@@ -12,6 +12,15 @@
12 12
13#ifndef __ASM_ARCH_PXA3XX_REGS_H 13#ifndef __ASM_ARCH_PXA3XX_REGS_H
14#define __ASM_ARCH_PXA3XX_REGS_H 14#define __ASM_ARCH_PXA3XX_REGS_H
15
16/*
17 * Oscillator Configuration Register (OSCC)
18 */
19#define OSCC __REG(0x41350000) /* Oscillator Configuration Register */
20
21#define OSCC_PEN (1 << 11) /* 13MHz POUT */
22
23
15/* 24/*
16 * Service Power Management Unit (MPMU) 25 * Service Power Management Unit (MPMU)
17 */ 26 */
diff --git a/include/asm-arm/arch-pxa/tosa.h b/include/asm-arm/arch-pxa/tosa.h
index c05e4faf85a6..c5b6fde6907c 100644
--- a/include/asm-arm/arch-pxa/tosa.h
+++ b/include/asm-arm/arch-pxa/tosa.h
@@ -23,11 +23,12 @@
23/* 23/*
24 * SCOOP2 internal GPIOs 24 * SCOOP2 internal GPIOs
25 */ 25 */
26#define TOSA_SCOOP_GPIO_BASE NR_BUILTIN_GPIO
26#define TOSA_SCOOP_PXA_VCORE1 SCOOP_GPCR_PA11 27#define TOSA_SCOOP_PXA_VCORE1 SCOOP_GPCR_PA11
27#define TOSA_SCOOP_TC6393_REST_IN SCOOP_GPCR_PA12 28#define TOSA_SCOOP_TC6393_REST_IN SCOOP_GPCR_PA12
28#define TOSA_SCOOP_IR_POWERDWN SCOOP_GPCR_PA13 29#define TOSA_GPIO_IR_POWERDWN (TOSA_SCOOP_GPIO_BASE + 2)
29#define TOSA_SCOOP_SD_WP SCOOP_GPCR_PA14 30#define TOSA_GPIO_SD_WP (TOSA_SCOOP_GPIO_BASE + 3)
30#define TOSA_SCOOP_PWR_ON SCOOP_GPCR_PA15 31#define TOSA_GPIO_PWR_ON (TOSA_SCOOP_GPIO_BASE + 4)
31#define TOSA_SCOOP_AUD_PWR_ON SCOOP_GPCR_PA16 32#define TOSA_SCOOP_AUD_PWR_ON SCOOP_GPCR_PA16
32#define TOSA_SCOOP_BT_RESET SCOOP_GPCR_PA17 33#define TOSA_SCOOP_BT_RESET SCOOP_GPCR_PA17
33#define TOSA_SCOOP_BT_PWR_EN SCOOP_GPCR_PA18 34#define TOSA_SCOOP_BT_PWR_EN SCOOP_GPCR_PA18
@@ -35,7 +36,7 @@
35 36
36/* GPIO Direction 1 : output mode / 0:input mode */ 37/* GPIO Direction 1 : output mode / 0:input mode */
37#define TOSA_SCOOP_IO_DIR ( TOSA_SCOOP_PXA_VCORE1 | TOSA_SCOOP_TC6393_REST_IN | \ 38#define TOSA_SCOOP_IO_DIR ( TOSA_SCOOP_PXA_VCORE1 | TOSA_SCOOP_TC6393_REST_IN | \
38 TOSA_SCOOP_IR_POWERDWN | TOSA_SCOOP_PWR_ON | TOSA_SCOOP_AUD_PWR_ON |\ 39 TOSA_SCOOP_AUD_PWR_ON |\
39 TOSA_SCOOP_BT_RESET | TOSA_SCOOP_BT_PWR_EN ) 40 TOSA_SCOOP_BT_RESET | TOSA_SCOOP_BT_PWR_EN )
40/* GPIO out put level when init 1: Hi */ 41/* GPIO out put level when init 1: Hi */
41#define TOSA_SCOOP_IO_OUT ( TOSA_SCOOP_TC6393_REST_IN ) 42#define TOSA_SCOOP_IO_OUT ( TOSA_SCOOP_TC6393_REST_IN )
@@ -43,23 +44,21 @@
43/* 44/*
44 * SCOOP2 jacket GPIOs 45 * SCOOP2 jacket GPIOs
45 */ 46 */
46#define TOSA_SCOOP_JC_BT_LED SCOOP_GPCR_PA11 47#define TOSA_SCOOP_JC_GPIO_BASE (NR_BUILTIN_GPIO + 12)
47#define TOSA_SCOOP_JC_NOTE_LED SCOOP_GPCR_PA12 48#define TOSA_GPIO_BT_LED (TOSA_SCOOP_JC_GPIO_BASE + 0)
48#define TOSA_SCOOP_JC_CHRG_ERR_LED SCOOP_GPCR_PA13 49#define TOSA_GPIO_NOTE_LED (TOSA_SCOOP_JC_GPIO_BASE + 1)
49#define TOSA_SCOOP_JC_USB_PULLUP SCOOP_GPCR_PA14 50#define TOSA_GPIO_CHRG_ERR_LED (TOSA_SCOOP_JC_GPIO_BASE + 2)
51#define TOSA_GPIO_USB_PULLUP (TOSA_SCOOP_JC_GPIO_BASE + 3)
50#define TOSA_SCOOP_JC_TC6393_SUSPEND SCOOP_GPCR_PA15 52#define TOSA_SCOOP_JC_TC6393_SUSPEND SCOOP_GPCR_PA15
51#define TOSA_SCOOP_JC_TC3693_L3V_ON SCOOP_GPCR_PA16 53#define TOSA_SCOOP_JC_TC3693_L3V_ON SCOOP_GPCR_PA16
52#define TOSA_SCOOP_JC_WLAN_DETECT SCOOP_GPCR_PA17 54#define TOSA_SCOOP_JC_WLAN_DETECT SCOOP_GPCR_PA17
53#define TOSA_SCOOP_JC_WLAN_LED SCOOP_GPCR_PA18 55#define TOSA_GPIO_WLAN_LED (TOSA_SCOOP_JC_GPIO_BASE + 7)
54#define TOSA_SCOOP_JC_CARD_LIMIT_SEL SCOOP_GPCR_PA19 56#define TOSA_SCOOP_JC_CARD_LIMIT_SEL SCOOP_GPCR_PA19
55 57
56/* GPIO Direction 1 : output mode / 0:input mode */ 58/* GPIO Direction 1 : output mode / 0:input mode */
57#define TOSA_SCOOP_JC_IO_DIR ( TOSA_SCOOP_JC_BT_LED | TOSA_SCOOP_JC_NOTE_LED | \ 59#define TOSA_SCOOP_JC_IO_DIR ( \
58 TOSA_SCOOP_JC_CHRG_ERR_LED | TOSA_SCOOP_JC_USB_PULLUP | \
59 TOSA_SCOOP_JC_TC6393_SUSPEND | TOSA_SCOOP_JC_TC3693_L3V_ON | \ 60 TOSA_SCOOP_JC_TC6393_SUSPEND | TOSA_SCOOP_JC_TC3693_L3V_ON | \
60 TOSA_SCOOP_JC_WLAN_LED | TOSA_SCOOP_JC_CARD_LIMIT_SEL ) 61 TOSA_SCOOP_JC_CARD_LIMIT_SEL )
61/* GPIO out put level when init 1: Hi */
62#define TOSA_SCOOP_JC_IO_OUT ( 0 )
63 62
64/* 63/*
65 * Timing Generator 64 * Timing Generator
@@ -74,15 +73,6 @@
74#define TG_HPOSCTL 0x07 73#define TG_HPOSCTL 0x07
75 74
76/* 75/*
77 * LED
78 */
79#define TOSA_SCOOP_LED_BLUE TOSA_SCOOP_GPCR_PA11
80#define TOSA_SCOOP_LED_GREEN TOSA_SCOOP_GPCR_PA12
81#define TOSA_SCOOP_LED_ORANGE TOSA_SCOOP_GPCR_PA13
82#define TOSA_SCOOP_LED_WLAN TOSA_SCOOP_GPCR_PA18
83
84
85/*
86 * PXA GPIOs 76 * PXA GPIOs
87 */ 77 */
88#define TOSA_GPIO_POWERON (0) 78#define TOSA_GPIO_POWERON (0)
@@ -161,12 +151,8 @@
161 151
162#define TOSA_IRQ_GPIO_MAIN_BAT_LOW IRQ_GPIO(TOSA_GPIO_MAIN_BAT_LOW) 152#define TOSA_IRQ_GPIO_MAIN_BAT_LOW IRQ_GPIO(TOSA_GPIO_MAIN_BAT_LOW)
163 153
164extern struct platform_device tosascoop_jc_device;
165extern struct platform_device tosascoop_device;
166
167#define TOSA_KEY_SYNC KEY_102ND /* ??? */ 154#define TOSA_KEY_SYNC KEY_102ND /* ??? */
168 155
169
170#ifndef CONFIG_KEYBOARD_TOSA_USE_EXT_KEYCODES 156#ifndef CONFIG_KEYBOARD_TOSA_USE_EXT_KEYCODES
171#define TOSA_KEY_RECORD KEY_YEN 157#define TOSA_KEY_RECORD KEY_YEN
172#define TOSA_KEY_ADDRESSBOOK KEY_KATAKANA 158#define TOSA_KEY_ADDRESSBOOK KEY_KATAKANA
diff --git a/include/asm-arm/arch-pxa/zylonite.h b/include/asm-arm/arch-pxa/zylonite.h
index 5f717d64ea7d..4881b80f0f90 100644
--- a/include/asm-arm/arch-pxa/zylonite.h
+++ b/include/asm-arm/arch-pxa/zylonite.h
@@ -18,6 +18,8 @@ extern struct platform_mmc_slot zylonite_mmc_slot[];
18extern int gpio_backlight; 18extern int gpio_backlight;
19extern int gpio_eth_irq; 19extern int gpio_eth_irq;
20 20
21extern int wm9713_irq;
22
21extern int lcd_id; 23extern int lcd_id;
22extern int lcd_orientation; 24extern int lcd_orientation;
23 25
diff --git a/include/asm-arm/arch-realview/board-eb.h b/include/asm-arm/arch-realview/board-eb.h
index 3e437b7f425a..206f7a752882 100644
--- a/include/asm-arm/arch-realview/board-eb.h
+++ b/include/asm-arm/arch-realview/board-eb.h
@@ -26,6 +26,26 @@
26/* 26/*
27 * RealView EB + ARM11MPCore peripheral addresses 27 * RealView EB + ARM11MPCore peripheral addresses
28 */ 28 */
29#define REALVIEW_EB_UART0_BASE 0x10009000 /* UART 0 */
30#define REALVIEW_EB_UART1_BASE 0x1000A000 /* UART 1 */
31#define REALVIEW_EB_UART2_BASE 0x1000B000 /* UART 2 */
32#define REALVIEW_EB_UART3_BASE 0x1000C000 /* UART 3 */
33#define REALVIEW_EB_SSP_BASE 0x1000D000 /* Synchronous Serial Port */
34#define REALVIEW_EB_WATCHDOG_BASE 0x10010000 /* watchdog interface */
35#define REALVIEW_EB_TIMER0_1_BASE 0x10011000 /* Timer 0 and 1 */
36#define REALVIEW_EB_TIMER2_3_BASE 0x10012000 /* Timer 2 and 3 */
37#define REALVIEW_EB_GPIO0_BASE 0x10013000 /* GPIO port 0 */
38#define REALVIEW_EB_RTC_BASE 0x10017000 /* Real Time Clock */
39#define REALVIEW_EB_CLCD_BASE 0x10020000 /* CLCD */
40#define REALVIEW_EB_GIC_CPU_BASE 0x10040000 /* Generic interrupt controller CPU interface */
41#define REALVIEW_EB_GIC_DIST_BASE 0x10041000 /* Generic interrupt controller distributor */
42#define REALVIEW_EB_SMC_BASE 0x10080000 /* Static memory controller */
43
44#define REALVIEW_EB_FLASH_BASE 0x40000000
45#define REALVIEW_EB_FLASH_SIZE SZ_64M
46#define REALVIEW_EB_ETH_BASE 0x4E000000 /* Ethernet */
47#define REALVIEW_EB_USB_BASE 0x4F000000 /* USB */
48
29#ifdef CONFIG_REALVIEW_EB_ARM11MP_REVB 49#ifdef CONFIG_REALVIEW_EB_ARM11MP_REVB
30#define REALVIEW_EB11MP_SCU_BASE 0x10100000 /* SCU registers */ 50#define REALVIEW_EB11MP_SCU_BASE 0x10100000 /* SCU registers */
31#define REALVIEW_EB11MP_GIC_CPU_BASE 0x10100100 /* Generic interrupt controller CPU interface */ 51#define REALVIEW_EB11MP_GIC_CPU_BASE 0x10100100 /* Generic interrupt controller CPU interface */
diff --git a/include/asm-arm/arch-realview/board-pb1176.h b/include/asm-arm/arch-realview/board-pb1176.h
new file mode 100644
index 000000000000..48ce9c833705
--- /dev/null
+++ b/include/asm-arm/arch-realview/board-pb1176.h
@@ -0,0 +1,152 @@
1/*
2 * include/asm-arm/arch-realview/board-pb1176.h
3 *
4 * Copyright (C) 2008 ARM Limited
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
18 * MA 02110-1301, USA.
19 */
20
21#ifndef __ASM_ARCH_BOARD_PB1176_H
22#define __ASM_ARCH_BOARD_PB1176_H
23
24#include <asm/arch/platform.h>
25
26/*
27 * Peripheral addresses
28 */
29#define REALVIEW_PB1176_SCTL_BASE 0x10100000 /* System controller */
30#define REALVIEW_PB1176_SMC_BASE 0x10111000 /* SMC */
31#define REALVIEW_PB1176_DMC_BASE 0x10109000 /* DMC configuration */
32#define REALVIEW_PB1176_SDRAM67_BASE 0x70000000 /* SDRAM banks 6 and 7 */
33#define REALVIEW_PB1176_FLASH_BASE 0x30000000
34#define REALVIEW_PB1176_FLASH_SIZE SZ_64M
35
36#define REALVIEW_PB1176_TIMER0_1_BASE 0x10104000 /* Timer 0 and 1 */
37#define REALVIEW_PB1176_TIMER2_3_BASE 0x10105000 /* Timer 2 and 3 */
38#define REALVIEW_PB1176_TIMER4_5_BASE 0x10106000 /* Timer 4 and 5 */
39#define REALVIEW_PB1176_WATCHDOG_BASE 0x10107000 /* watchdog interface */
40#define REALVIEW_PB1176_RTC_BASE 0x10108000 /* Real Time Clock */
41#define REALVIEW_PB1176_GPIO0_BASE 0x1010A000 /* GPIO port 0 */
42#define REALVIEW_PB1176_SSP_BASE 0x1010B000 /* Synchronous Serial Port */
43#define REALVIEW_PB1176_UART0_BASE 0x1010C000 /* UART 0 */
44#define REALVIEW_PB1176_UART1_BASE 0x1010D000 /* UART 1 */
45#define REALVIEW_PB1176_UART2_BASE 0x1010E000 /* UART 2 */
46#define REALVIEW_PB1176_UART3_BASE 0x1010F000 /* UART 3 */
47#define REALVIEW_PB1176_CLCD_BASE 0x10112000 /* CLCD */
48#define REALVIEW_PB1176_ETH_BASE 0x3A000000 /* Ethernet */
49#define REALVIEW_PB1176_USB_BASE 0x3B000000 /* USB */
50
51/*
52 * PCI regions
53 */
54#define REALVIEW_PB1176_PCI_BASE 0x60000000 /* PCI self config */
55#define REALVIEW_PB1176_PCI_CFG_BASE 0x61000000 /* PCI config */
56#define REALVIEW_PB1176_PCI_IO_BASE0 0x62000000 /* PCI IO region */
57#define REALVIEW_PB1176_PCI_MEM_BASE0 0x63000000 /* Memory region 1 */
58#define REALVIEW_PB1176_PCI_MEM_BASE1 0x64000000 /* Memory region 2 */
59#define REALVIEW_PB1176_PCI_MEM_BASE2 0x68000000 /* Memory region 3 */
60
61#define REALVIEW_PB1176_PCI_BASE_SIZE 0x01000000 /* 16MB */
62#define REALVIEW_PB1176_PCI_CFG_BASE_SIZE 0x01000000 /* 16MB */
63#define REALVIEW_PB1176_PCI_IO_BASE0_SIZE 0x01000000 /* 16MB */
64#define REALVIEW_PB1176_PCI_MEM_BASE0_SIZE 0x01000000 /* 16MB */
65#define REALVIEW_PB1176_PCI_MEM_BASE1_SIZE 0x04000000 /* 64MB */
66#define REALVIEW_PB1176_PCI_MEM_BASE2_SIZE 0x08000000 /* 128MB */
67
68#define REALVIEW_DC1176_GIC_CPU_BASE 0x10120000 /* GIC CPU interface, on devchip */
69#define REALVIEW_DC1176_GIC_DIST_BASE 0x10121000 /* GIC distributor, on devchip */
70#define REALVIEW_PB1176_GIC_CPU_BASE 0x10040000 /* GIC CPU interface, on FPGA */
71#define REALVIEW_PB1176_GIC_DIST_BASE 0x10041000 /* GIC distributor, on FPGA */
72#define REALVIEW_PB1176_L220_BASE 0x10110000 /* L220 registers */
73
74/*
75 * Irqs
76 */
77#define IRQ_DC1176_GIC_START 32
78#define IRQ_PB1176_GIC_START 64
79
80/*
81 * ARM1176 DevChip interrupt sources (primary GIC)
82 */
83#define IRQ_DC1176_WATCHDOG (IRQ_DC1176_GIC_START + 0) /* Watchdog timer */
84#define IRQ_DC1176_SOFTINT (IRQ_DC1176_GIC_START + 1) /* Software interrupt */
85#define IRQ_DC1176_COMMRx (IRQ_DC1176_GIC_START + 2) /* Debug Comm Rx interrupt */
86#define IRQ_DC1176_COMMTx (IRQ_DC1176_GIC_START + 3) /* Debug Comm Tx interrupt */
87#define IRQ_DC1176_TIMER0 (IRQ_DC1176_GIC_START + 8) /* Timer 0 */
88#define IRQ_DC1176_TIMER1 (IRQ_DC1176_GIC_START + 9) /* Timer 1 */
89#define IRQ_DC1176_TIMER2 (IRQ_DC1176_GIC_START + 10) /* Timer 2 */
90#define IRQ_DC1176_APC (IRQ_DC1176_GIC_START + 11)
91#define IRQ_DC1176_IEC (IRQ_DC1176_GIC_START + 12)
92#define IRQ_DC1176_L2CC (IRQ_DC1176_GIC_START + 13)
93#define IRQ_DC1176_RTC (IRQ_DC1176_GIC_START + 14)
94#define IRQ_DC1176_CLCD (IRQ_DC1176_GIC_START + 15) /* CLCD controller */
95#define IRQ_DC1176_UART0 (IRQ_DC1176_GIC_START + 18) /* UART 0 on development chip */
96#define IRQ_DC1176_UART1 (IRQ_DC1176_GIC_START + 19) /* UART 1 on development chip */
97#define IRQ_DC1176_UART2 (IRQ_DC1176_GIC_START + 20) /* UART 2 on development chip */
98#define IRQ_DC1176_UART3 (IRQ_DC1176_GIC_START + 21) /* UART 3 on development chip */
99
100#define IRQ_DC1176_PB_IRQ2 (IRQ_DC1176_GIC_START + 30) /* tile GIC */
101#define IRQ_DC1176_PB_IRQ1 (IRQ_DC1176_GIC_START + 31) /* main GIC */
102
103/*
104 * RealView PB1176 interrupt sources (secondary GIC)
105 */
106#define IRQ_PB1176_MMCI0A (IRQ_PB1176_GIC_START + 1) /* Multimedia Card 0A */
107#define IRQ_PB1176_MMCI0B (IRQ_PB1176_GIC_START + 2) /* Multimedia Card 0A */
108#define IRQ_PB1176_KMI0 (IRQ_PB1176_GIC_START + 3) /* Keyboard/Mouse port 0 */
109#define IRQ_PB1176_KMI1 (IRQ_PB1176_GIC_START + 4) /* Keyboard/Mouse port 1 */
110#define IRQ_PB1176_SCI (IRQ_PB1176_GIC_START + 5)
111#define IRQ_PB1176_UART4 (IRQ_PB1176_GIC_START + 6) /* UART 4 on baseboard */
112#define IRQ_PB1176_CHARLCD (IRQ_PB1176_GIC_START + 7) /* Character LCD */
113#define IRQ_PB1176_GPIO1 (IRQ_PB1176_GIC_START + 8)
114#define IRQ_PB1176_GPIO2 (IRQ_PB1176_GIC_START + 9)
115#define IRQ_PB1176_ETH (IRQ_PB1176_GIC_START + 10) /* Ethernet controller */
116#define IRQ_PB1176_USB (IRQ_PB1176_GIC_START + 11) /* USB controller */
117
118#define IRQ_PB1176_PISMO (IRQ_PB1176_GIC_START + 16)
119
120#define IRQ_PB1176_AACI (IRQ_PB1176_GIC_START + 19) /* Audio Codec */
121
122#define IRQ_PB1176_TIMER0_1 (IRQ_PB1176_GIC_START + 22)
123#define IRQ_PB1176_TIMER2_3 (IRQ_PB1176_GIC_START + 23)
124#define IRQ_PB1176_DMAC (IRQ_PB1176_GIC_START + 24) /* DMA controller */
125#define IRQ_PB1176_RTC (IRQ_PB1176_GIC_START + 25) /* Real Time Clock */
126
127#define IRQ_PB1176_GPIO0 -1
128#define IRQ_PB1176_SSP -1
129#define IRQ_PB1176_SCTL -1
130
131#define NR_GIC_PB1176 2
132
133/*
134 * Only define NR_IRQS if less than NR_IRQS_PB1176
135 */
136#define NR_IRQS_PB1176 (IRQ_DC1176_GIC_START + 96)
137
138#if defined(CONFIG_MACH_REALVIEW_PB1176)
139
140#if !defined(NR_IRQS) || (NR_IRQS < NR_IRQS_PB1176)
141#undef NR_IRQS
142#define NR_IRQS NR_IRQS_PB1176
143#endif
144
145#if !defined(MAX_GIC_NR) || (MAX_GIC_NR < NR_GIC_PB1176)
146#undef MAX_GIC_NR
147#define MAX_GIC_NR NR_GIC_PB1176
148#endif
149
150#endif /* CONFIG_MACH_REALVIEW_PB1176 */
151
152#endif /* __ASM_ARCH_BOARD_PB1176_H */
diff --git a/include/asm-arm/arch-realview/board-pb11mp.h b/include/asm-arm/arch-realview/board-pb11mp.h
new file mode 100644
index 000000000000..a1294d915fa8
--- /dev/null
+++ b/include/asm-arm/arch-realview/board-pb11mp.h
@@ -0,0 +1,186 @@
1/*
2 * include/asm-arm/arch-realview/board-pb11mp.h
3 *
4 * Copyright (C) 2008 ARM Limited
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
18 * MA 02110-1301, USA.
19 */
20
21#ifndef __ASM_ARCH_BOARD_PB11MP_H
22#define __ASM_ARCH_BOARD_PB11MP_H
23
24#include <asm/arch/platform.h>
25
26/*
27 * Peripheral addresses
28 */
29#define REALVIEW_PB11MP_UART0_BASE 0x10009000 /* UART 0 */
30#define REALVIEW_PB11MP_UART1_BASE 0x1000A000 /* UART 1 */
31#define REALVIEW_PB11MP_UART2_BASE 0x1000B000 /* UART 2 */
32#define REALVIEW_PB11MP_UART3_BASE 0x1000C000 /* UART 3 */
33#define REALVIEW_PB11MP_SSP_BASE 0x1000D000 /* Synchronous Serial Port */
34#define REALVIEW_PB11MP_WATCHDOG0_BASE 0x1000F000 /* Watchdog 0 */
35#define REALVIEW_PB11MP_WATCHDOG_BASE 0x10010000 /* watchdog interface */
36#define REALVIEW_PB11MP_TIMER0_1_BASE 0x10011000 /* Timer 0 and 1 */
37#define REALVIEW_PB11MP_TIMER2_3_BASE 0x10012000 /* Timer 2 and 3 */
38#define REALVIEW_PB11MP_GPIO0_BASE 0x10013000 /* GPIO port 0 */
39#define REALVIEW_PB11MP_RTC_BASE 0x10017000 /* Real Time Clock */
40#define REALVIEW_PB11MP_TIMER4_5_BASE 0x10018000 /* Timer 4/5 */
41#define REALVIEW_PB11MP_TIMER6_7_BASE 0x10019000 /* Timer 6/7 */
42#define REALVIEW_PB11MP_SCTL_BASE 0x1001A000 /* System Controller */
43#define REALVIEW_PB11MP_CLCD_BASE 0x10020000 /* CLCD */
44#define REALVIEW_PB11MP_ONB_SRAM_BASE 0x10060000 /* On-board SRAM */
45#define REALVIEW_PB11MP_DMC_BASE 0x100E0000 /* DMC configuration */
46#define REALVIEW_PB11MP_SMC_BASE 0x100E1000 /* SMC configuration */
47#define REALVIEW_PB11MP_CAN_BASE 0x100E2000 /* CAN bus */
48#define REALVIEW_PB11MP_CF_BASE 0x18000000 /* Compact flash */
49#define REALVIEW_PB11MP_CF_MEM_BASE 0x18003000 /* SMC for Compact flash */
50#define REALVIEW_PB11MP_GIC_CPU_BASE 0x1E000000 /* Generic interrupt controller CPU interface */
51#define REALVIEW_PB11MP_FLASH0_BASE 0x40000000
52#define REALVIEW_PB11MP_FLASH0_SIZE SZ_64M
53#define REALVIEW_PB11MP_FLASH1_BASE 0x44000000
54#define REALVIEW_PB11MP_FLASH1_SIZE SZ_64M
55#define REALVIEW_PB11MP_ETH_BASE 0x4E000000 /* Ethernet */
56#define REALVIEW_PB11MP_USB_BASE 0x4F000000 /* USB */
57#define REALVIEW_PB11MP_GIC_DIST_BASE 0x1E001000 /* Generic interrupt controller distributor */
58#define REALVIEW_PB11MP_LT_BASE 0xC0000000 /* Logic Tile expansion */
59#define REALVIEW_PB11MP_SDRAM6_BASE 0x70000000 /* SDRAM bank 6 256MB */
60#define REALVIEW_PB11MP_SDRAM7_BASE 0x80000000 /* SDRAM bank 7 256MB */
61
62#define REALVIEW_PB11MP_SYS_PLD_CTRL1 0x74
63
64/*
65 * PB11MPCore PCI regions
66 */
67#define REALVIEW_PB11MP_PCI_BASE 0x90040000 /* PCI-X Unit base */
68#define REALVIEW_PB11MP_PCI_IO_BASE 0x90050000 /* IO Region on AHB */
69#define REALVIEW_PB11MP_PCI_MEM_BASE 0xA0000000 /* MEM Region on AHB */
70
71#define REALVIEW_PB11MP_PCI_BASE_SIZE 0x10000 /* 16 Kb */
72#define REALVIEW_PB11MP_PCI_IO_SIZE 0x1000 /* 4 Kb */
73#define REALVIEW_PB11MP_PCI_MEM_SIZE 0x20000000 /* 512 MB */
74
75/*
76 * Testchip peripheral and fpga gic regions
77 */
78#define REALVIEW_TC11MP_SCU_BASE 0x1F000000 /* IRQ, Test chip */
79#define REALVIEW_TC11MP_GIC_CPU_BASE 0x1F000100 /* Test chip interrupt controller CPU interface */
80#define REALVIEW_TC11MP_TWD_BASE 0x1F000700
81#define REALVIEW_TC11MP_TWD_SIZE 0x00000100
82#define REALVIEW_TC11MP_GIC_DIST_BASE 0x1F001000 /* Test chip interrupt controller distributor */
83#define REALVIEW_TC11MP_L220_BASE 0x1F002000 /* L220 registers */
84
85/*
86 * Irqs
87 */
88#define IRQ_TC11MP_GIC_START 32
89#define IRQ_PB11MP_GIC_START 64
90
91/*
92 * ARM11MPCore test chip interrupt sources (primary GIC on the test chip)
93 */
94#define IRQ_TC11MP_AACI (IRQ_TC11MP_GIC_START + 0)
95#define IRQ_TC11MP_TIMER0_1 (IRQ_TC11MP_GIC_START + 1)
96#define IRQ_TC11MP_TIMER2_3 (IRQ_TC11MP_GIC_START + 2)
97#define IRQ_TC11MP_USB (IRQ_TC11MP_GIC_START + 3)
98#define IRQ_TC11MP_UART0 (IRQ_TC11MP_GIC_START + 4)
99#define IRQ_TC11MP_UART1 (IRQ_TC11MP_GIC_START + 5)
100#define IRQ_TC11MP_RTC (IRQ_TC11MP_GIC_START + 6)
101#define IRQ_TC11MP_KMI0 (IRQ_TC11MP_GIC_START + 7)
102#define IRQ_TC11MP_KMI1 (IRQ_TC11MP_GIC_START + 8)
103#define IRQ_TC11MP_ETH (IRQ_TC11MP_GIC_START + 9)
104#define IRQ_TC11MP_PB_IRQ1 (IRQ_TC11MP_GIC_START + 10) /* main GIC */
105#define IRQ_TC11MP_PB_IRQ2 (IRQ_TC11MP_GIC_START + 11) /* tile GIC */
106#define IRQ_TC11MP_PB_FIQ1 (IRQ_TC11MP_GIC_START + 12) /* main GIC */
107#define IRQ_TC11MP_PB_FIQ2 (IRQ_TC11MP_GIC_START + 13) /* tile GIC */
108#define IRQ_TC11MP_MMCI0A (IRQ_TC11MP_GIC_START + 14)
109#define IRQ_TC11MP_MMCI0B (IRQ_TC11MP_GIC_START + 15)
110
111#define IRQ_TC11MP_PMU_CPU0 (IRQ_TC11MP_GIC_START + 17)
112#define IRQ_TC11MP_PMU_CPU1 (IRQ_TC11MP_GIC_START + 18)
113#define IRQ_TC11MP_PMU_CPU2 (IRQ_TC11MP_GIC_START + 19)
114#define IRQ_TC11MP_PMU_CPU3 (IRQ_TC11MP_GIC_START + 20)
115#define IRQ_TC11MP_PMU_SCU0 (IRQ_TC11MP_GIC_START + 21)
116#define IRQ_TC11MP_PMU_SCU1 (IRQ_TC11MP_GIC_START + 22)
117#define IRQ_TC11MP_PMU_SCU2 (IRQ_TC11MP_GIC_START + 23)
118#define IRQ_TC11MP_PMU_SCU3 (IRQ_TC11MP_GIC_START + 24)
119#define IRQ_TC11MP_PMU_SCU4 (IRQ_TC11MP_GIC_START + 25)
120#define IRQ_TC11MP_PMU_SCU5 (IRQ_TC11MP_GIC_START + 26)
121#define IRQ_TC11MP_PMU_SCU6 (IRQ_TC11MP_GIC_START + 27)
122#define IRQ_TC11MP_PMU_SCU7 (IRQ_TC11MP_GIC_START + 28)
123
124#define IRQ_TC11MP_L220_EVENT (IRQ_TC11MP_GIC_START + 29)
125#define IRQ_TC11MP_L220_SLAVE (IRQ_TC11MP_GIC_START + 30)
126#define IRQ_TC11MP_L220_DECODE (IRQ_TC11MP_GIC_START + 31)
127
128/*
129 * RealView PB11MPCore GIC interrupt sources (secondary GIC on the board)
130 */
131#define IRQ_PB11MP_WATCHDOG (IRQ_PB11MP_GIC_START + 0) /* Watchdog timer */
132#define IRQ_PB11MP_SOFT (IRQ_PB11MP_GIC_START + 1) /* Software interrupt */
133#define IRQ_PB11MP_COMMRx (IRQ_PB11MP_GIC_START + 2) /* Debug Comm Rx interrupt */
134#define IRQ_PB11MP_COMMTx (IRQ_PB11MP_GIC_START + 3) /* Debug Comm Tx interrupt */
135#define IRQ_PB11MP_GPIO0 (IRQ_PB11MP_GIC_START + 6) /* GPIO 0 */
136#define IRQ_PB11MP_GPIO1 (IRQ_PB11MP_GIC_START + 7) /* GPIO 1 */
137#define IRQ_PB11MP_GPIO2 (IRQ_PB11MP_GIC_START + 8) /* GPIO 2 */
138 /* 9 reserved */
139#define IRQ_PB11MP_RTC_GIC1 (IRQ_PB11MP_GIC_START + 10) /* Real Time Clock */
140#define IRQ_PB11MP_SSP (IRQ_PB11MP_GIC_START + 11) /* Synchronous Serial Port */
141#define IRQ_PB11MP_UART0_GIC1 (IRQ_PB11MP_GIC_START + 12) /* UART 0 on development chip */
142#define IRQ_PB11MP_UART1_GIC1 (IRQ_PB11MP_GIC_START + 13) /* UART 1 on development chip */
143#define IRQ_PB11MP_UART2 (IRQ_PB11MP_GIC_START + 14) /* UART 2 on development chip */
144#define IRQ_PB11MP_UART3 (IRQ_PB11MP_GIC_START + 15) /* UART 3 on development chip */
145#define IRQ_PB11MP_SCI (IRQ_PB11MP_GIC_START + 16) /* Smart Card Interface */
146#define IRQ_PB11MP_MMCI0A_GIC1 (IRQ_PB11MP_GIC_START + 17) /* Multimedia Card 0A */
147#define IRQ_PB11MP_MMCI0B_GIC1 (IRQ_PB11MP_GIC_START + 18) /* Multimedia Card 0B */
148#define IRQ_PB11MP_AACI_GIC1 (IRQ_PB11MP_GIC_START + 19) /* Audio Codec */
149#define IRQ_PB11MP_KMI0_GIC1 (IRQ_PB11MP_GIC_START + 20) /* Keyboard/Mouse port 0 */
150#define IRQ_PB11MP_KMI1_GIC1 (IRQ_PB11MP_GIC_START + 21) /* Keyboard/Mouse port 1 */
151#define IRQ_PB11MP_CHARLCD (IRQ_PB11MP_GIC_START + 22) /* Character LCD */
152#define IRQ_PB11MP_CLCD (IRQ_PB11MP_GIC_START + 23) /* CLCD controller */
153#define IRQ_PB11MP_DMAC (IRQ_PB11MP_GIC_START + 24) /* DMA controller */
154#define IRQ_PB11MP_PWRFAIL (IRQ_PB11MP_GIC_START + 25) /* Power failure */
155#define IRQ_PB11MP_PISMO (IRQ_PB11MP_GIC_START + 26) /* PISMO interface */
156#define IRQ_PB11MP_DoC (IRQ_PB11MP_GIC_START + 27) /* Disk on Chip memory controller */
157#define IRQ_PB11MP_ETH_GIC1 (IRQ_PB11MP_GIC_START + 28) /* Ethernet controller */
158#define IRQ_PB11MP_USB_GIC1 (IRQ_PB11MP_GIC_START + 29) /* USB controller */
159#define IRQ_PB11MP_TSPEN (IRQ_PB11MP_GIC_START + 30) /* Touchscreen pen */
160#define IRQ_PB11MP_TSKPAD (IRQ_PB11MP_GIC_START + 31) /* Touchscreen keypad */
161
162#define IRQ_PB11MP_SMC -1
163#define IRQ_PB11MP_SCTL -1
164
165#define NR_GIC_PB11MP 2
166
167/*
168 * Only define NR_IRQS if less than NR_IRQS_PB11MP
169 */
170#define NR_IRQS_PB11MP (IRQ_TC11MP_GIC_START + 96)
171
172#if defined(CONFIG_MACH_REALVIEW_PB11MP)
173
174#if !defined(NR_IRQS) || (NR_IRQS < NR_IRQS_PB11MP)
175#undef NR_IRQS
176#define NR_IRQS NR_IRQS_PB11MP
177#endif
178
179#if !defined(MAX_GIC_NR) || (MAX_GIC_NR < NR_GIC_PB11MP)
180#undef MAX_GIC_NR
181#define MAX_GIC_NR NR_GIC_PB11MP
182#endif
183
184#endif /* CONFIG_MACH_REALVIEW_PB11MP */
185
186#endif /* __ASM_ARCH_BOARD_PB11MP_H */
diff --git a/include/asm-arm/arch-realview/debug-macro.S b/include/asm-arm/arch-realview/debug-macro.S
index f17efc65518a..c8c860c3c26e 100644
--- a/include/asm-arm/arch-realview/debug-macro.S
+++ b/include/asm-arm/arch-realview/debug-macro.S
@@ -15,7 +15,7 @@
15 mrc p15, 0, \rx, c1, c0 15 mrc p15, 0, \rx, c1, c0
16 tst \rx, #1 @ MMU enabled? 16 tst \rx, #1 @ MMU enabled?
17 moveq \rx, #0x10000000 17 moveq \rx, #0x10000000
18 movne \rx, #0xf1000000 @ virtual base 18 movne \rx, #0xf0000000 @ virtual base
19 orr \rx, \rx, #0x00009000 19 orr \rx, \rx, #0x00009000
20 .endm 20 .endm
21 21
diff --git a/include/asm-arm/arch-realview/hardware.h b/include/asm-arm/arch-realview/hardware.h
index bad8d7ce9bfe..1ee8313ceb6a 100644
--- a/include/asm-arm/arch-realview/hardware.h
+++ b/include/asm-arm/arch-realview/hardware.h
@@ -25,7 +25,7 @@
25#include <asm/sizes.h> 25#include <asm/sizes.h>
26 26
27/* macro to get at IO space when running virtually */ 27/* macro to get at IO space when running virtually */
28#define IO_ADDRESS(x) ((((x) & 0x0effffff) | (((x) >> 4) & 0x0f000000)) + 0xf0000000) 28#define IO_ADDRESS(x) (((x) & 0x0fffffff) + 0xf0000000)
29#define __io_address(n) __io(IO_ADDRESS(n)) 29#define __io_address(n) __io(IO_ADDRESS(n))
30 30
31#endif 31#endif
diff --git a/include/asm-arm/arch-realview/irqs.h b/include/asm-arm/arch-realview/irqs.h
index ad0c911002fc..ccbac59235c6 100644
--- a/include/asm-arm/arch-realview/irqs.h
+++ b/include/asm-arm/arch-realview/irqs.h
@@ -23,6 +23,8 @@
23#define __ASM_ARCH_IRQS_H 23#define __ASM_ARCH_IRQS_H
24 24
25#include <asm/arch/board-eb.h> 25#include <asm/arch/board-eb.h>
26#include <asm/arch/board-pb11mp.h>
27#include <asm/arch/board-pb1176.h>
26 28
27#define IRQ_LOCALTIMER 29 29#define IRQ_LOCALTIMER 29
28#define IRQ_LOCALWDOG 30 30#define IRQ_LOCALWDOG 30
diff --git a/include/asm-arm/arch-realview/platform.h b/include/asm-arm/arch-realview/platform.h
index 4fd351b5e4a2..424c0aaf46a0 100644
--- a/include/asm-arm/arch-realview/platform.h
+++ b/include/asm-arm/arch-realview/platform.h
@@ -32,9 +32,6 @@
32#define REALVIEW_SSRAM_BASE /* REALVIEW_SSMC_BASE ? */ 32#define REALVIEW_SSRAM_BASE /* REALVIEW_SSMC_BASE ? */
33#define REALVIEW_SSRAM_SIZE SZ_2M 33#define REALVIEW_SSRAM_SIZE SZ_2M
34 34
35#define REALVIEW_FLASH_BASE 0x40000000
36#define REALVIEW_FLASH_SIZE SZ_64M
37
38/* 35/*
39 * SDRAM 36 * SDRAM
40 */ 37 */
@@ -175,42 +172,20 @@
175#define REALVIEW_INTREG_CARDINSERT 0x03 /* Signal insertion of MMC card */ 172#define REALVIEW_INTREG_CARDINSERT 0x03 /* Signal insertion of MMC card */
176 173
177/* 174/*
178 * REALVIEW peripheral addresses 175 * RealView common peripheral addresses
179 */ 176 */
180#define REALVIEW_SCTL_BASE 0x10001000 /* System controller */ 177#define REALVIEW_SCTL_BASE 0x10001000 /* System controller */
181#define REALVIEW_I2C_BASE 0x10002000 /* I2C control */ 178#define REALVIEW_I2C_BASE 0x10002000 /* I2C control */
182 /* Reserved 0x10003000 */
183#define REALVIEW_AACI_BASE 0x10004000 /* Audio */ 179#define REALVIEW_AACI_BASE 0x10004000 /* Audio */
184#define REALVIEW_MMCI0_BASE 0x10005000 /* MMC interface */ 180#define REALVIEW_MMCI0_BASE 0x10005000 /* MMC interface */
185#define REALVIEW_KMI0_BASE 0x10006000 /* KMI interface */ 181#define REALVIEW_KMI0_BASE 0x10006000 /* KMI interface */
186#define REALVIEW_KMI1_BASE 0x10007000 /* KMI 2nd interface */ 182#define REALVIEW_KMI1_BASE 0x10007000 /* KMI 2nd interface */
187#define REALVIEW_CHAR_LCD_BASE 0x10008000 /* Character LCD */ 183#define REALVIEW_CHAR_LCD_BASE 0x10008000 /* Character LCD */
188#define REALVIEW_UART0_BASE 0x10009000 /* UART 0 */
189#define REALVIEW_UART1_BASE 0x1000A000 /* UART 1 */
190#define REALVIEW_UART2_BASE 0x1000B000 /* UART 2 */
191#define REALVIEW_UART3_BASE 0x1000C000 /* UART 3 */
192#define REALVIEW_SSP_BASE 0x1000D000 /* Synchronous Serial Port */
193#define REALVIEW_SCI_BASE 0x1000E000 /* Smart card controller */ 184#define REALVIEW_SCI_BASE 0x1000E000 /* Smart card controller */
194 /* Reserved 0x1000F000 */
195#define REALVIEW_WATCHDOG_BASE 0x10010000 /* watchdog interface */
196#define REALVIEW_TIMER0_1_BASE 0x10011000 /* Timer 0 and 1 */
197#define REALVIEW_TIMER2_3_BASE 0x10012000 /* Timer 2 and 3 */
198#define REALVIEW_GPIO0_BASE 0x10013000 /* GPIO port 0 */
199#define REALVIEW_GPIO1_BASE 0x10014000 /* GPIO port 1 */ 185#define REALVIEW_GPIO1_BASE 0x10014000 /* GPIO port 1 */
200#define REALVIEW_GPIO2_BASE 0x10015000 /* GPIO port 2 */ 186#define REALVIEW_GPIO2_BASE 0x10015000 /* GPIO port 2 */
201 /* Reserved 0x10016000 */
202#define REALVIEW_RTC_BASE 0x10017000 /* Real Time Clock */
203#define REALVIEW_DMC_BASE 0x10018000 /* DMC configuration */ 187#define REALVIEW_DMC_BASE 0x10018000 /* DMC configuration */
204#define REALVIEW_PCI_CORE_BASE 0x10019000 /* PCI configuration */
205 /* Reserved 0x1001A000 - 0x1001FFFF */
206#define REALVIEW_CLCD_BASE 0x10020000 /* CLCD */
207#define REALVIEW_DMAC_BASE 0x10030000 /* DMA controller */ 188#define REALVIEW_DMAC_BASE 0x10030000 /* DMA controller */
208#define REALVIEW_GIC_CPU_BASE 0x10040000 /* Generic interrupt controller CPU interface */
209#define REALVIEW_GIC_DIST_BASE 0x10041000 /* Generic interrupt controller distributor */
210#define REALVIEW_SMC_BASE 0x10080000 /* SMC */
211 /* Reserved 0x10090000 - 0x100EFFFF */
212
213#define REALVIEW_ETH_BASE 0x4E000000 /* Ethernet */
214 189
215/* PCI space */ 190/* PCI space */
216#define REALVIEW_PCI_BASE 0x41000000 /* PCI Interface */ 191#define REALVIEW_PCI_BASE 0x41000000 /* PCI Interface */
diff --git a/include/asm-arm/arch-realview/scu.h b/include/asm-arm/arch-realview/scu.h
index 08b3db883c36..d55802d645af 100644
--- a/include/asm-arm/arch-realview/scu.h
+++ b/include/asm-arm/arch-realview/scu.h
@@ -1,8 +1,13 @@
1#ifndef __ASMARM_ARCH_SCU_H 1#ifndef __ASMARM_ARCH_SCU_H
2#define __ASMARM_ARCH_SCU_H 2#define __ASMARM_ARCH_SCU_H
3 3
4#include <asm/arch/board-eb.h> 4/*
5 5 * SCU registers
6#define SCU_BASE REALVIEW_EB11MP_SCU_BASE 6 */
7#define SCU_CTRL 0x00
8#define SCU_CONFIG 0x04
9#define SCU_CPU_STATUS 0x08
10#define SCU_INVALIDATE 0x0c
11#define SCU_FPGA_REVISION 0x10
7 12
8#endif 13#endif
diff --git a/include/asm-arm/arch-realview/uncompress.h b/include/asm-arm/arch-realview/uncompress.h
index 3d5c2db07a26..4c905d7a13a1 100644
--- a/include/asm-arm/arch-realview/uncompress.h
+++ b/include/asm-arm/arch-realview/uncompress.h
@@ -18,28 +18,50 @@
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */ 19 */
20#include <asm/hardware.h> 20#include <asm/hardware.h>
21#include <asm/mach-types.h>
21 22
22#include <asm/arch/platform.h> 23#include <asm/arch/board-eb.h>
24#include <asm/arch/board-pb11mp.h>
25#include <asm/arch/board-pb1176.h>
23 26
24#define AMBA_UART_DR (*(volatile unsigned char *) (REALVIEW_UART0_BASE + 0x00)) 27#define AMBA_UART_DR(base) (*(volatile unsigned char *)((base) + 0x00))
25#define AMBA_UART_LCRH (*(volatile unsigned char *) (REALVIEW_UART0_BASE + 0x2c)) 28#define AMBA_UART_LCRH(base) (*(volatile unsigned char *)((base) + 0x2c))
26#define AMBA_UART_CR (*(volatile unsigned char *) (REALVIEW_UART0_BASE + 0x30)) 29#define AMBA_UART_CR(base) (*(volatile unsigned char *)((base) + 0x30))
27#define AMBA_UART_FR (*(volatile unsigned char *) (REALVIEW_UART0_BASE + 0x18)) 30#define AMBA_UART_FR(base) (*(volatile unsigned char *)((base) + 0x18))
31
32/*
33 * Return the UART base address
34 */
35static inline unsigned long get_uart_base(void)
36{
37 if (machine_is_realview_eb())
38 return REALVIEW_EB_UART0_BASE;
39 else if (machine_is_realview_pb11mp())
40 return REALVIEW_PB11MP_UART0_BASE;
41 else if (machine_is_realview_pb1176())
42 return REALVIEW_PB1176_UART0_BASE;
43 else
44 return 0;
45}
28 46
29/* 47/*
30 * This does not append a newline 48 * This does not append a newline
31 */ 49 */
32static inline void putc(int c) 50static inline void putc(int c)
33{ 51{
34 while (AMBA_UART_FR & (1 << 5)) 52 unsigned long base = get_uart_base();
53
54 while (AMBA_UART_FR(base) & (1 << 5))
35 barrier(); 55 barrier();
36 56
37 AMBA_UART_DR = c; 57 AMBA_UART_DR(base) = c;
38} 58}
39 59
40static inline void flush(void) 60static inline void flush(void)
41{ 61{
42 while (AMBA_UART_FR & (1 << 3)) 62 unsigned long base = get_uart_base();
63
64 while (AMBA_UART_FR(base) & (1 << 3))
43 barrier(); 65 barrier();
44} 66}
45 67
diff --git a/include/asm-arm/arch-s3c2410/regs-clock.h b/include/asm-arm/arch-s3c2410/regs-clock.h
index dba9df9d8713..ecae9e7f5e45 100644
--- a/include/asm-arm/arch-s3c2410/regs-clock.h
+++ b/include/asm-arm/arch-s3c2410/regs-clock.h
@@ -137,7 +137,7 @@ s3c2410_get_pll(unsigned int pllval, unsigned int baseclk)
137 137
138#define S3C2412_CLKDIVN_PDIVN (1<<2) 138#define S3C2412_CLKDIVN_PDIVN (1<<2)
139#define S3C2412_CLKDIVN_HDIVN_MASK (3<<0) 139#define S3C2412_CLKDIVN_HDIVN_MASK (3<<0)
140#define S3C2421_CLKDIVN_ARMDIVN (1<<3) 140#define S3C2412_CLKDIVN_ARMDIVN (1<<3)
141#define S3C2412_CLKDIVN_DVSEN (1<<4) 141#define S3C2412_CLKDIVN_DVSEN (1<<4)
142#define S3C2412_CLKDIVN_HALFHCLK (1<<5) 142#define S3C2412_CLKDIVN_HALFHCLK (1<<5)
143#define S3C2412_CLKDIVN_USB48DIV (1<<6) 143#define S3C2412_CLKDIVN_USB48DIV (1<<6)
diff --git a/include/asm-arm/arch-s3c2410/regs-gpio.h b/include/asm-arm/arch-s3c2410/regs-gpio.h
index 0ad75d716ded..497dd06e2c99 100644
--- a/include/asm-arm/arch-s3c2410/regs-gpio.h
+++ b/include/asm-arm/arch-s3c2410/regs-gpio.h
@@ -529,11 +529,13 @@
529#define S3C2410_GPD14_INP (0x00 << 28) 529#define S3C2410_GPD14_INP (0x00 << 28)
530#define S3C2410_GPD14_OUTP (0x01 << 28) 530#define S3C2410_GPD14_OUTP (0x01 << 28)
531#define S3C2410_GPD14_VD22 (0x02 << 28) 531#define S3C2410_GPD14_VD22 (0x02 << 28)
532#define S3C2410_GPD14_nSS1 (0x03 << 28)
532 533
533#define S3C2410_GPD15 S3C2410_GPIONO(S3C2410_GPIO_BANKD, 15) 534#define S3C2410_GPD15 S3C2410_GPIONO(S3C2410_GPIO_BANKD, 15)
534#define S3C2410_GPD15_INP (0x00 << 30) 535#define S3C2410_GPD15_INP (0x00 << 30)
535#define S3C2410_GPD15_OUTP (0x01 << 30) 536#define S3C2410_GPD15_OUTP (0x01 << 30)
536#define S3C2410_GPD15_VD23 (0x02 << 30) 537#define S3C2410_GPD15_VD23 (0x02 << 30)
538#define S3C2410_GPD15_nSS0 (0x03 << 30)
537 539
538#define S3C2410_GPD_PUPDIS(x) (1<<(x)) 540#define S3C2410_GPD_PUPDIS(x) (1<<(x))
539 541
@@ -801,12 +803,14 @@
801#define S3C2410_GPG2_INP (0x00 << 4) 803#define S3C2410_GPG2_INP (0x00 << 4)
802#define S3C2410_GPG2_OUTP (0x01 << 4) 804#define S3C2410_GPG2_OUTP (0x01 << 4)
803#define S3C2410_GPG2_EINT10 (0x02 << 4) 805#define S3C2410_GPG2_EINT10 (0x02 << 4)
806#define S3C2410_GPG2_nSS0 (0x03 << 4)
804#define S3C2400_GPG2_CDCLK (0x02 << 4) 807#define S3C2400_GPG2_CDCLK (0x02 << 4)
805 808
806#define S3C2410_GPG3 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 3) 809#define S3C2410_GPG3 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 3)
807#define S3C2410_GPG3_INP (0x00 << 6) 810#define S3C2410_GPG3_INP (0x00 << 6)
808#define S3C2410_GPG3_OUTP (0x01 << 6) 811#define S3C2410_GPG3_OUTP (0x01 << 6)
809#define S3C2410_GPG3_EINT11 (0x02 << 6) 812#define S3C2410_GPG3_EINT11 (0x02 << 6)
813#define S3C2410_GPG3_nSS1 (0x03 << 6)
810#define S3C2400_GPG3_I2SSDO (0x02 << 6) 814#define S3C2400_GPG3_I2SSDO (0x02 << 6)
811#define S3C2400_GPG3_I2SSDI (0x03 << 6) 815#define S3C2400_GPG3_I2SSDI (0x03 << 6)
812 816
diff --git a/include/asm-arm/arch-s3c2410/regs-s3c2412-mem.h b/include/asm-arm/arch-s3c2410/regs-s3c2412-mem.h
new file mode 100644
index 000000000000..c8c793e78936
--- /dev/null
+++ b/include/asm-arm/arch-s3c2410/regs-s3c2412-mem.h
@@ -0,0 +1,29 @@
1/* linux/include/asm-arm/arch-s3c2410/regs-s3c2412-mem.h
2 *
3 * Copyright (c) 2008 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 * http://armlinux.simtec.co.uk/
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 *
11 * S3C2412 memory register definitions
12*/
13
14#ifndef __ASM_ARM_REGS_S3C2412_MEM
15#define __ASM_ARM_REGS_S3C2412_MEM
16
17#ifndef S3C2412_MEMREG
18#define S3C2412_MEMREG(x) (S3C24XX_VA_MEMCTRL + (x))
19#endif
20
21#define S3C2412_BANKCFG S3C2412_MEMREG(0x00)
22#define S3C2412_BANKCON1 S3C2412_MEMREG(0x04)
23#define S3C2412_BANKCON2 S3C2412_MEMREG(0x08)
24#define S3C2412_BANKCON3 S3C2412_MEMREG(0x0C)
25
26#define S3C2412_REFRESH S3C2412_MEMREG(0x10)
27#define S3C2412_TIMEOUT S3C2412_MEMREG(0x14)
28
29#endif /* __ASM_ARM_REGS_S3C2412_MEM */
diff --git a/include/asm-arm/arch-s3c2410/system-reset.h b/include/asm-arm/arch-s3c2410/system-reset.h
new file mode 100644
index 000000000000..1615bce0c026
--- /dev/null
+++ b/include/asm-arm/arch-s3c2410/system-reset.h
@@ -0,0 +1,64 @@
1/* linux/include/asm-arm/arch-s3c2410/system-reset.h
2 *
3 * Copyright (c) 2008 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 *
6 * S3C2410 - System define for arch_reset() function
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11*/
12
13#include <asm/hardware.h>
14#include <asm/io.h>
15
16#include <asm/plat-s3c/regs-watchdog.h>
17#include <asm/arch/regs-clock.h>
18
19#include <linux/clk.h>
20#include <linux/err.h>
21
22extern void (*s3c24xx_reset_hook)(void);
23
24static void
25arch_reset(char mode)
26{
27 struct clk *wdtclk;
28
29 if (mode == 's') {
30 cpu_reset(0);
31 }
32
33 if (s3c24xx_reset_hook)
34 s3c24xx_reset_hook();
35
36 printk("arch_reset: attempting watchdog reset\n");
37
38 __raw_writel(0, S3C2410_WTCON); /* disable watchdog, to be safe */
39
40 wdtclk = clk_get(NULL, "watchdog");
41 if (!IS_ERR(wdtclk)) {
42 clk_enable(wdtclk);
43 } else
44 printk(KERN_WARNING "%s: warning: cannot get watchdog clock\n", __func__);
45
46 /* put initial values into count and data */
47 __raw_writel(0x80, S3C2410_WTCNT);
48 __raw_writel(0x80, S3C2410_WTDAT);
49
50 /* set the watchdog to go and reset... */
51 __raw_writel(S3C2410_WTCON_ENABLE|S3C2410_WTCON_DIV16|S3C2410_WTCON_RSTEN |
52 S3C2410_WTCON_PRESCALE(0x20), S3C2410_WTCON);
53
54 /* wait for reset to assert... */
55 mdelay(500);
56
57 printk(KERN_ERR "Watchdog reset failed to assert reset\n");
58
59 /* delay to allow the serial port to show the message */
60 mdelay(50);
61
62 /* we'll take a jump through zero as a poor second */
63 cpu_reset(0);
64}
diff --git a/include/asm-arm/arch-s3c2410/system.h b/include/asm-arm/arch-s3c2410/system.h
index 14de4e596f87..ad258085e53b 100644
--- a/include/asm-arm/arch-s3c2410/system.h
+++ b/include/asm-arm/arch-s3c2410/system.h
@@ -17,12 +17,8 @@
17#include <asm/arch/idle.h> 17#include <asm/arch/idle.h>
18#include <asm/arch/reset.h> 18#include <asm/arch/reset.h>
19 19
20#include <asm/plat-s3c/regs-watchdog.h>
21#include <asm/arch/regs-clock.h> 20#include <asm/arch/regs-clock.h>
22 21
23#include <linux/clk.h>
24#include <linux/err.h>
25
26void (*s3c24xx_idle)(void); 22void (*s3c24xx_idle)(void);
27void (*s3c24xx_reset_hook)(void); 23void (*s3c24xx_reset_hook)(void);
28 24
@@ -59,44 +55,4 @@ static void arch_idle(void)
59 s3c24xx_default_idle(); 55 s3c24xx_default_idle();
60} 56}
61 57
62static void 58#include <asm/arch/system-reset.h>
63arch_reset(char mode)
64{
65 struct clk *wdtclk;
66
67 if (mode == 's') {
68 cpu_reset(0);
69 }
70
71 if (s3c24xx_reset_hook)
72 s3c24xx_reset_hook();
73
74 printk("arch_reset: attempting watchdog reset\n");
75
76 __raw_writel(0, S3C2410_WTCON); /* disable watchdog, to be safe */
77
78 wdtclk = clk_get(NULL, "watchdog");
79 if (!IS_ERR(wdtclk)) {
80 clk_enable(wdtclk);
81 } else
82 printk(KERN_WARNING "%s: warning: cannot get watchdog clock\n", __func__);
83
84 /* put initial values into count and data */
85 __raw_writel(0x80, S3C2410_WTCNT);
86 __raw_writel(0x80, S3C2410_WTDAT);
87
88 /* set the watchdog to go and reset... */
89 __raw_writel(S3C2410_WTCON_ENABLE|S3C2410_WTCON_DIV16|S3C2410_WTCON_RSTEN |
90 S3C2410_WTCON_PRESCALE(0x20), S3C2410_WTCON);
91
92 /* wait for reset to assert... */
93 mdelay(500);
94
95 printk(KERN_ERR "Watchdog reset failed to assert reset\n");
96
97 /* delay to allow the serial port to show the message */
98 mdelay(50);
99
100 /* we'll take a jump through zero as a poor second */
101 cpu_reset(0);
102}
diff --git a/include/asm-arm/arch-sa1100/gpio.h b/include/asm-arm/arch-sa1100/gpio.h
index e7a9d26e22a8..93d3395b102d 100644
--- a/include/asm-arm/arch-sa1100/gpio.h
+++ b/include/asm-arm/arch-sa1100/gpio.h
@@ -26,35 +26,28 @@
26 26
27#include <asm/hardware.h> 27#include <asm/hardware.h>
28#include <asm/irq.h> 28#include <asm/irq.h>
29 29#include <asm-generic/gpio.h>
30static inline int gpio_request(unsigned gpio, const char *label)
31{
32 return 0;
33}
34
35static inline void gpio_free(unsigned gpio)
36{
37 return;
38}
39
40extern int gpio_direction_input(unsigned gpio);
41extern int gpio_direction_output(unsigned gpio, int value);
42
43 30
44static inline int gpio_get_value(unsigned gpio) 31static inline int gpio_get_value(unsigned gpio)
45{ 32{
46 return GPLR & GPIO_GPIO(gpio); 33 if (__builtin_constant_p(gpio) && (gpio <= GPIO_MAX))
34 return GPLR & GPIO_GPIO(gpio);
35 else
36 return __gpio_get_value(gpio);
47} 37}
48 38
49static inline void gpio_set_value(unsigned gpio, int value) 39static inline void gpio_set_value(unsigned gpio, int value)
50{ 40{
51 if (value) 41 if (__builtin_constant_p(gpio) && (gpio <= GPIO_MAX))
52 GPSR = GPIO_GPIO(gpio); 42 if (value)
43 GPSR = GPIO_GPIO(gpio);
44 else
45 GPCR = GPIO_GPIO(gpio);
53 else 46 else
54 GPCR = GPIO_GPIO(gpio); 47 __gpio_set_value(gpio, value);
55} 48}
56 49
57#include <asm-generic/gpio.h> /* cansleep wrappers */ 50#define gpio_cansleep __gpio_cansleep
58 51
59static inline unsigned gpio_to_irq(unsigned gpio) 52static inline unsigned gpio_to_irq(unsigned gpio)
60{ 53{
diff --git a/include/asm-arm/cpu-multi32.h b/include/asm-arm/cpu-multi32.h
index 715e18a4add1..3479de9266e5 100644
--- a/include/asm-arm/cpu-multi32.h
+++ b/include/asm-arm/cpu-multi32.h
@@ -21,6 +21,10 @@ extern struct processor {
21 */ 21 */
22 void (*_data_abort)(unsigned long pc); 22 void (*_data_abort)(unsigned long pc);
23 /* 23 /*
24 * Retrieve prefetch fault address
25 */
26 unsigned long (*_prefetch_abort)(unsigned long lr);
27 /*
24 * Set up any processor specifics 28 * Set up any processor specifics
25 */ 29 */
26 void (*_proc_init)(void); 30 void (*_proc_init)(void);
diff --git a/include/asm-arm/glue.h b/include/asm-arm/glue.h
index 22274ce81375..a97a182ba287 100644
--- a/include/asm-arm/glue.h
+++ b/include/asm-arm/glue.h
@@ -40,83 +40,110 @@
40 * v6_early - ARMv6 generic early abort handler 40 * v6_early - ARMv6 generic early abort handler
41 * v7_early - ARMv7 generic early abort handler 41 * v7_early - ARMv7 generic early abort handler
42 */ 42 */
43#undef CPU_ABORT_HANDLER 43#undef CPU_DABORT_HANDLER
44#undef MULTI_ABORT 44#undef MULTI_DABORT
45 45
46#if defined(CONFIG_CPU_ARM610) 46#if defined(CONFIG_CPU_ARM610)
47# ifdef CPU_ABORT_HANDLER 47# ifdef CPU_DABORT_HANDLER
48# define MULTI_ABORT 1 48# define MULTI_DABORT 1
49# else 49# else
50# define CPU_ABORT_HANDLER cpu_arm6_data_abort 50# define CPU_DABORT_HANDLER cpu_arm6_data_abort
51# endif 51# endif
52#endif 52#endif
53 53
54#if defined(CONFIG_CPU_ARM710) 54#if defined(CONFIG_CPU_ARM710)
55# ifdef CPU_ABORT_HANDLER 55# ifdef CPU_DABORT_HANDLER
56# define MULTI_ABORT 1 56# define MULTI_DABORT 1
57# else 57# else
58# define CPU_ABORT_HANDLER cpu_arm7_data_abort 58# define CPU_DABORT_HANDLER cpu_arm7_data_abort
59# endif 59# endif
60#endif 60#endif
61 61
62#ifdef CONFIG_CPU_ABRT_LV4T 62#ifdef CONFIG_CPU_ABRT_LV4T
63# ifdef CPU_ABORT_HANDLER 63# ifdef CPU_DABORT_HANDLER
64# define MULTI_ABORT 1 64# define MULTI_DABORT 1
65# else 65# else
66# define CPU_ABORT_HANDLER v4t_late_abort 66# define CPU_DABORT_HANDLER v4t_late_abort
67# endif 67# endif
68#endif 68#endif
69 69
70#ifdef CONFIG_CPU_ABRT_EV4 70#ifdef CONFIG_CPU_ABRT_EV4
71# ifdef CPU_ABORT_HANDLER 71# ifdef CPU_DABORT_HANDLER
72# define MULTI_ABORT 1 72# define MULTI_DABORT 1
73# else 73# else
74# define CPU_ABORT_HANDLER v4_early_abort 74# define CPU_DABORT_HANDLER v4_early_abort
75# endif 75# endif
76#endif 76#endif
77 77
78#ifdef CONFIG_CPU_ABRT_EV4T 78#ifdef CONFIG_CPU_ABRT_EV4T
79# ifdef CPU_ABORT_HANDLER 79# ifdef CPU_DABORT_HANDLER
80# define MULTI_ABORT 1 80# define MULTI_DABORT 1
81# else 81# else
82# define CPU_ABORT_HANDLER v4t_early_abort 82# define CPU_DABORT_HANDLER v4t_early_abort
83# endif 83# endif
84#endif 84#endif
85 85
86#ifdef CONFIG_CPU_ABRT_EV5TJ 86#ifdef CONFIG_CPU_ABRT_EV5TJ
87# ifdef CPU_ABORT_HANDLER 87# ifdef CPU_DABORT_HANDLER
88# define MULTI_ABORT 1 88# define MULTI_DABORT 1
89# else 89# else
90# define CPU_ABORT_HANDLER v5tj_early_abort 90# define CPU_DABORT_HANDLER v5tj_early_abort
91# endif 91# endif
92#endif 92#endif
93 93
94#ifdef CONFIG_CPU_ABRT_EV5T 94#ifdef CONFIG_CPU_ABRT_EV5T
95# ifdef CPU_ABORT_HANDLER 95# ifdef CPU_DABORT_HANDLER
96# define MULTI_ABORT 1 96# define MULTI_DABORT 1
97# else 97# else
98# define CPU_ABORT_HANDLER v5t_early_abort 98# define CPU_DABORT_HANDLER v5t_early_abort
99# endif 99# endif
100#endif 100#endif
101 101
102#ifdef CONFIG_CPU_ABRT_EV6 102#ifdef CONFIG_CPU_ABRT_EV6
103# ifdef CPU_ABORT_HANDLER 103# ifdef CPU_DABORT_HANDLER
104# define MULTI_ABORT 1 104# define MULTI_DABORT 1
105# else 105# else
106# define CPU_ABORT_HANDLER v6_early_abort 106# define CPU_DABORT_HANDLER v6_early_abort
107# endif 107# endif
108#endif 108#endif
109 109
110#ifdef CONFIG_CPU_ABRT_EV7 110#ifdef CONFIG_CPU_ABRT_EV7
111# ifdef CPU_ABORT_HANDLER 111# ifdef CPU_DABORT_HANDLER
112# define MULTI_ABORT 1 112# define MULTI_DABORT 1
113# else 113# else
114# define CPU_ABORT_HANDLER v7_early_abort 114# define CPU_DABORT_HANDLER v7_early_abort
115# endif 115# endif
116#endif 116#endif
117 117
118#ifndef CPU_ABORT_HANDLER 118#ifndef CPU_DABORT_HANDLER
119#error Unknown data abort handler type 119#error Unknown data abort handler type
120#endif 120#endif
121 121
122/*
123 * Prefetch abort handler. If the CPU has an IFAR use that, otherwise
124 * use the address of the aborted instruction
125 */
126#undef CPU_PABORT_HANDLER
127#undef MULTI_PABORT
128
129#ifdef CONFIG_CPU_PABRT_IFAR
130# ifdef CPU_PABORT_HANDLER
131# define MULTI_PABORT 1
132# else
133# define CPU_PABORT_HANDLER(reg, insn) mrc p15, 0, reg, cr6, cr0, 2
134# endif
135#endif
136
137#ifdef CONFIG_CPU_PABRT_NOIFAR
138# ifdef CPU_PABORT_HANDLER
139# define MULTI_PABORT 1
140# else
141# define CPU_PABORT_HANDLER(reg, insn) mov reg, insn
142# endif
143#endif
144
145#ifndef CPU_PABORT_HANDLER
146#error Unknown prefetch abort handler type
147#endif
148
122#endif 149#endif
diff --git a/include/asm-arm/hardware/arm_scu.h b/include/asm-arm/hardware/arm_scu.h
deleted file mode 100644
index 7d28eb5a1758..000000000000
--- a/include/asm-arm/hardware/arm_scu.h
+++ /dev/null
@@ -1,15 +0,0 @@
1#ifndef ASMARM_HARDWARE_ARM_SCU_H
2#define ASMARM_HARDWARE_ARM_SCU_H
3
4#include <asm/arch/scu.h>
5
6/*
7 * SCU registers
8 */
9#define SCU_CTRL 0x00
10#define SCU_CONFIG 0x04
11#define SCU_CPU_STATUS 0x08
12#define SCU_INVALIDATE 0x0c
13#define SCU_FPGA_REVISION 0x10
14
15#endif
diff --git a/include/asm-arm/hardware/iop3xx-adma.h b/include/asm-arm/hardware/iop3xx-adma.h
index 84d635b0a71a..a32b86ac62aa 100644
--- a/include/asm-arm/hardware/iop3xx-adma.h
+++ b/include/asm-arm/hardware/iop3xx-adma.h
@@ -260,7 +260,7 @@ static inline int iop_chan_memset_slot_count(size_t len, int *slots_per_op)
260static inline int iop3xx_aau_xor_slot_count(size_t len, int src_cnt, 260static inline int iop3xx_aau_xor_slot_count(size_t len, int src_cnt,
261 int *slots_per_op) 261 int *slots_per_op)
262{ 262{
263 const static int slot_count_table[] = { 0, 263 static const int slot_count_table[] = { 0,
264 1, 1, 1, 1, /* 01 - 04 */ 264 1, 1, 1, 1, /* 01 - 04 */
265 2, 2, 2, 2, /* 05 - 08 */ 265 2, 2, 2, 2, /* 05 - 08 */
266 4, 4, 4, 4, /* 09 - 12 */ 266 4, 4, 4, 4, /* 09 - 12 */
@@ -369,7 +369,7 @@ static inline u32 iop_desc_get_byte_count(struct iop_adma_desc_slot *desc,
369/* translate the src_idx to a descriptor word index */ 369/* translate the src_idx to a descriptor word index */
370static inline int __desc_idx(int src_idx) 370static inline int __desc_idx(int src_idx)
371{ 371{
372 const static int desc_idx_table[] = { 0, 0, 0, 0, 372 static const int desc_idx_table[] = { 0, 0, 0, 0,
373 0, 1, 2, 3, 373 0, 1, 2, 3,
374 5, 6, 7, 8, 374 5, 6, 7, 8,
375 9, 10, 11, 12, 375 9, 10, 11, 12,
diff --git a/include/asm-arm/hardware/iop3xx.h b/include/asm-arm/hardware/iop3xx.h
index ede377ec9147..18f6937f5010 100644
--- a/include/asm-arm/hardware/iop3xx.h
+++ b/include/asm-arm/hardware/iop3xx.h
@@ -29,6 +29,7 @@ extern void gpio_line_config(int line, int direction);
29extern int gpio_line_get(int line); 29extern int gpio_line_get(int line);
30extern void gpio_line_set(int line, int value); 30extern void gpio_line_set(int line, int value);
31extern int init_atu; 31extern int init_atu;
32extern int iop3xx_get_init_atu(void);
32#endif 33#endif
33 34
34 35
@@ -112,14 +113,6 @@ extern int init_atu;
112#define IOP3XX_INIT_ATU_DISABLE -1 113#define IOP3XX_INIT_ATU_DISABLE -1
113#define IOP3XX_INIT_ATU_ENABLE 1 114#define IOP3XX_INIT_ATU_ENABLE 1
114 115
115#ifdef CONFIG_IOP3XX_ATU
116#define iop3xx_get_init_atu(x) (init_atu == IOP3XX_INIT_ATU_DEFAULT ?\
117 IOP3XX_INIT_ATU_ENABLE : init_atu)
118#else
119#define iop3xx_get_init_atu(x) (init_atu == IOP3XX_INIT_ATU_DEFAULT ?\
120 IOP3XX_INIT_ATU_DISABLE : init_atu)
121#endif
122
123/* Messaging Unit */ 116/* Messaging Unit */
124#define IOP3XX_IMR0 (volatile u32 *)IOP3XX_REG_ADDR(0x0310) 117#define IOP3XX_IMR0 (volatile u32 *)IOP3XX_REG_ADDR(0x0310)
125#define IOP3XX_IMR1 (volatile u32 *)IOP3XX_REG_ADDR(0x0314) 118#define IOP3XX_IMR1 (volatile u32 *)IOP3XX_REG_ADDR(0x0314)
diff --git a/include/asm-arm/hardware/scoop.h b/include/asm-arm/hardware/scoop.h
index d37bf7443264..dfb8330599f9 100644
--- a/include/asm-arm/hardware/scoop.h
+++ b/include/asm-arm/hardware/scoop.h
@@ -40,6 +40,7 @@ struct scoop_config {
40 unsigned short io_dir; 40 unsigned short io_dir;
41 unsigned short suspend_clr; 41 unsigned short suspend_clr;
42 unsigned short suspend_set; 42 unsigned short suspend_set;
43 int gpio_base;
43}; 44};
44 45
45/* Structure for linking scoop devices to PCMCIA sockets */ 46/* Structure for linking scoop devices to PCMCIA sockets */
@@ -62,7 +63,7 @@ struct scoop_pcmcia_config {
62extern struct scoop_pcmcia_config *platform_scoop_config; 63extern struct scoop_pcmcia_config *platform_scoop_config;
63 64
64void reset_scoop(struct device *dev); 65void reset_scoop(struct device *dev);
65unsigned short set_scoop_gpio(struct device *dev, unsigned short bit); 66unsigned short __deprecated set_scoop_gpio(struct device *dev, unsigned short bit);
66unsigned short reset_scoop_gpio(struct device *dev, unsigned short bit); 67unsigned short __deprecated reset_scoop_gpio(struct device *dev, unsigned short bit);
67unsigned short read_scoop_reg(struct device *dev, unsigned short reg); 68unsigned short read_scoop_reg(struct device *dev, unsigned short reg);
68void write_scoop_reg(struct device *dev, unsigned short reg, unsigned short data); 69void write_scoop_reg(struct device *dev, unsigned short reg, unsigned short data);
diff --git a/include/asm-arm/hwcap.h b/include/asm-arm/hwcap.h
index 01a1391d3014..81f4c899a555 100644
--- a/include/asm-arm/hwcap.h
+++ b/include/asm-arm/hwcap.h
@@ -15,6 +15,7 @@
15#define HWCAP_JAVA 256 15#define HWCAP_JAVA 256
16#define HWCAP_IWMMXT 512 16#define HWCAP_IWMMXT 512
17#define HWCAP_CRUNCH 1024 17#define HWCAP_CRUNCH 1024
18#define HWCAP_THUMBEE 2048
18 19
19#if defined(__KERNEL__) && !defined(__ASSEMBLY__) 20#if defined(__KERNEL__) && !defined(__ASSEMBLY__)
20/* 21/*
diff --git a/include/asm-arm/mach/pci.h b/include/asm-arm/mach/pci.h
index 24621c49a0c7..9d4f6b5ea419 100644
--- a/include/asm-arm/mach/pci.h
+++ b/include/asm-arm/mach/pci.h
@@ -55,6 +55,7 @@ void pci_common_init(struct hw_pci *);
55extern int iop3xx_pci_setup(int nr, struct pci_sys_data *); 55extern int iop3xx_pci_setup(int nr, struct pci_sys_data *);
56extern struct pci_bus *iop3xx_pci_scan_bus(int nr, struct pci_sys_data *); 56extern struct pci_bus *iop3xx_pci_scan_bus(int nr, struct pci_sys_data *);
57extern void iop3xx_pci_preinit(void); 57extern void iop3xx_pci_preinit(void);
58extern void iop3xx_pci_preinit_cond(void);
58 59
59extern int dc21285_setup(int nr, struct pci_sys_data *); 60extern int dc21285_setup(int nr, struct pci_sys_data *);
60extern struct pci_bus *dc21285_scan_bus(int nr, struct pci_sys_data *); 61extern struct pci_bus *dc21285_scan_bus(int nr, struct pci_sys_data *);
diff --git a/include/asm-arm/memory.h b/include/asm-arm/memory.h
index d9bfb39adabf..9ba4d7136e6b 100644
--- a/include/asm-arm/memory.h
+++ b/include/asm-arm/memory.h
@@ -217,7 +217,10 @@ static inline __deprecated void *bus_to_virt(unsigned long x)
217#ifndef CONFIG_DISCONTIGMEM 217#ifndef CONFIG_DISCONTIGMEM
218 218
219#define ARCH_PFN_OFFSET PHYS_PFN_OFFSET 219#define ARCH_PFN_OFFSET PHYS_PFN_OFFSET
220
221#ifndef CONFIG_SPARSEMEM
220#define pfn_valid(pfn) ((pfn) >= PHYS_PFN_OFFSET && (pfn) < (PHYS_PFN_OFFSET + max_mapnr)) 222#define pfn_valid(pfn) ((pfn) >= PHYS_PFN_OFFSET && (pfn) < (PHYS_PFN_OFFSET + max_mapnr))
223#endif
221 224
222#define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT) 225#define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT)
223#define virt_addr_valid(kaddr) ((unsigned long)(kaddr) >= PAGE_OFFSET && (unsigned long)(kaddr) < (unsigned long)high_memory) 226#define virt_addr_valid(kaddr) ((unsigned long)(kaddr) >= PAGE_OFFSET && (unsigned long)(kaddr) < (unsigned long)high_memory)
diff --git a/include/asm-arm/plat-orion/ehci-orion.h b/include/asm-arm/plat-orion/ehci-orion.h
new file mode 100644
index 000000000000..785705651e24
--- /dev/null
+++ b/include/asm-arm/plat-orion/ehci-orion.h
@@ -0,0 +1,19 @@
1/*
2 * include/asm-arm/plat-orion/ehci-orion.h
3 *
4 * This file is licensed under the terms of the GNU General Public
5 * License version 2. This program is licensed "as is" without any
6 * warranty of any kind, whether express or implied.
7 */
8
9#ifndef __ASM_PLAT_ORION_EHCI_ORION_H
10#define __ASM_PLAT_ORION_EHCI_ORION_H
11
12#include <linux/mbus.h>
13
14struct orion_ehci_data {
15 struct mbus_dram_target_info *dram;
16};
17
18
19#endif
diff --git a/include/asm-arm/plat-orion/irq.h b/include/asm-arm/plat-orion/irq.h
new file mode 100644
index 000000000000..94aeed919d5b
--- /dev/null
+++ b/include/asm-arm/plat-orion/irq.h
@@ -0,0 +1,17 @@
1/*
2 * include/asm-arm/plat-orion/irq.h
3 *
4 * Marvell Orion SoC IRQ handling.
5 *
6 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without any
8 * warranty of any kind, whether express or implied.
9 */
10
11#ifndef __ASM_PLAT_ORION_IRQ_H
12#define __ASM_PLAT_ORION_IRQ_H
13
14void orion_irq_init(unsigned int irq_start, void __iomem *maskaddr);
15
16
17#endif
diff --git a/include/asm-arm/arch-orion/platform.h b/include/asm-arm/plat-orion/orion_nand.h
index 143c38e2fa0b..ffd3852a0dd7 100644
--- a/include/asm-arm/arch-orion/platform.h
+++ b/include/asm-arm/plat-orion/orion_nand.h
@@ -1,15 +1,13 @@
1/* 1/*
2 * asm-arm/arch-orion/platform.h 2 * include/asm-arm/plat-orion/orion_nand.h
3 *
4 * Tzachi Perelstein <tzachi@marvell.com>
5 * 3 *
6 * This file is licensed under the terms of the GNU General Public 4 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without any 5 * License version 2. This program is licensed "as is" without any
8 * warranty of any kind, whether express or implied. 6 * warranty of any kind, whether express or implied.
9 */ 7 */
10 8
11#ifndef __ASM_ARCH_PLATFORM_H__ 9#ifndef __ASM_PLAT_ORION_ORION_NAND_H
12#define __ASM_ARCH_PLATFORM_H__ 10#define __ASM_PLAT_ORION_ORION_NAND_H
13 11
14/* 12/*
15 * Device bus NAND private data 13 * Device bus NAND private data
@@ -22,4 +20,5 @@ struct orion_nand_data {
22 u8 width; /* buswidth */ 20 u8 width; /* buswidth */
23}; 21};
24 22
23
25#endif 24#endif
diff --git a/include/asm-arm/plat-orion/pcie.h b/include/asm-arm/plat-orion/pcie.h
new file mode 100644
index 000000000000..6434ac685d21
--- /dev/null
+++ b/include/asm-arm/plat-orion/pcie.h
@@ -0,0 +1,31 @@
1/*
2 * include/asm-arm/plat-orion/pcie.h
3 *
4 * Marvell Orion SoC PCIe handling.
5 *
6 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without any
8 * warranty of any kind, whether express or implied.
9 */
10
11#ifndef __ASM_PLAT_ORION_PCIE_H
12#define __ASM_PLAT_ORION_PCIE_H
13
14u32 orion_pcie_dev_id(void __iomem *base);
15u32 orion_pcie_rev(void __iomem *base);
16int orion_pcie_link_up(void __iomem *base);
17int orion_pcie_get_local_bus_nr(void __iomem *base);
18void orion_pcie_set_local_bus_nr(void __iomem *base, int nr);
19void orion_pcie_setup(void __iomem *base,
20 struct mbus_dram_target_info *dram);
21int orion_pcie_rd_conf(void __iomem *base, struct pci_bus *bus,
22 u32 devfn, int where, int size, u32 *val);
23int orion_pcie_rd_conf_tlp(void __iomem *base, struct pci_bus *bus,
24 u32 devfn, int where, int size, u32 *val);
25int orion_pcie_rd_conf_wa(void __iomem *wa_base, struct pci_bus *bus,
26 u32 devfn, int where, int size, u32 *val);
27int orion_pcie_wr_conf(void __iomem *base, struct pci_bus *bus,
28 u32 devfn, int where, int size, u32 val);
29
30
31#endif
diff --git a/include/asm-arm/plat-orion/time.h b/include/asm-arm/plat-orion/time.h
new file mode 100644
index 000000000000..0e85cc8f44d9
--- /dev/null
+++ b/include/asm-arm/plat-orion/time.h
@@ -0,0 +1,17 @@
1/*
2 * include/asm-arm/plat-orion/time.h
3 *
4 * Marvell Orion SoC time handling.
5 *
6 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without any
8 * warranty of any kind, whether express or implied.
9 */
10
11#ifndef __ASM_PLAT_ORION_TIME_H
12#define __ASM_PLAT_ORION_TIME_H
13
14void orion_time_init(unsigned int irq, unsigned int tclk);
15
16
17#endif
diff --git a/include/asm-arm/sparsemem.h b/include/asm-arm/sparsemem.h
new file mode 100644
index 000000000000..277158191a0d
--- /dev/null
+++ b/include/asm-arm/sparsemem.h
@@ -0,0 +1,10 @@
1#ifndef ASMARM_SPARSEMEM_H
2#define ASMARM_SPARSEMEM_H
3
4#include <asm/memory.h>
5
6#define MAX_PHYSADDR_BITS 32
7#define MAX_PHYSMEM_BITS 32
8#define SECTION_SIZE_BITS NODE_MEM_SIZE_BITS
9
10#endif
diff --git a/include/asm-arm/thread_info.h b/include/asm-arm/thread_info.h
index 41784357a204..f5a664786311 100644
--- a/include/asm-arm/thread_info.h
+++ b/include/asm-arm/thread_info.h
@@ -62,6 +62,9 @@ struct thread_info {
62 struct crunch_state crunchstate; 62 struct crunch_state crunchstate;
63 union fp_state fpstate __attribute__((aligned(8))); 63 union fp_state fpstate __attribute__((aligned(8)));
64 union vfp_state vfpstate; 64 union vfp_state vfpstate;
65#ifdef CONFIG_ARM_THUMBEE
66 unsigned long thumbee_state; /* ThumbEE Handler Base register */
67#endif
65 struct restart_block restart_block; 68 struct restart_block restart_block;
66}; 69};
67 70
diff --git a/include/asm-arm/unistd.h b/include/asm-arm/unistd.h
index 88e868b7aae0..7c570082b1e0 100644
--- a/include/asm-arm/unistd.h
+++ b/include/asm-arm/unistd.h
@@ -376,9 +376,11 @@
376#define __NR_kexec_load (__NR_SYSCALL_BASE+347) 376#define __NR_kexec_load (__NR_SYSCALL_BASE+347)
377#define __NR_utimensat (__NR_SYSCALL_BASE+348) 377#define __NR_utimensat (__NR_SYSCALL_BASE+348)
378#define __NR_signalfd (__NR_SYSCALL_BASE+349) 378#define __NR_signalfd (__NR_SYSCALL_BASE+349)
379#define __NR_timerfd (__NR_SYSCALL_BASE+350) 379#define __NR_timerfd_create (__NR_SYSCALL_BASE+350)
380#define __NR_eventfd (__NR_SYSCALL_BASE+351) 380#define __NR_eventfd (__NR_SYSCALL_BASE+351)
381#define __NR_fallocate (__NR_SYSCALL_BASE+352) 381#define __NR_fallocate (__NR_SYSCALL_BASE+352)
382#define __NR_timerfd_settime (__NR_SYSCALL_BASE+353)
383#define __NR_timerfd_gettime (__NR_SYSCALL_BASE+354)
382 384
383/* 385/*
384 * The following SWIs are ARM private. 386 * The following SWIs are ARM private.
diff --git a/include/asm-avr32/arch-at32ap/board.h b/include/asm-avr32/arch-at32ap/board.h
index 7597b0bd2f01..a4e2d28bfb58 100644
--- a/include/asm-avr32/arch-at32ap/board.h
+++ b/include/asm-avr32/arch-at32ap/board.h
@@ -38,9 +38,7 @@ struct platform_device *
38at32_add_device_lcdc(unsigned int id, struct atmel_lcdfb_info *data, 38at32_add_device_lcdc(unsigned int id, struct atmel_lcdfb_info *data,
39 unsigned long fbmem_start, unsigned long fbmem_len); 39 unsigned long fbmem_start, unsigned long fbmem_len);
40 40
41struct usba_platform_data { 41struct usba_platform_data;
42 int vbus_pin;
43};
44struct platform_device * 42struct platform_device *
45at32_add_device_usba(unsigned int id, struct usba_platform_data *data); 43at32_add_device_usba(unsigned int id, struct usba_platform_data *data);
46 44
@@ -68,7 +66,10 @@ struct platform_device *at32_add_device_pwm(u32 mask);
68struct platform_device * 66struct platform_device *
69at32_add_device_ssc(unsigned int id, unsigned int flags); 67at32_add_device_ssc(unsigned int id, unsigned int flags);
70 68
71struct platform_device *at32_add_device_twi(unsigned int id); 69struct i2c_board_info;
70struct platform_device *at32_add_device_twi(unsigned int id,
71 struct i2c_board_info *b,
72 unsigned int n);
72struct platform_device *at32_add_device_mci(unsigned int id); 73struct platform_device *at32_add_device_mci(unsigned int id);
73struct platform_device *at32_add_device_ac97c(unsigned int id); 74struct platform_device *at32_add_device_ac97c(unsigned int id);
74struct platform_device *at32_add_device_abdac(unsigned int id); 75struct platform_device *at32_add_device_abdac(unsigned int id);
diff --git a/include/asm-avr32/arch-at32ap/pm.h b/include/asm-avr32/arch-at32ap/pm.h
new file mode 100644
index 000000000000..356e43064903
--- /dev/null
+++ b/include/asm-avr32/arch-at32ap/pm.h
@@ -0,0 +1,48 @@
1/*
2 * AVR32 AP Power Management.
3 *
4 * Copyright (C) 2008 Atmel Corporation
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10#ifndef __ASM_AVR32_ARCH_PM_H
11#define __ASM_AVR32_ARCH_PM_H
12
13/* Possible arguments to the "sleep" instruction */
14#define CPU_SLEEP_IDLE 0
15#define CPU_SLEEP_FROZEN 1
16#define CPU_SLEEP_STANDBY 2
17#define CPU_SLEEP_STOP 3
18#define CPU_SLEEP_STATIC 5
19
20#ifndef __ASSEMBLY__
21extern void cpu_enter_idle(void);
22
23extern bool disable_idle_sleep;
24
25static inline void cpu_disable_idle_sleep(void)
26{
27 disable_idle_sleep = true;
28}
29
30static inline void cpu_enable_idle_sleep(void)
31{
32 disable_idle_sleep = false;
33}
34
35static inline void cpu_idle_sleep(void)
36{
37 /*
38 * If we're using the COUNT and COMPARE registers for
39 * timekeeping, we can't use the IDLE state.
40 */
41 if (disable_idle_sleep)
42 cpu_relax();
43 else
44 cpu_enter_idle();
45}
46#endif
47
48#endif /* __ASM_AVR32_ARCH_PM_H */
diff --git a/include/asm-avr32/arch-at32ap/time.h b/include/asm-avr32/arch-at32ap/time.h
deleted file mode 100644
index cc8a43418a4d..000000000000
--- a/include/asm-avr32/arch-at32ap/time.h
+++ /dev/null
@@ -1,112 +0,0 @@
1/*
2 * Copyright (C) 2007 Atmel Corporation
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 */
8
9#ifndef _ASM_AVR32_ARCH_AT32AP_TIME_H
10#define _ASM_AVR32_ARCH_AT32AP_TIME_H
11
12#include <linux/platform_device.h>
13
14extern struct irqaction timer_irqaction;
15extern struct platform_device at32_systc0_device;
16extern void local_timer_interrupt(int irq, void *dev_id);
17
18#define TIMER_BCR 0x000000c0
19#define TIMER_BCR_SYNC 0
20#define TIMER_BMR 0x000000c4
21#define TIMER_BMR_TC0XC0S 0
22#define TIMER_BMR_TC1XC1S 2
23#define TIMER_BMR_TC2XC2S 4
24#define TIMER_CCR 0x00000000
25#define TIMER_CCR_CLKDIS 1
26#define TIMER_CCR_CLKEN 0
27#define TIMER_CCR_SWTRG 2
28#define TIMER_CMR 0x00000004
29#define TIMER_CMR_ABETRG 10
30#define TIMER_CMR_ACPA 16
31#define TIMER_CMR_ACPC 18
32#define TIMER_CMR_AEEVT 20
33#define TIMER_CMR_ASWTRG 22
34#define TIMER_CMR_BCPB 24
35#define TIMER_CMR_BCPC 26
36#define TIMER_CMR_BEEVT 28
37#define TIMER_CMR_BSWTRG 30
38#define TIMER_CMR_BURST 4
39#define TIMER_CMR_CLKI 3
40#define TIMER_CMR_CPCDIS 7
41#define TIMER_CMR_CPCSTOP 6
42#define TIMER_CMR_CPCTRG 14
43#define TIMER_CMR_EEVT 10
44#define TIMER_CMR_EEVTEDG 8
45#define TIMER_CMR_ENETRG 12
46#define TIMER_CMR_ETRGEDG 8
47#define TIMER_CMR_LDBDIS 7
48#define TIMER_CMR_LDBSTOP 6
49#define TIMER_CMR_LDRA 16
50#define TIMER_CMR_LDRB 18
51#define TIMER_CMR_TCCLKS 0
52#define TIMER_CMR_WAVE 15
53#define TIMER_CMR_WAVSEL 13
54#define TIMER_CV 0x00000010
55#define TIMER_CV_CV 0
56#define TIMER_IDR 0x00000028
57#define TIMER_IDR_COVFS 0
58#define TIMER_IDR_CPAS 2
59#define TIMER_IDR_CPBS 3
60#define TIMER_IDR_CPCS 4
61#define TIMER_IDR_ETRGS 7
62#define TIMER_IDR_LDRAS 5
63#define TIMER_IDR_LDRBS 6
64#define TIMER_IDR_LOVRS 1
65#define TIMER_IER 0x00000024
66#define TIMER_IER_COVFS 0
67#define TIMER_IER_CPAS 2
68#define TIMER_IER_CPBS 3
69#define TIMER_IER_CPCS 4
70#define TIMER_IER_ETRGS 7
71#define TIMER_IER_LDRAS 5
72#define TIMER_IER_LDRBS 6
73#define TIMER_IER_LOVRS 1
74#define TIMER_IMR 0x0000002c
75#define TIMER_IMR_COVFS 0
76#define TIMER_IMR_CPAS 2
77#define TIMER_IMR_CPBS 3
78#define TIMER_IMR_CPCS 4
79#define TIMER_IMR_ETRGS 7
80#define TIMER_IMR_LDRAS 5
81#define TIMER_IMR_LDRBS 6
82#define TIMER_IMR_LOVRS 1
83#define TIMER_RA 0x00000014
84#define TIMER_RA_RA 0
85#define TIMER_RB 0x00000018
86#define TIMER_RB_RB 0
87#define TIMER_RC 0x0000001c
88#define TIMER_RC_RC 0
89#define TIMER_SR 0x00000020
90#define TIMER_SR_CLKSTA 16
91#define TIMER_SR_COVFS 0
92#define TIMER_SR_CPAS 2
93#define TIMER_SR_CPBS 3
94#define TIMER_SR_CPCS 4
95#define TIMER_SR_ETRGS 7
96#define TIMER_SR_LDRAS 5
97#define TIMER_SR_LDRBS 6
98#define TIMER_SR_LOVRS 1
99#define TIMER_SR_MTIOA 17
100#define TIMER_SR_MTIOB 18
101
102/* Bit manipulation macros */
103#define TIMER_BIT(name) (1 << TIMER_##name)
104#define TIMER_BF(name,value) ((value) << TIMER_##name)
105
106/* Register access macros */
107#define timer_read(port,instance,reg) \
108 __raw_readl(port + (0x40 * instance) + TIMER_##reg)
109#define timer_write(port,instance,reg,value) \
110 __raw_writel((value), port + (0x40 * instance) + TIMER_##reg)
111
112#endif /* _ASM_AVR32_ARCH_AT32AP_TIME_H */
diff --git a/include/asm-avr32/asm.h b/include/asm-avr32/asm.h
index 515c7618952b..a2c64f404b98 100644
--- a/include/asm-avr32/asm.h
+++ b/include/asm-avr32/asm.h
@@ -12,10 +12,10 @@
12#include <asm/asm-offsets.h> 12#include <asm/asm-offsets.h>
13#include <asm/thread_info.h> 13#include <asm/thread_info.h>
14 14
15#define mask_interrupts ssrf SR_GM_BIT 15#define mask_interrupts ssrf SYSREG_GM_OFFSET
16#define mask_exceptions ssrf SR_EM_BIT 16#define mask_exceptions ssrf SYSREG_EM_OFFSET
17#define unmask_interrupts csrf SR_GM_BIT 17#define unmask_interrupts csrf SYSREG_GM_OFFSET
18#define unmask_exceptions csrf SR_EM_BIT 18#define unmask_exceptions csrf SYSREG_EM_OFFSET
19 19
20#ifdef CONFIG_FRAME_POINTER 20#ifdef CONFIG_FRAME_POINTER
21 .macro save_fp 21 .macro save_fp
diff --git a/include/asm-avr32/intc.h b/include/asm-avr32/intc.h
deleted file mode 100644
index 1ac9ca75e8fd..000000000000
--- a/include/asm-avr32/intc.h
+++ /dev/null
@@ -1,128 +0,0 @@
1#ifndef __ASM_AVR32_INTC_H
2#define __ASM_AVR32_INTC_H
3
4#include <linux/sysdev.h>
5#include <linux/interrupt.h>
6
7struct irq_controller;
8struct irqaction;
9struct pt_regs;
10
11struct platform_device;
12
13/* Information about the internal interrupt controller */
14struct intc_device {
15 /* ioremapped address of configuration block */
16 void __iomem *regs;
17
18 /* the physical device */
19 struct platform_device *pdev;
20
21 /* Number of interrupt lines per group. */
22 unsigned int irqs_per_group;
23
24 /* The highest group ID + 1 */
25 unsigned int nr_groups;
26
27 /*
28 * Bitfield indicating which groups are actually in use. The
29 * size of the array is
30 * ceil(group_max / (8 * sizeof(unsigned int))).
31 */
32 unsigned int group_mask[];
33};
34
35struct irq_controller_class {
36 /*
37 * A short name identifying this kind of controller.
38 */
39 const char *typename;
40 /*
41 * Handle the IRQ. Must do any necessary acking and masking.
42 */
43 irqreturn_t (*handle)(int irq, void *dev_id, struct pt_regs *regs);
44 /*
45 * Register a new IRQ handler.
46 */
47 int (*setup)(struct irq_controller *ctrl, unsigned int irq,
48 struct irqaction *action);
49 /*
50 * Unregister a IRQ handler.
51 */
52 void (*free)(struct irq_controller *ctrl, unsigned int irq,
53 void *dev_id);
54 /*
55 * Mask the IRQ in the interrupt controller.
56 */
57 void (*mask)(struct irq_controller *ctrl, unsigned int irq);
58 /*
59 * Unmask the IRQ in the interrupt controller.
60 */
61 void (*unmask)(struct irq_controller *ctrl, unsigned int irq);
62 /*
63 * Set the type of the IRQ. See below for possible types.
64 * Return -EINVAL if a given type is not supported
65 */
66 int (*set_type)(struct irq_controller *ctrl, unsigned int irq,
67 unsigned int type);
68 /*
69 * Return the IRQ type currently set
70 */
71 unsigned int (*get_type)(struct irq_controller *ctrl, unsigned int irq);
72};
73
74struct irq_controller {
75 struct irq_controller_class *class;
76 unsigned int irq_group;
77 unsigned int first_irq;
78 unsigned int nr_irqs;
79 struct list_head list;
80};
81
82struct intc_group_desc {
83 struct irq_controller *ctrl;
84 irqreturn_t (*handle)(int, void *, struct pt_regs *);
85 unsigned long flags;
86 void *dev_id;
87 const char *devname;
88};
89
90/*
91 * The internal interrupt controller. Defined in board/part-specific
92 * devices.c.
93 * TODO: Should probably be defined per-cpu.
94 */
95extern struct intc_device intc;
96
97extern int request_internal_irq(unsigned int irq,
98 irqreturn_t (*handler)(int, void *, struct pt_regs *),
99 unsigned long irqflags,
100 const char *devname, void *dev_id);
101extern void free_internal_irq(unsigned int irq);
102
103/* Only used by time_init() */
104extern int setup_internal_irq(unsigned int irq, struct intc_group_desc *desc);
105
106/*
107 * Set interrupt priority for a given group. `group' can be found by
108 * using irq_to_group(irq). Priority can be from 0 (lowest) to 3
109 * (highest). Higher-priority interrupts will preempt lower-priority
110 * interrupts (unless interrupts are masked globally).
111 *
112 * This function does not check for conflicts within a group.
113 */
114extern int intc_set_priority(unsigned int group,
115 unsigned int priority);
116
117/*
118 * Returns a bitmask of pending interrupts in a group.
119 */
120extern unsigned long intc_get_pending(unsigned int group);
121
122/*
123 * Register a new external interrupt controller. Returns the first
124 * external IRQ number that is assigned to the new controller.
125 */
126extern int intc_register_controller(struct irq_controller *ctrl);
127
128#endif /* __ASM_AVR32_INTC_H */
diff --git a/include/asm-avr32/irq.h b/include/asm-avr32/irq.h
index 9315724c0596..c563b7720c1a 100644
--- a/include/asm-avr32/irq.h
+++ b/include/asm-avr32/irq.h
@@ -14,6 +14,11 @@
14#ifndef __ASSEMBLER__ 14#ifndef __ASSEMBLER__
15int nmi_enable(void); 15int nmi_enable(void);
16void nmi_disable(void); 16void nmi_disable(void);
17
18/*
19 * Returns a bitmask of pending interrupts in a group.
20 */
21extern unsigned long intc_get_pending(unsigned int group);
17#endif 22#endif
18 23
19#endif /* __ASM_AVR32_IOCTLS_H */ 24#endif /* __ASM_AVR32_IOCTLS_H */
diff --git a/include/asm-avr32/page.h b/include/asm-avr32/page.h
index 5582968feee8..cbbc5ca9728b 100644
--- a/include/asm-avr32/page.h
+++ b/include/asm-avr32/page.h
@@ -8,13 +8,11 @@
8#ifndef __ASM_AVR32_PAGE_H 8#ifndef __ASM_AVR32_PAGE_H
9#define __ASM_AVR32_PAGE_H 9#define __ASM_AVR32_PAGE_H
10 10
11#include <linux/const.h>
12
11/* PAGE_SHIFT determines the page size */ 13/* PAGE_SHIFT determines the page size */
12#define PAGE_SHIFT 12 14#define PAGE_SHIFT 12
13#ifdef __ASSEMBLY__ 15#define PAGE_SIZE (_AC(1, UL) << PAGE_SHIFT)
14#define PAGE_SIZE (1 << PAGE_SHIFT)
15#else
16#define PAGE_SIZE (1UL << PAGE_SHIFT)
17#endif
18#define PAGE_MASK (~(PAGE_SIZE-1)) 16#define PAGE_MASK (~(PAGE_SIZE-1))
19#define PTE_MASK PAGE_MASK 17#define PTE_MASK PAGE_MASK
20 18
diff --git a/include/asm-avr32/serial.h b/include/asm-avr32/serial.h
new file mode 100644
index 000000000000..5ecaebc22b02
--- /dev/null
+++ b/include/asm-avr32/serial.h
@@ -0,0 +1,13 @@
1#ifndef _ASM_SERIAL_H
2#define _ASM_SERIAL_H
3
4/*
5 * This assumes you have a 1.8432 MHz clock for your UART.
6 *
7 * It'd be nice if someone built a serial card with a 24.576 MHz
8 * clock, since the 16550A is capable of handling a top speed of 1.5
9 * megabits/second; but this requires the faster clock.
10 */
11#define BASE_BAUD (1843200 / 16)
12
13#endif /* _ASM_SERIAL_H */
diff --git a/include/asm-avr32/xor.h b/include/asm-avr32/xor.h
new file mode 100644
index 000000000000..99c87aa0af4f
--- /dev/null
+++ b/include/asm-avr32/xor.h
@@ -0,0 +1,6 @@
1#ifndef _ASM_XOR_H
2#define _ASM_XOR_H
3
4#include <asm-generic/xor.h>
5
6#endif
diff --git a/include/asm-blackfin/dma.h b/include/asm-blackfin/dma.h
index 5abaa2cee8db..16d493574ba8 100644
--- a/include/asm-blackfin/dma.h
+++ b/include/asm-blackfin/dma.h
@@ -33,7 +33,6 @@
33#include <linux/slab.h> 33#include <linux/slab.h>
34#include <asm/irq.h> 34#include <asm/irq.h>
35#include <asm/signal.h> 35#include <asm/signal.h>
36#include <asm/semaphore.h>
37 36
38#include <linux/kernel.h> 37#include <linux/kernel.h>
39#include <asm/mach/dma.h> 38#include <asm/mach/dma.h>
diff --git a/include/asm-frv/system.h b/include/asm-frv/system.h
index 30a67a9da11a..cb307f8a6b48 100644
--- a/include/asm-frv/system.h
+++ b/include/asm-frv/system.h
@@ -197,11 +197,6 @@ do { \
197 do { var = (value); barrier(); } while (0) 197 do { var = (value); barrier(); } while (0)
198#endif 198#endif
199 199
200#define HARD_RESET_NOW() \
201do { \
202 cli(); \
203} while(1)
204
205extern void die_if_kernel(const char *, ...) __attribute__((format(printf, 1, 2))); 200extern void die_if_kernel(const char *, ...) __attribute__((format(printf, 1, 2)));
206extern void free_initmem(void); 201extern void free_initmem(void);
207 202
diff --git a/include/asm-frv/topology.h b/include/asm-frv/topology.h
index abe7298742ac..942724352705 100644
--- a/include/asm-frv/topology.h
+++ b/include/asm-frv/topology.h
@@ -5,10 +5,8 @@
5 5
6#error NUMA not supported yet 6#error NUMA not supported yet
7 7
8#else /* !CONFIG_NUMA */ 8#endif /* CONFIG_NUMA */
9 9
10#include <asm-generic/topology.h> 10#include <asm-generic/topology.h>
11 11
12#endif /* CONFIG_NUMA */
13
14#endif /* _ASM_TOPOLOGY_H */ 12#endif /* _ASM_TOPOLOGY_H */
diff --git a/include/asm-generic/topology.h b/include/asm-generic/topology.h
index 342a2a0105c4..a6aea79bca4f 100644
--- a/include/asm-generic/topology.h
+++ b/include/asm-generic/topology.h
@@ -27,6 +27,8 @@
27#ifndef _ASM_GENERIC_TOPOLOGY_H 27#ifndef _ASM_GENERIC_TOPOLOGY_H
28#define _ASM_GENERIC_TOPOLOGY_H 28#define _ASM_GENERIC_TOPOLOGY_H
29 29
30#ifndef CONFIG_NUMA
31
30/* Other architectures wishing to use this simple topology API should fill 32/* Other architectures wishing to use this simple topology API should fill
31 in the below functions as appropriate in their own <asm/topology.h> file. */ 33 in the below functions as appropriate in their own <asm/topology.h> file. */
32#ifndef cpu_to_node 34#ifndef cpu_to_node
@@ -52,4 +54,16 @@
52 ) 54 )
53#endif 55#endif
54 56
57#endif /* CONFIG_NUMA */
58
59/* returns pointer to cpumask for specified node */
60#ifndef node_to_cpumask_ptr
61
62#define node_to_cpumask_ptr(v, node) \
63 cpumask_t _##v = node_to_cpumask(node), *v = &_##v
64
65#define node_to_cpumask_ptr_next(v, node) \
66 _##v = node_to_cpumask(node)
67#endif
68
55#endif /* _ASM_GENERIC_TOPOLOGY_H */ 69#endif /* _ASM_GENERIC_TOPOLOGY_H */
diff --git a/include/asm-ia64/sn/nodepda.h b/include/asm-ia64/sn/nodepda.h
index 6f6d69e39ff5..ee118b901de4 100644
--- a/include/asm-ia64/sn/nodepda.h
+++ b/include/asm-ia64/sn/nodepda.h
@@ -9,7 +9,6 @@
9#define _ASM_IA64_SN_NODEPDA_H 9#define _ASM_IA64_SN_NODEPDA_H
10 10
11 11
12#include <asm/semaphore.h>
13#include <asm/irq.h> 12#include <asm/irq.h>
14#include <asm/sn/arch.h> 13#include <asm/sn/arch.h>
15#include <asm/sn/intr.h> 14#include <asm/sn/intr.h>
diff --git a/include/asm-ia64/topology.h b/include/asm-ia64/topology.h
index 2d67b72b18d0..f2f72ef2a897 100644
--- a/include/asm-ia64/topology.h
+++ b/include/asm-ia64/topology.h
@@ -93,7 +93,7 @@ void build_cpu_to_node_map(void);
93 .cache_nice_tries = 2, \ 93 .cache_nice_tries = 2, \
94 .busy_idx = 3, \ 94 .busy_idx = 3, \
95 .idle_idx = 2, \ 95 .idle_idx = 2, \
96 .newidle_idx = 0, /* unused */ \ 96 .newidle_idx = 2, \
97 .wake_idx = 1, \ 97 .wake_idx = 1, \
98 .forkexec_idx = 1, \ 98 .forkexec_idx = 1, \
99 .flags = SD_LOAD_BALANCE \ 99 .flags = SD_LOAD_BALANCE \
@@ -116,6 +116,11 @@ void build_cpu_to_node_map(void);
116#define smt_capable() (smp_num_siblings > 1) 116#define smt_capable() (smp_num_siblings > 1)
117#endif 117#endif
118 118
119#define pcibus_to_cpumask(bus) (pcibus_to_node(bus) == -1 ? \
120 CPU_MASK_ALL : \
121 node_to_cpumask(pcibus_to_node(bus)) \
122 )
123
119#include <asm-generic/topology.h> 124#include <asm-generic/topology.h>
120 125
121#endif /* _ASM_IA64_TOPOLOGY_H */ 126#endif /* _ASM_IA64_TOPOLOGY_H */
diff --git a/include/asm-powerpc/Kbuild b/include/asm-powerpc/Kbuild
index 5f640e542475..7381916dfcbb 100644
--- a/include/asm-powerpc/Kbuild
+++ b/include/asm-powerpc/Kbuild
@@ -1,5 +1,6 @@
1include include/asm-generic/Kbuild.asm 1include include/asm-generic/Kbuild.asm
2 2
3header-y += a.out.h
3header-y += auxvec.h 4header-y += auxvec.h
4header-y += ioctls.h 5header-y += ioctls.h
5header-y += mman.h 6header-y += mman.h
@@ -23,7 +24,6 @@ header-y += sigcontext.h
23header-y += statfs.h 24header-y += statfs.h
24header-y += ps3fb.h 25header-y += ps3fb.h
25 26
26unifdef-y += a.out.h
27unifdef-y += asm-compat.h 27unifdef-y += asm-compat.h
28unifdef-y += bootx.h 28unifdef-y += bootx.h
29unifdef-y += byteorder.h 29unifdef-y += byteorder.h
diff --git a/include/asm-powerpc/abs_addr.h b/include/asm-powerpc/abs_addr.h
index 4aa220718b19..98324c5a8286 100644
--- a/include/asm-powerpc/abs_addr.h
+++ b/include/asm-powerpc/abs_addr.h
@@ -12,10 +12,11 @@
12 * 2 of the License, or (at your option) any later version. 12 * 2 of the License, or (at your option) any later version.
13 */ 13 */
14 14
15#include <linux/lmb.h>
16
15#include <asm/types.h> 17#include <asm/types.h>
16#include <asm/page.h> 18#include <asm/page.h>
17#include <asm/prom.h> 19#include <asm/prom.h>
18#include <asm/lmb.h>
19#include <asm/firmware.h> 20#include <asm/firmware.h>
20 21
21struct mschunks_map { 22struct mschunks_map {
diff --git a/include/asm-powerpc/bitops.h b/include/asm-powerpc/bitops.h
index 220d9a781ab9..a99a74929475 100644
--- a/include/asm-powerpc/bitops.h
+++ b/include/asm-powerpc/bitops.h
@@ -312,24 +312,26 @@ static __inline__ int fls(unsigned int x)
312 asm ("cntlzw %0,%1" : "=r" (lz) : "r" (x)); 312 asm ("cntlzw %0,%1" : "=r" (lz) : "r" (x));
313 return 32 - lz; 313 return 32 - lz;
314} 314}
315
316/*
317 * 64-bit can do this using one cntlzd (count leading zeroes doubleword)
318 * instruction; for 32-bit we use the generic version, which does two
319 * 32-bit fls calls.
320 */
321#ifdef __powerpc64__
322static __inline__ int fls64(__u64 x)
323{
324 int lz;
325
326 asm ("cntlzd %0,%1" : "=r" (lz) : "r" (x));
327 return 64 - lz;
328}
329#else
315#include <asm-generic/bitops/fls64.h> 330#include <asm-generic/bitops/fls64.h>
331#endif /* __powerpc64__ */
316 332
317#include <asm-generic/bitops/hweight.h> 333#include <asm-generic/bitops/hweight.h>
318 334#include <asm-generic/bitops/find.h>
319#define find_first_zero_bit(addr, size) find_next_zero_bit((addr), (size), 0)
320unsigned long find_next_zero_bit(const unsigned long *addr,
321 unsigned long size, unsigned long offset);
322/**
323 * find_first_bit - find the first set bit in a memory region
324 * @addr: The address to start the search at
325 * @size: The maximum size to search
326 *
327 * Returns the bit-number of the first set bit, not the number of the byte
328 * containing a bit.
329 */
330#define find_first_bit(addr, size) find_next_bit((addr), (size), 0)
331unsigned long find_next_bit(const unsigned long *addr,
332 unsigned long size, unsigned long offset);
333 335
334/* Little-endian versions */ 336/* Little-endian versions */
335 337
diff --git a/include/asm-powerpc/cpm.h b/include/asm-powerpc/cpm.h
index 77e39dad9728..ede38ffe466a 100644
--- a/include/asm-powerpc/cpm.h
+++ b/include/asm-powerpc/cpm.h
@@ -4,6 +4,20 @@
4#include <linux/compiler.h> 4#include <linux/compiler.h>
5#include <linux/types.h> 5#include <linux/types.h>
6 6
7/* Opcodes common to CPM1 and CPM2
8*/
9#define CPM_CR_INIT_TRX ((ushort)0x0000)
10#define CPM_CR_INIT_RX ((ushort)0x0001)
11#define CPM_CR_INIT_TX ((ushort)0x0002)
12#define CPM_CR_HUNT_MODE ((ushort)0x0003)
13#define CPM_CR_STOP_TX ((ushort)0x0004)
14#define CPM_CR_GRA_STOP_TX ((ushort)0x0005)
15#define CPM_CR_RESTART_TX ((ushort)0x0006)
16#define CPM_CR_CLOSE_RX_BD ((ushort)0x0007)
17#define CPM_CR_SET_GADDR ((ushort)0x0008)
18#define CPM_CR_SET_TIMER ((ushort)0x0008)
19#define CPM_CR_STOP_IDMA ((ushort)0x000b)
20
7/* Buffer descriptors used by many of the CPM protocols. */ 21/* Buffer descriptors used by many of the CPM protocols. */
8typedef struct cpm_buf_desc { 22typedef struct cpm_buf_desc {
9 ushort cbd_sc; /* Status and Control */ 23 ushort cbd_sc; /* Status and Control */
diff --git a/include/asm-powerpc/cpm1.h b/include/asm-powerpc/cpm1.h
index b2ebd6ac6dae..3df439678006 100644
--- a/include/asm-powerpc/cpm1.h
+++ b/include/asm-powerpc/cpm1.h
@@ -28,19 +28,6 @@
28#define CPM_CR_CHAN ((ushort)0x00f0) 28#define CPM_CR_CHAN ((ushort)0x00f0)
29#define CPM_CR_FLG ((ushort)0x0001) 29#define CPM_CR_FLG ((ushort)0x0001)
30 30
31/* Some commands (there are more...later)
32*/
33#define CPM_CR_INIT_TRX ((ushort)0x0000)
34#define CPM_CR_INIT_RX ((ushort)0x0001)
35#define CPM_CR_INIT_TX ((ushort)0x0002)
36#define CPM_CR_HUNT_MODE ((ushort)0x0003)
37#define CPM_CR_STOP_TX ((ushort)0x0004)
38#define CPM_CR_GRA_STOP_TX ((ushort)0x0005)
39#define CPM_CR_RESTART_TX ((ushort)0x0006)
40#define CPM_CR_CLOSE_RX_BD ((ushort)0x0007)
41#define CPM_CR_SET_GADDR ((ushort)0x0008)
42#define CPM_CR_SET_TIMER CPM_CR_SET_GADDR
43
44/* Channel numbers. 31/* Channel numbers.
45*/ 32*/
46#define CPM_CR_CH_SCC1 ((ushort)0x0000) 33#define CPM_CR_CH_SCC1 ((ushort)0x0000)
diff --git a/include/asm-powerpc/cpm2.h b/include/asm-powerpc/cpm2.h
index b93a53eb55c1..4c85ed9cd43f 100644
--- a/include/asm-powerpc/cpm2.h
+++ b/include/asm-powerpc/cpm2.h
@@ -71,18 +71,9 @@
71 71
72#define CPM_CR_FCC_PAGE(x) (x + 0x04) 72#define CPM_CR_FCC_PAGE(x) (x + 0x04)
73 73
74/* Some opcodes (there are more...later) 74/* CPM2-specific opcodes (see cpm.h for common opcodes)
75*/ 75*/
76#define CPM_CR_INIT_TRX ((ushort)0x0000)
77#define CPM_CR_INIT_RX ((ushort)0x0001)
78#define CPM_CR_INIT_TX ((ushort)0x0002)
79#define CPM_CR_HUNT_MODE ((ushort)0x0003)
80#define CPM_CR_STOP_TX ((ushort)0x0004)
81#define CPM_CR_GRA_STOP_TX ((ushort)0x0005)
82#define CPM_CR_RESTART_TX ((ushort)0x0006)
83#define CPM_CR_SET_GADDR ((ushort)0x0008)
84#define CPM_CR_START_IDMA ((ushort)0x0009) 76#define CPM_CR_START_IDMA ((ushort)0x0009)
85#define CPM_CR_STOP_IDMA ((ushort)0x000b)
86 77
87#define mk_cr_cmd(PG, SBC, MCN, OP) \ 78#define mk_cr_cmd(PG, SBC, MCN, OP) \
88 ((PG << 26) | (SBC << 21) | (MCN << 6) | OP) 79 ((PG << 26) | (SBC << 21) | (MCN << 6) | OP)
diff --git a/include/asm-powerpc/cputhreads.h b/include/asm-powerpc/cputhreads.h
index 8485c28b5f47..fb11b0c459b8 100644
--- a/include/asm-powerpc/cputhreads.h
+++ b/include/asm-powerpc/cputhreads.h
@@ -35,7 +35,7 @@ static inline cpumask_t cpu_thread_mask_to_cores(cpumask_t threads)
35 35
36 res = CPU_MASK_NONE; 36 res = CPU_MASK_NONE;
37 for (i = 0; i < NR_CPUS; i += threads_per_core) { 37 for (i = 0; i < NR_CPUS; i += threads_per_core) {
38 cpus_shift_right(tmp, threads_core_mask, i); 38 cpus_shift_left(tmp, threads_core_mask, i);
39 if (cpus_intersects(threads, tmp)) 39 if (cpus_intersects(threads, tmp))
40 cpu_set(i, res); 40 cpu_set(i, res);
41 } 41 }
diff --git a/include/asm-powerpc/dcr-native.h b/include/asm-powerpc/dcr-native.h
index be6c879e8760..f8398ce80372 100644
--- a/include/asm-powerpc/dcr-native.h
+++ b/include/asm-powerpc/dcr-native.h
@@ -82,6 +82,19 @@ static inline void __mtdcri(int base_addr, int base_data, int reg,
82 spin_unlock_irqrestore(&dcr_ind_lock, flags); 82 spin_unlock_irqrestore(&dcr_ind_lock, flags);
83} 83}
84 84
85static inline void __dcri_clrset(int base_addr, int base_data, int reg,
86 unsigned clr, unsigned set)
87{
88 unsigned long flags;
89 unsigned int val;
90
91 spin_lock_irqsave(&dcr_ind_lock, flags);
92 __mtdcr(base_addr, reg);
93 val = (__mfdcr(base_data) & ~clr) | set;
94 __mtdcr(base_data, val);
95 spin_unlock_irqrestore(&dcr_ind_lock, flags);
96}
97
85#define mfdcri(base, reg) __mfdcri(DCRN_ ## base ## _CONFIG_ADDR, \ 98#define mfdcri(base, reg) __mfdcri(DCRN_ ## base ## _CONFIG_ADDR, \
86 DCRN_ ## base ## _CONFIG_DATA, \ 99 DCRN_ ## base ## _CONFIG_DATA, \
87 reg) 100 reg)
@@ -90,6 +103,10 @@ static inline void __mtdcri(int base_addr, int base_data, int reg,
90 DCRN_ ## base ## _CONFIG_DATA, \ 103 DCRN_ ## base ## _CONFIG_DATA, \
91 reg, data) 104 reg, data)
92 105
106#define dcri_clrset(base, reg, clr, set) __dcri_clrset(DCRN_ ## base ## _CONFIG_ADDR, \
107 DCRN_ ## base ## _CONFIG_DATA, \
108 reg, clr, set)
109
93#endif /* __ASSEMBLY__ */ 110#endif /* __ASSEMBLY__ */
94#endif /* __KERNEL__ */ 111#endif /* __KERNEL__ */
95#endif /* _ASM_POWERPC_DCR_NATIVE_H */ 112#endif /* _ASM_POWERPC_DCR_NATIVE_H */
diff --git a/include/asm-powerpc/dcr-regs.h b/include/asm-powerpc/dcr-regs.h
index 9f1fb98fcdc6..29b0ecef980a 100644
--- a/include/asm-powerpc/dcr-regs.h
+++ b/include/asm-powerpc/dcr-regs.h
@@ -68,4 +68,82 @@
68#define SDR0_UART3 0x0123 68#define SDR0_UART3 0x0123
69#define SDR0_CUST0 0x4000 69#define SDR0_CUST0 0x4000
70 70
71/*
72 * All those DCR register addresses are offsets from the base address
73 * for the SRAM0 controller (e.g. 0x20 on 440GX). The base address is
74 * excluded here and configured in the device tree.
75 */
76#define DCRN_SRAM0_SB0CR 0x00
77#define DCRN_SRAM0_SB1CR 0x01
78#define DCRN_SRAM0_SB2CR 0x02
79#define DCRN_SRAM0_SB3CR 0x03
80#define SRAM_SBCR_BU_MASK 0x00000180
81#define SRAM_SBCR_BS_64KB 0x00000800
82#define SRAM_SBCR_BU_RO 0x00000080
83#define SRAM_SBCR_BU_RW 0x00000180
84#define DCRN_SRAM0_BEAR 0x04
85#define DCRN_SRAM0_BESR0 0x05
86#define DCRN_SRAM0_BESR1 0x06
87#define DCRN_SRAM0_PMEG 0x07
88#define DCRN_SRAM0_CID 0x08
89#define DCRN_SRAM0_REVID 0x09
90#define DCRN_SRAM0_DPC 0x0a
91#define SRAM_DPC_ENABLE 0x80000000
92
93/*
94 * All those DCR register addresses are offsets from the base address
95 * for the SRAM0 controller (e.g. 0x30 on 440GX). The base address is
96 * excluded here and configured in the device tree.
97 */
98#define DCRN_L2C0_CFG 0x00
99#define L2C_CFG_L2M 0x80000000
100#define L2C_CFG_ICU 0x40000000
101#define L2C_CFG_DCU 0x20000000
102#define L2C_CFG_DCW_MASK 0x1e000000
103#define L2C_CFG_TPC 0x01000000
104#define L2C_CFG_CPC 0x00800000
105#define L2C_CFG_FRAN 0x00200000
106#define L2C_CFG_SS_MASK 0x00180000
107#define L2C_CFG_SS_256 0x00000000
108#define L2C_CFG_CPIM 0x00040000
109#define L2C_CFG_TPIM 0x00020000
110#define L2C_CFG_LIM 0x00010000
111#define L2C_CFG_PMUX_MASK 0x00007000
112#define L2C_CFG_PMUX_SNP 0x00000000
113#define L2C_CFG_PMUX_IF 0x00001000
114#define L2C_CFG_PMUX_DF 0x00002000
115#define L2C_CFG_PMUX_DS 0x00003000
116#define L2C_CFG_PMIM 0x00000800
117#define L2C_CFG_TPEI 0x00000400
118#define L2C_CFG_CPEI 0x00000200
119#define L2C_CFG_NAM 0x00000100
120#define L2C_CFG_SMCM 0x00000080
121#define L2C_CFG_NBRM 0x00000040
122#define L2C_CFG_RDBW 0x00000008 /* only 460EX/GT */
123#define DCRN_L2C0_CMD 0x01
124#define L2C_CMD_CLR 0x80000000
125#define L2C_CMD_DIAG 0x40000000
126#define L2C_CMD_INV 0x20000000
127#define L2C_CMD_CCP 0x10000000
128#define L2C_CMD_CTE 0x08000000
129#define L2C_CMD_STRC 0x04000000
130#define L2C_CMD_STPC 0x02000000
131#define L2C_CMD_RPMC 0x01000000
132#define L2C_CMD_HCC 0x00800000
133#define DCRN_L2C0_ADDR 0x02
134#define DCRN_L2C0_DATA 0x03
135#define DCRN_L2C0_SR 0x04
136#define L2C_SR_CC 0x80000000
137#define L2C_SR_CPE 0x40000000
138#define L2C_SR_TPE 0x20000000
139#define L2C_SR_LRU 0x10000000
140#define L2C_SR_PCS 0x08000000
141#define DCRN_L2C0_REVID 0x05
142#define DCRN_L2C0_SNP0 0x06
143#define DCRN_L2C0_SNP1 0x07
144#define L2C_SNP_BA_MASK 0xffff0000
145#define L2C_SNP_SSR_MASK 0x0000f000
146#define L2C_SNP_SSR_32G 0x0000f000
147#define L2C_SNP_ESR 0x00000800
148
71#endif /* __DCR_REGS_H__ */ 149#endif /* __DCR_REGS_H__ */
diff --git a/include/asm-powerpc/exception.h b/include/asm-powerpc/exception.h
index 39abdb02fdef..329148b5acc6 100644
--- a/include/asm-powerpc/exception.h
+++ b/include/asm-powerpc/exception.h
@@ -228,18 +228,18 @@ label##_pSeries: \
228BEGIN_FW_FTR_SECTION; \ 228BEGIN_FW_FTR_SECTION; \
229 stb r11,PACAHARDIRQEN(r13); \ 229 stb r11,PACAHARDIRQEN(r13); \
230END_FW_FTR_SECTION_IFCLR(FW_FEATURE_ISERIES); \ 230END_FW_FTR_SECTION_IFCLR(FW_FEATURE_ISERIES); \
231 TRACE_DISABLE_INTS; \
231BEGIN_FW_FTR_SECTION; \ 232BEGIN_FW_FTR_SECTION; \
232 mfmsr r10; \ 233 mfmsr r10; \
233 ori r10,r10,MSR_EE; \ 234 ori r10,r10,MSR_EE; \
234 mtmsrd r10,1; \ 235 mtmsrd r10,1; \
235END_FW_FTR_SECTION_IFSET(FW_FEATURE_ISERIES) 236END_FW_FTR_SECTION_IFSET(FW_FEATURE_ISERIES)
236
237#else 237#else
238#define DISABLE_INTS \ 238#define DISABLE_INTS \
239 li r11,0; \ 239 li r11,0; \
240 stb r11,PACASOFTIRQEN(r13); \ 240 stb r11,PACASOFTIRQEN(r13); \
241 stb r11,PACAHARDIRQEN(r13) 241 stb r11,PACAHARDIRQEN(r13); \
242 242 TRACE_DISABLE_INTS
243#endif /* CONFIG_PPC_ISERIES */ 243#endif /* CONFIG_PPC_ISERIES */
244 244
245#define ENABLE_INTS \ 245#define ENABLE_INTS \
diff --git a/include/asm-powerpc/fsl_lbc.h b/include/asm-powerpc/fsl_lbc.h
new file mode 100644
index 000000000000..303f5484c050
--- /dev/null
+++ b/include/asm-powerpc/fsl_lbc.h
@@ -0,0 +1,311 @@
1/* Freescale Local Bus Controller
2 *
3 * Copyright (c) 2006-2007 Freescale Semiconductor
4 *
5 * Authors: Nick Spence <nick.spence@freescale.com>,
6 * Scott Wood <scottwood@freescale.com>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 */
22
23#ifndef __ASM_FSL_LBC_H
24#define __ASM_FSL_LBC_H
25
26#include <linux/types.h>
27#include <linux/spinlock.h>
28#include <asm/io.h>
29
30struct fsl_lbc_bank {
31 __be32 br; /**< Base Register */
32#define BR_BA 0xFFFF8000
33#define BR_BA_SHIFT 15
34#define BR_PS 0x00001800
35#define BR_PS_SHIFT 11
36#define BR_PS_8 0x00000800 /* Port Size 8 bit */
37#define BR_PS_16 0x00001000 /* Port Size 16 bit */
38#define BR_PS_32 0x00001800 /* Port Size 32 bit */
39#define BR_DECC 0x00000600
40#define BR_DECC_SHIFT 9
41#define BR_DECC_OFF 0x00000000 /* HW ECC checking and generation off */
42#define BR_DECC_CHK 0x00000200 /* HW ECC checking on, generation off */
43#define BR_DECC_CHK_GEN 0x00000400 /* HW ECC checking and generation on */
44#define BR_WP 0x00000100
45#define BR_WP_SHIFT 8
46#define BR_MSEL 0x000000E0
47#define BR_MSEL_SHIFT 5
48#define BR_MS_GPCM 0x00000000 /* GPCM */
49#define BR_MS_FCM 0x00000020 /* FCM */
50#define BR_MS_SDRAM 0x00000060 /* SDRAM */
51#define BR_MS_UPMA 0x00000080 /* UPMA */
52#define BR_MS_UPMB 0x000000A0 /* UPMB */
53#define BR_MS_UPMC 0x000000C0 /* UPMC */
54#define BR_V 0x00000001
55#define BR_V_SHIFT 0
56#define BR_RES ~(BR_BA|BR_PS|BR_DECC|BR_WP|BR_MSEL|BR_V)
57
58 __be32 or; /**< Base Register */
59#define OR0 0x5004
60#define OR1 0x500C
61#define OR2 0x5014
62#define OR3 0x501C
63#define OR4 0x5024
64#define OR5 0x502C
65#define OR6 0x5034
66#define OR7 0x503C
67
68#define OR_FCM_AM 0xFFFF8000
69#define OR_FCM_AM_SHIFT 15
70#define OR_FCM_BCTLD 0x00001000
71#define OR_FCM_BCTLD_SHIFT 12
72#define OR_FCM_PGS 0x00000400
73#define OR_FCM_PGS_SHIFT 10
74#define OR_FCM_CSCT 0x00000200
75#define OR_FCM_CSCT_SHIFT 9
76#define OR_FCM_CST 0x00000100
77#define OR_FCM_CST_SHIFT 8
78#define OR_FCM_CHT 0x00000080
79#define OR_FCM_CHT_SHIFT 7
80#define OR_FCM_SCY 0x00000070
81#define OR_FCM_SCY_SHIFT 4
82#define OR_FCM_SCY_1 0x00000010
83#define OR_FCM_SCY_2 0x00000020
84#define OR_FCM_SCY_3 0x00000030
85#define OR_FCM_SCY_4 0x00000040
86#define OR_FCM_SCY_5 0x00000050
87#define OR_FCM_SCY_6 0x00000060
88#define OR_FCM_SCY_7 0x00000070
89#define OR_FCM_RST 0x00000008
90#define OR_FCM_RST_SHIFT 3
91#define OR_FCM_TRLX 0x00000004
92#define OR_FCM_TRLX_SHIFT 2
93#define OR_FCM_EHTR 0x00000002
94#define OR_FCM_EHTR_SHIFT 1
95};
96
97struct fsl_lbc_regs {
98 struct fsl_lbc_bank bank[8];
99 u8 res0[0x28];
100 __be32 mar; /**< UPM Address Register */
101 u8 res1[0x4];
102 __be32 mamr; /**< UPMA Mode Register */
103#define MxMR_OP_NO (0 << 28) /**< normal operation */
104#define MxMR_OP_WA (1 << 28) /**< write array */
105#define MxMR_OP_RA (2 << 28) /**< read array */
106#define MxMR_OP_RP (3 << 28) /**< run pattern */
107#define MxMR_MAD 0x3f /**< machine address */
108 __be32 mbmr; /**< UPMB Mode Register */
109 __be32 mcmr; /**< UPMC Mode Register */
110 u8 res2[0x8];
111 __be32 mrtpr; /**< Memory Refresh Timer Prescaler Register */
112 __be32 mdr; /**< UPM Data Register */
113 u8 res3[0x4];
114 __be32 lsor; /**< Special Operation Initiation Register */
115 __be32 lsdmr; /**< SDRAM Mode Register */
116 u8 res4[0x8];
117 __be32 lurt; /**< UPM Refresh Timer */
118 __be32 lsrt; /**< SDRAM Refresh Timer */
119 u8 res5[0x8];
120 __be32 ltesr; /**< Transfer Error Status Register */
121#define LTESR_BM 0x80000000
122#define LTESR_FCT 0x40000000
123#define LTESR_PAR 0x20000000
124#define LTESR_WP 0x04000000
125#define LTESR_ATMW 0x00800000
126#define LTESR_ATMR 0x00400000
127#define LTESR_CS 0x00080000
128#define LTESR_CC 0x00000001
129#define LTESR_NAND_MASK (LTESR_FCT | LTESR_PAR | LTESR_CC)
130 __be32 ltedr; /**< Transfer Error Disable Register */
131 __be32 lteir; /**< Transfer Error Interrupt Register */
132 __be32 lteatr; /**< Transfer Error Attributes Register */
133 __be32 ltear; /**< Transfer Error Address Register */
134 u8 res6[0xC];
135 __be32 lbcr; /**< Configuration Register */
136#define LBCR_LDIS 0x80000000
137#define LBCR_LDIS_SHIFT 31
138#define LBCR_BCTLC 0x00C00000
139#define LBCR_BCTLC_SHIFT 22
140#define LBCR_AHD 0x00200000
141#define LBCR_LPBSE 0x00020000
142#define LBCR_LPBSE_SHIFT 17
143#define LBCR_EPAR 0x00010000
144#define LBCR_EPAR_SHIFT 16
145#define LBCR_BMT 0x0000FF00
146#define LBCR_BMT_SHIFT 8
147#define LBCR_INIT 0x00040000
148 __be32 lcrr; /**< Clock Ratio Register */
149#define LCRR_DBYP 0x80000000
150#define LCRR_DBYP_SHIFT 31
151#define LCRR_BUFCMDC 0x30000000
152#define LCRR_BUFCMDC_SHIFT 28
153#define LCRR_ECL 0x03000000
154#define LCRR_ECL_SHIFT 24
155#define LCRR_EADC 0x00030000
156#define LCRR_EADC_SHIFT 16
157#define LCRR_CLKDIV 0x0000000F
158#define LCRR_CLKDIV_SHIFT 0
159 u8 res7[0x8];
160 __be32 fmr; /**< Flash Mode Register */
161#define FMR_CWTO 0x0000F000
162#define FMR_CWTO_SHIFT 12
163#define FMR_BOOT 0x00000800
164#define FMR_ECCM 0x00000100
165#define FMR_AL 0x00000030
166#define FMR_AL_SHIFT 4
167#define FMR_OP 0x00000003
168#define FMR_OP_SHIFT 0
169 __be32 fir; /**< Flash Instruction Register */
170#define FIR_OP0 0xF0000000
171#define FIR_OP0_SHIFT 28
172#define FIR_OP1 0x0F000000
173#define FIR_OP1_SHIFT 24
174#define FIR_OP2 0x00F00000
175#define FIR_OP2_SHIFT 20
176#define FIR_OP3 0x000F0000
177#define FIR_OP3_SHIFT 16
178#define FIR_OP4 0x0000F000
179#define FIR_OP4_SHIFT 12
180#define FIR_OP5 0x00000F00
181#define FIR_OP5_SHIFT 8
182#define FIR_OP6 0x000000F0
183#define FIR_OP6_SHIFT 4
184#define FIR_OP7 0x0000000F
185#define FIR_OP7_SHIFT 0
186#define FIR_OP_NOP 0x0 /* No operation and end of sequence */
187#define FIR_OP_CA 0x1 /* Issue current column address */
188#define FIR_OP_PA 0x2 /* Issue current block+page address */
189#define FIR_OP_UA 0x3 /* Issue user defined address */
190#define FIR_OP_CM0 0x4 /* Issue command from FCR[CMD0] */
191#define FIR_OP_CM1 0x5 /* Issue command from FCR[CMD1] */
192#define FIR_OP_CM2 0x6 /* Issue command from FCR[CMD2] */
193#define FIR_OP_CM3 0x7 /* Issue command from FCR[CMD3] */
194#define FIR_OP_WB 0x8 /* Write FBCR bytes from FCM buffer */
195#define FIR_OP_WS 0x9 /* Write 1 or 2 bytes from MDR[AS] */
196#define FIR_OP_RB 0xA /* Read FBCR bytes to FCM buffer */
197#define FIR_OP_RS 0xB /* Read 1 or 2 bytes to MDR[AS] */
198#define FIR_OP_CW0 0xC /* Wait then issue FCR[CMD0] */
199#define FIR_OP_CW1 0xD /* Wait then issue FCR[CMD1] */
200#define FIR_OP_RBW 0xE /* Wait then read FBCR bytes */
201#define FIR_OP_RSW 0xE /* Wait then read 1 or 2 bytes */
202 __be32 fcr; /**< Flash Command Register */
203#define FCR_CMD0 0xFF000000
204#define FCR_CMD0_SHIFT 24
205#define FCR_CMD1 0x00FF0000
206#define FCR_CMD1_SHIFT 16
207#define FCR_CMD2 0x0000FF00
208#define FCR_CMD2_SHIFT 8
209#define FCR_CMD3 0x000000FF
210#define FCR_CMD3_SHIFT 0
211 __be32 fbar; /**< Flash Block Address Register */
212#define FBAR_BLK 0x00FFFFFF
213 __be32 fpar; /**< Flash Page Address Register */
214#define FPAR_SP_PI 0x00007C00
215#define FPAR_SP_PI_SHIFT 10
216#define FPAR_SP_MS 0x00000200
217#define FPAR_SP_CI 0x000001FF
218#define FPAR_SP_CI_SHIFT 0
219#define FPAR_LP_PI 0x0003F000
220#define FPAR_LP_PI_SHIFT 12
221#define FPAR_LP_MS 0x00000800
222#define FPAR_LP_CI 0x000007FF
223#define FPAR_LP_CI_SHIFT 0
224 __be32 fbcr; /**< Flash Byte Count Register */
225#define FBCR_BC 0x00000FFF
226 u8 res11[0x8];
227 u8 res8[0xF00];
228};
229
230extern struct fsl_lbc_regs __iomem *fsl_lbc_regs;
231extern spinlock_t fsl_lbc_lock;
232
233/*
234 * FSL UPM routines
235 */
236struct fsl_upm {
237 __be32 __iomem *mxmr;
238 int width;
239};
240
241extern int fsl_lbc_find(phys_addr_t addr_base);
242extern int fsl_upm_find(phys_addr_t addr_base, struct fsl_upm *upm);
243
244/**
245 * fsl_upm_start_pattern - start UPM patterns execution
246 * @upm: pointer to the fsl_upm structure obtained via fsl_upm_find
247 * @pat_offset: UPM pattern offset for the command to be executed
248 *
249 * This routine programmes UPM so the next memory access that hits an UPM
250 * will trigger pattern execution, starting at pat_offset.
251 */
252static inline void fsl_upm_start_pattern(struct fsl_upm *upm, u8 pat_offset)
253{
254 clrsetbits_be32(upm->mxmr, MxMR_MAD, MxMR_OP_RP | pat_offset);
255}
256
257/**
258 * fsl_upm_end_pattern - end UPM patterns execution
259 * @upm: pointer to the fsl_upm structure obtained via fsl_upm_find
260 *
261 * This routine reverts UPM to normal operation mode.
262 */
263static inline void fsl_upm_end_pattern(struct fsl_upm *upm)
264{
265 clrbits32(upm->mxmr, MxMR_OP_RP);
266
267 while (in_be32(upm->mxmr) & MxMR_OP_RP)
268 cpu_relax();
269}
270
271/**
272 * fsl_upm_run_pattern - actually run an UPM pattern
273 * @upm: pointer to the fsl_upm structure obtained via fsl_upm_find
274 * @io_base: remapped pointer to where memory access should happen
275 * @mar: MAR register content during pattern execution
276 *
277 * This function triggers dummy write to the memory specified by the io_base,
278 * thus UPM pattern actually executed. Note that mar usage depends on the
279 * pre-programmed AMX bits in the UPM RAM.
280 */
281static inline int fsl_upm_run_pattern(struct fsl_upm *upm,
282 void __iomem *io_base, u32 mar)
283{
284 int ret = 0;
285 unsigned long flags;
286
287 spin_lock_irqsave(&fsl_lbc_lock, flags);
288
289 out_be32(&fsl_lbc_regs->mar, mar << (32 - upm->width));
290
291 switch (upm->width) {
292 case 8:
293 out_8(io_base, 0x0);
294 break;
295 case 16:
296 out_be16(io_base, 0x0);
297 break;
298 case 32:
299 out_be32(io_base, 0x0);
300 break;
301 default:
302 ret = -EINVAL;
303 break;
304 }
305
306 spin_unlock_irqrestore(&fsl_lbc_lock, flags);
307
308 return ret;
309}
310
311#endif /* __ASM_FSL_LBC_H */
diff --git a/include/asm-powerpc/gpio.h b/include/asm-powerpc/gpio.h
new file mode 100644
index 000000000000..77ad3a890f30
--- /dev/null
+++ b/include/asm-powerpc/gpio.h
@@ -0,0 +1,56 @@
1/*
2 * Generic GPIO API implementation for PowerPC.
3 *
4 * Copyright (c) 2007-2008 MontaVista Software, Inc.
5 *
6 * Author: Anton Vorontsov <avorontsov@ru.mvista.com>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 */
13
14#ifndef __ASM_POWERPC_GPIO_H
15#define __ASM_POWERPC_GPIO_H
16
17#include <linux/errno.h>
18#include <asm-generic/gpio.h>
19
20#ifdef CONFIG_HAVE_GPIO_LIB
21
22/*
23 * We don't (yet) implement inlined/rapid versions for on-chip gpios.
24 * Just call gpiolib.
25 */
26static inline int gpio_get_value(unsigned int gpio)
27{
28 return __gpio_get_value(gpio);
29}
30
31static inline void gpio_set_value(unsigned int gpio, int value)
32{
33 __gpio_set_value(gpio, value);
34}
35
36static inline int gpio_cansleep(unsigned int gpio)
37{
38 return __gpio_cansleep(gpio);
39}
40
41/*
42 * Not implemented, yet.
43 */
44static inline int gpio_to_irq(unsigned int gpio)
45{
46 return -ENOSYS;
47}
48
49static inline int irq_to_gpio(unsigned int irq)
50{
51 return -EINVAL;
52}
53
54#endif /* CONFIG_HAVE_GPIO_LIB */
55
56#endif /* __ASM_POWERPC_GPIO_H */
diff --git a/include/asm-powerpc/hw_irq.h b/include/asm-powerpc/hw_irq.h
index a7b60bf639e0..ad8c9f7fd0e3 100644
--- a/include/asm-powerpc/hw_irq.h
+++ b/include/asm-powerpc/hw_irq.h
@@ -27,7 +27,7 @@ static inline unsigned long local_get_flags(void)
27 return flags; 27 return flags;
28} 28}
29 29
30static inline unsigned long local_irq_disable(void) 30static inline unsigned long raw_local_irq_disable(void)
31{ 31{
32 unsigned long flags, zero; 32 unsigned long flags, zero;
33 33
@@ -39,14 +39,15 @@ static inline unsigned long local_irq_disable(void)
39 return flags; 39 return flags;
40} 40}
41 41
42extern void local_irq_restore(unsigned long); 42extern void raw_local_irq_restore(unsigned long);
43extern void iseries_handle_interrupts(void); 43extern void iseries_handle_interrupts(void);
44 44
45#define local_irq_enable() local_irq_restore(1) 45#define raw_local_irq_enable() raw_local_irq_restore(1)
46#define local_save_flags(flags) ((flags) = local_get_flags()) 46#define raw_local_save_flags(flags) ((flags) = local_get_flags())
47#define local_irq_save(flags) ((flags) = local_irq_disable()) 47#define raw_local_irq_save(flags) ((flags) = raw_local_irq_disable())
48 48
49#define irqs_disabled() (local_get_flags() == 0) 49#define raw_irqs_disabled() (local_get_flags() == 0)
50#define raw_irqs_disabled_flags(flags) ((flags) == 0)
50 51
51#define __hard_irq_enable() __mtmsrd(mfmsr() | MSR_EE, 1) 52#define __hard_irq_enable() __mtmsrd(mfmsr() | MSR_EE, 1)
52#define __hard_irq_disable() __mtmsrd(mfmsr() & ~MSR_EE, 1) 53#define __hard_irq_disable() __mtmsrd(mfmsr() & ~MSR_EE, 1)
diff --git a/include/asm-powerpc/immap_qe.h b/include/asm-powerpc/immap_qe.h
index 82a452615097..7b6f411db3e6 100644
--- a/include/asm-powerpc/immap_qe.h
+++ b/include/asm-powerpc/immap_qe.h
@@ -20,6 +20,7 @@
20#ifdef __KERNEL__ 20#ifdef __KERNEL__
21 21
22#include <linux/kernel.h> 22#include <linux/kernel.h>
23#include <asm/io.h>
23 24
24#define QE_IMMAP_SIZE (1024 * 1024) /* 1MB from 1MB+IMMR */ 25#define QE_IMMAP_SIZE (1024 * 1024) /* 1MB from 1MB+IMMR */
25 26
@@ -468,7 +469,7 @@ struct qe_immap {
468 u8 res18[0xC0000]; /* 0x140000 - 0x200000 */ 469 u8 res18[0xC0000]; /* 0x140000 - 0x200000 */
469} __attribute__ ((packed)); 470} __attribute__ ((packed));
470 471
471extern struct qe_immap *qe_immr; 472extern struct qe_immap __iomem *qe_immr;
472extern phys_addr_t get_qe_base(void); 473extern phys_addr_t get_qe_base(void);
473 474
474static inline unsigned long immrbar_virt_to_phys(void *address) 475static inline unsigned long immrbar_virt_to_phys(void *address)
diff --git a/include/asm-powerpc/irqflags.h b/include/asm-powerpc/irqflags.h
index 7970cbaeaa54..cc6fdba33660 100644
--- a/include/asm-powerpc/irqflags.h
+++ b/include/asm-powerpc/irqflags.h
@@ -2,30 +2,43 @@
2 * include/asm-powerpc/irqflags.h 2 * include/asm-powerpc/irqflags.h
3 * 3 *
4 * IRQ flags handling 4 * IRQ flags handling
5 *
6 * This file gets included from lowlevel asm headers too, to provide
7 * wrapped versions of the local_irq_*() APIs, based on the
8 * raw_local_irq_*() macros from the lowlevel headers.
9 */ 5 */
10#ifndef _ASM_IRQFLAGS_H 6#ifndef _ASM_IRQFLAGS_H
11#define _ASM_IRQFLAGS_H 7#define _ASM_IRQFLAGS_H
12 8
9#ifndef __ASSEMBLY__
13/* 10/*
14 * Get definitions for raw_local_save_flags(x), etc. 11 * Get definitions for raw_local_save_flags(x), etc.
15 */ 12 */
16#include <asm-powerpc/hw_irq.h> 13#include <asm-powerpc/hw_irq.h>
17 14
15#else
16#ifdef CONFIG_TRACE_IRQFLAGS
18/* 17/*
19 * Do the CPU's IRQ-state tracing from assembly code. We call a 18 * Most of the CPU's IRQ-state tracing is done from assembly code; we
20 * C function, so save all the C-clobbered registers: 19 * have to call a C function so call a wrapper that saves all the
20 * C-clobbered registers.
21 */ 21 */
22#ifdef CONFIG_TRACE_IRQFLAGS 22#define TRACE_ENABLE_INTS bl .trace_hardirqs_on
23 23#define TRACE_DISABLE_INTS bl .trace_hardirqs_off
24#error No support on PowerPC yet for CONFIG_TRACE_IRQFLAGS 24#define TRACE_AND_RESTORE_IRQ_PARTIAL(en,skip) \
25 25 cmpdi en, 0; \
26 bne 95f; \
27 stb en,PACASOFTIRQEN(r13); \
28 bl .trace_hardirqs_off; \
29 b skip; \
3095: bl .trace_hardirqs_on; \
31 li en,1;
32#define TRACE_AND_RESTORE_IRQ(en) \
33 TRACE_AND_RESTORE_IRQ_PARTIAL(en,96f); \
3496: stb en,PACASOFTIRQEN(r13)
26#else 35#else
27# define TRACE_IRQS_ON 36#define TRACE_ENABLE_INTS
28# define TRACE_IRQS_OFF 37#define TRACE_DISABLE_INTS
38#define TRACE_AND_RESTORE_IRQ_PARTIAL(en,skip)
39#define TRACE_AND_RESTORE_IRQ(en) \
40 stb en,PACASOFTIRQEN(r13)
41#endif
29#endif 42#endif
30 43
31#endif 44#endif
diff --git a/include/asm-powerpc/iseries/alpaca.h b/include/asm-powerpc/iseries/alpaca.h
new file mode 100644
index 000000000000..c0cce6727a69
--- /dev/null
+++ b/include/asm-powerpc/iseries/alpaca.h
@@ -0,0 +1,31 @@
1/*
2 * Copyright © 2008 Stephen Rothwell IBM Corporation
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 */
18#ifndef _ASM_POWERPC_ISERIES_ALPACA_H
19#define _ASM_POWERPC_ISERIES_ALPACA_H
20
21/*
22 * This is the part of the paca that the iSeries hypervisor
23 * needs to be statically initialised. Immediately after boot
24 * we switch to the normal Linux paca.
25 */
26struct alpaca {
27 struct lppaca *lppaca_ptr; /* Pointer to LpPaca for PLIC */
28 const void *reg_save_ptr; /* Pointer to LpRegSave for PLIC */
29};
30
31#endif /* _ASM_POWERPC_ISERIES_ALPACA_H */
diff --git a/include/asm-powerpc/iseries/it_lp_reg_save.h b/include/asm-powerpc/iseries/it_lp_reg_save.h
deleted file mode 100644
index 5403b756f654..000000000000
--- a/include/asm-powerpc/iseries/it_lp_reg_save.h
+++ /dev/null
@@ -1,85 +0,0 @@
1/*
2 * Copyright (C) 2001 Mike Corrigan IBM Corporation
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 */
18#ifndef _ASM_POWERPC_ISERIES_IT_LP_REG_SAVE_H
19#define _ASM_POWERPC_ISERIES_IT_LP_REG_SAVE_H
20
21/*
22 * This control block contains the data that is shared between PLIC
23 * and the OS
24 */
25
26struct ItLpRegSave {
27 u32 xDesc; // Eye catcher "LpRS" ebcdic 000-003
28 u16 xSize; // Size of this class 004-005
29 u8 xInUse; // Area is live 006-007
30 u8 xRsvd1[9]; // Reserved 007-00F
31
32 u8 xFixedRegSave[352]; // Fixed Register Save Area 010-16F
33 u32 xCTRL; // Control Register 170-173
34 u32 xDEC; // Decrementer 174-177
35 u32 xFPSCR; // FP Status and Control Reg 178-17B
36 u32 xPVR; // Processor Version Number 17C-17F
37
38 u64 xMMCR0; // Monitor Mode Control Reg 0 180-187
39 u32 xPMC1; // Perf Monitor Counter 1 188-18B
40 u32 xPMC2; // Perf Monitor Counter 2 18C-18F
41 u32 xPMC3; // Perf Monitor Counter 3 190-193
42 u32 xPMC4; // Perf Monitor Counter 4 194-197
43 u32 xPIR; // Processor ID Reg 198-19B
44
45 u32 xMMCR1; // Monitor Mode Control Reg 1 19C-19F
46 u32 xMMCRA; // Monitor Mode Control Reg A 1A0-1A3
47 u32 xPMC5; // Perf Monitor Counter 5 1A4-1A7
48 u32 xPMC6; // Perf Monitor Counter 6 1A8-1AB
49 u32 xPMC7; // Perf Monitor Counter 7 1AC-1AF
50 u32 xPMC8; // Perf Monitor Counter 8 1B0-1B3
51 u32 xTSC; // Thread Switch Control 1B4-1B7
52 u32 xTST; // Thread Switch Timeout 1B8-1BB
53 u32 xRsvd; // Reserved 1BC-1BF
54
55 u64 xACCR; // Address Compare Control Reg 1C0-1C7
56 u64 xIMR; // Instruction Match Register 1C8-1CF
57 u64 xSDR1; // Storage Description Reg 1 1D0-1D7
58 u64 xSPRG0; // Special Purpose Reg General0 1D8-1DF
59 u64 xSPRG1; // Special Purpose Reg General1 1E0-1E7
60 u64 xSPRG2; // Special Purpose Reg General2 1E8-1EF
61 u64 xSPRG3; // Special Purpose Reg General3 1F0-1F7
62 u64 xTB; // Time Base Register 1F8-1FF
63
64 u64 xFPR[32]; // Floating Point Registers 200-2FF
65
66 u64 xMSR; // Machine State Register 300-307
67 u64 xNIA; // Next Instruction Address 308-30F
68
69 u64 xDABR; // Data Address Breakpoint Reg 310-317
70 u64 xIABR; // Inst Address Breakpoint Reg 318-31F
71
72 u64 xHID0; // HW Implementation Dependent0 320-327
73
74 u64 xHID4; // HW Implementation Dependent4 328-32F
75 u64 xSCOMd; // SCON Data Reg (SPRG4) 330-337
76 u64 xSCOMc; // SCON Command Reg (SPRG5) 338-33F
77 u64 xSDAR; // Sample Data Address Register 340-347
78 u64 xSIAR; // Sample Inst Address Register 348-34F
79
80 u8 xRsvd3[176]; // Reserved 350-3FF
81};
82
83extern struct ItLpRegSave iseries_reg_save[];
84
85#endif /* _ASM_POWERPC_ISERIES_IT_LP_REG_SAVE_H */
diff --git a/include/asm-powerpc/lmb.h b/include/asm-powerpc/lmb.h
index 5d1dc48a0bb8..6f5fdf0a19ae 100644
--- a/include/asm-powerpc/lmb.h
+++ b/include/asm-powerpc/lmb.h
@@ -1,81 +1,15 @@
1#ifndef _ASM_POWERPC_LMB_H 1#ifndef _ASM_POWERPC_LMB_H
2#define _ASM_POWERPC_LMB_H 2#define _ASM_POWERPC_LMB_H
3#ifdef __KERNEL__
4 3
5/* 4#include <asm/udbg.h>
6 * Definitions for talking to the Open Firmware PROM on
7 * Power Macintosh computers.
8 *
9 * Copyright (C) 2001 Peter Bergner, IBM Corp.
10 *
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License
13 * as published by the Free Software Foundation; either version
14 * 2 of the License, or (at your option) any later version.
15 */
16 5
17#include <linux/init.h> 6#define LMB_DBG(fmt...) udbg_printf(fmt)
18#include <asm/prom.h>
19 7
20#define MAX_LMB_REGIONS 128 8#ifdef CONFIG_PPC32
9extern phys_addr_t lowmem_end_addr;
10#define LMB_REAL_LIMIT lowmem_end_addr
11#else
12#define LMB_REAL_LIMIT 0
13#endif
21 14
22struct lmb_property {
23 unsigned long base;
24 unsigned long size;
25};
26
27struct lmb_region {
28 unsigned long cnt;
29 unsigned long size;
30 struct lmb_property region[MAX_LMB_REGIONS+1];
31};
32
33struct lmb {
34 unsigned long debug;
35 unsigned long rmo_size;
36 struct lmb_region memory;
37 struct lmb_region reserved;
38};
39
40extern struct lmb lmb;
41
42extern void __init lmb_init(void);
43extern void __init lmb_analyze(void);
44extern long __init lmb_add(unsigned long base, unsigned long size);
45extern long __init lmb_reserve(unsigned long base, unsigned long size);
46extern unsigned long __init lmb_alloc(unsigned long size, unsigned long align);
47extern unsigned long __init lmb_alloc_base(unsigned long size,
48 unsigned long align, unsigned long max_addr);
49extern unsigned long __init __lmb_alloc_base(unsigned long size,
50 unsigned long align, unsigned long max_addr);
51extern unsigned long __init lmb_phys_mem_size(void);
52extern unsigned long __init lmb_end_of_DRAM(void);
53extern void __init lmb_enforce_memory_limit(unsigned long memory_limit);
54extern int __init lmb_is_reserved(unsigned long addr);
55
56extern void lmb_dump_all(void);
57
58static inline unsigned long
59lmb_size_bytes(struct lmb_region *type, unsigned long region_nr)
60{
61 return type->region[region_nr].size;
62}
63static inline unsigned long
64lmb_size_pages(struct lmb_region *type, unsigned long region_nr)
65{
66 return lmb_size_bytes(type, region_nr) >> PAGE_SHIFT;
67}
68static inline unsigned long
69lmb_start_pfn(struct lmb_region *type, unsigned long region_nr)
70{
71 return type->region[region_nr].base >> PAGE_SHIFT;
72}
73static inline unsigned long
74lmb_end_pfn(struct lmb_region *type, unsigned long region_nr)
75{
76 return lmb_start_pfn(type, region_nr) +
77 lmb_size_pages(type, region_nr);
78}
79
80#endif /* __KERNEL__ */
81#endif /* _ASM_POWERPC_LMB_H */ 15#endif /* _ASM_POWERPC_LMB_H */
diff --git a/include/asm-powerpc/machdep.h b/include/asm-powerpc/machdep.h
index 0872ec228c1e..54ed64df95b8 100644
--- a/include/asm-powerpc/machdep.h
+++ b/include/asm-powerpc/machdep.h
@@ -68,6 +68,8 @@ struct machdep_calls {
68 unsigned long vflags, 68 unsigned long vflags,
69 int psize, int ssize); 69 int psize, int ssize);
70 long (*hpte_remove)(unsigned long hpte_group); 70 long (*hpte_remove)(unsigned long hpte_group);
71 void (*hpte_removebolted)(unsigned long ea,
72 int psize, int ssize);
71 void (*flush_hash_range)(unsigned long number, int local); 73 void (*flush_hash_range)(unsigned long number, int local);
72 74
73 /* special for kexec, to be called in real mode, linar mapping is 75 /* special for kexec, to be called in real mode, linar mapping is
@@ -196,9 +198,6 @@ struct machdep_calls {
196 May be NULL. */ 198 May be NULL. */
197 void (*init)(void); 199 void (*init)(void);
198 200
199 void (*setup_io_mappings)(void);
200
201 void (*early_serial_map)(void);
202 void (*kgdb_map_scc)(void); 201 void (*kgdb_map_scc)(void);
203 202
204 /* 203 /*
diff --git a/include/asm-powerpc/macio.h b/include/asm-powerpc/macio.h
index 3a6cb1a513b7..079c06eae446 100644
--- a/include/asm-powerpc/macio.h
+++ b/include/asm-powerpc/macio.h
@@ -2,7 +2,7 @@
2#define __MACIO_ASIC_H__ 2#define __MACIO_ASIC_H__
3#ifdef __KERNEL__ 3#ifdef __KERNEL__
4 4
5#include <asm/of_device.h> 5#include <linux/of_device.h>
6 6
7extern struct bus_type macio_bus_type; 7extern struct bus_type macio_bus_type;
8 8
diff --git a/include/asm-powerpc/mmu-40x.h b/include/asm-powerpc/mmu-40x.h
index 7d37f77043ac..3d108676584c 100644
--- a/include/asm-powerpc/mmu-40x.h
+++ b/include/asm-powerpc/mmu-40x.h
@@ -53,8 +53,6 @@
53 53
54#ifndef __ASSEMBLY__ 54#ifndef __ASSEMBLY__
55 55
56typedef unsigned long phys_addr_t;
57
58typedef struct { 56typedef struct {
59 unsigned long id; 57 unsigned long id;
60 unsigned long vdso_base; 58 unsigned long vdso_base;
diff --git a/include/asm-powerpc/mmu-44x.h b/include/asm-powerpc/mmu-44x.h
index 62772ae839ca..c8b02d97f753 100644
--- a/include/asm-powerpc/mmu-44x.h
+++ b/include/asm-powerpc/mmu-44x.h
@@ -53,8 +53,6 @@
53 53
54#ifndef __ASSEMBLY__ 54#ifndef __ASSEMBLY__
55 55
56typedef unsigned long long phys_addr_t;
57
58typedef struct { 56typedef struct {
59 unsigned long id; 57 unsigned long id;
60 unsigned long vdso_base; 58 unsigned long vdso_base;
diff --git a/include/asm-powerpc/mmu-8xx.h b/include/asm-powerpc/mmu-8xx.h
index 952bd8899f2f..9db877eb88db 100644
--- a/include/asm-powerpc/mmu-8xx.h
+++ b/include/asm-powerpc/mmu-8xx.h
@@ -136,8 +136,6 @@
136#define SPRN_M_TW 799 136#define SPRN_M_TW 799
137 137
138#ifndef __ASSEMBLY__ 138#ifndef __ASSEMBLY__
139typedef unsigned long phys_addr_t;
140
141typedef struct { 139typedef struct {
142 unsigned long id; 140 unsigned long id;
143 unsigned long vdso_base; 141 unsigned long vdso_base;
diff --git a/include/asm-powerpc/mmu-fsl-booke.h b/include/asm-powerpc/mmu-fsl-booke.h
index 37580004cd7a..925d93cf64d8 100644
--- a/include/asm-powerpc/mmu-fsl-booke.h
+++ b/include/asm-powerpc/mmu-fsl-booke.h
@@ -73,12 +73,6 @@
73 73
74#ifndef __ASSEMBLY__ 74#ifndef __ASSEMBLY__
75 75
76#ifndef CONFIG_PHYS_64BIT
77typedef unsigned long phys_addr_t;
78#else
79typedef unsigned long long phys_addr_t;
80#endif
81
82typedef struct { 76typedef struct {
83 unsigned long id; 77 unsigned long id;
84 unsigned long vdso_base; 78 unsigned long vdso_base;
diff --git a/include/asm-powerpc/mmu-hash32.h b/include/asm-powerpc/mmu-hash32.h
index 4bd735be3833..6e21ca618ec3 100644
--- a/include/asm-powerpc/mmu-hash32.h
+++ b/include/asm-powerpc/mmu-hash32.h
@@ -84,8 +84,6 @@ typedef struct {
84 unsigned long vdso_base; 84 unsigned long vdso_base;
85} mm_context_t; 85} mm_context_t;
86 86
87typedef unsigned long phys_addr_t;
88
89#endif /* !__ASSEMBLY__ */ 87#endif /* !__ASSEMBLY__ */
90 88
91#endif /* _ASM_POWERPC_MMU_HASH32_H_ */ 89#endif /* _ASM_POWERPC_MMU_HASH32_H_ */
diff --git a/include/asm-powerpc/mmu-hash64.h b/include/asm-powerpc/mmu-hash64.h
index 2864fa3989ea..0dff76776044 100644
--- a/include/asm-powerpc/mmu-hash64.h
+++ b/include/asm-powerpc/mmu-hash64.h
@@ -469,9 +469,6 @@ static inline unsigned long get_vsid(unsigned long context, unsigned long ea,
469 VSID_MODULUS_256M) 469 VSID_MODULUS_256M)
470#define KERNEL_VSID(ea) VSID_SCRAMBLE(GET_ESID(ea)) 470#define KERNEL_VSID(ea) VSID_SCRAMBLE(GET_ESID(ea))
471 471
472/* Physical address used by some IO functions */
473typedef unsigned long phys_addr_t;
474
475#endif /* __ASSEMBLY__ */ 472#endif /* __ASSEMBLY__ */
476 473
477#endif /* _ASM_POWERPC_MMU_HASH64_H_ */ 474#endif /* _ASM_POWERPC_MMU_HASH64_H_ */
diff --git a/include/asm-powerpc/paca.h b/include/asm-powerpc/paca.h
index 748b35ab37b5..eb61b9c1edfd 100644
--- a/include/asm-powerpc/paca.h
+++ b/include/asm-powerpc/paca.h
@@ -42,10 +42,7 @@ struct task_struct;
42 * Defines the layout of the paca. 42 * Defines the layout of the paca.
43 * 43 *
44 * This structure is not directly accessed by firmware or the service 44 * This structure is not directly accessed by firmware or the service
45 * processor except for the first two pointers that point to the 45 * processor.
46 * lppaca area and the ItLpRegSave area for this CPU. The lppaca
47 * object is currently contained within the PACA but it doesn't need
48 * to be.
49 */ 46 */
50struct paca_struct { 47struct paca_struct {
51 /* 48 /*
@@ -55,14 +52,7 @@ struct paca_struct {
55 * avoid cacheline bouncing. 52 * avoid cacheline bouncing.
56 */ 53 */
57 54
58 /*
59 * MAGIC: These first two pointers can't be moved - they're
60 * accessed by the firmware
61 */
62 struct lppaca *lppaca_ptr; /* Pointer to LpPaca for PLIC */ 55 struct lppaca *lppaca_ptr; /* Pointer to LpPaca for PLIC */
63#ifdef CONFIG_PPC_ISERIES
64 void *reg_save_ptr; /* Pointer to LpRegSave for PLIC */
65#endif /* CONFIG_PPC_ISERIES */
66 56
67 /* 57 /*
68 * MAGIC: the spinlock functions in arch/powerpc/lib/locks.c 58 * MAGIC: the spinlock functions in arch/powerpc/lib/locks.c
diff --git a/include/asm-powerpc/page.h b/include/asm-powerpc/page.h
index df47bbb6ea13..6c850609b847 100644
--- a/include/asm-powerpc/page.h
+++ b/include/asm-powerpc/page.h
@@ -53,6 +53,7 @@
53 53
54#define PAGE_OFFSET ASM_CONST(CONFIG_KERNEL_START) 54#define PAGE_OFFSET ASM_CONST(CONFIG_KERNEL_START)
55#define KERNELBASE (PAGE_OFFSET + PHYSICAL_START) 55#define KERNELBASE (PAGE_OFFSET + PHYSICAL_START)
56#define LOAD_OFFSET PAGE_OFFSET
56 57
57#ifdef CONFIG_FLATMEM 58#ifdef CONFIG_FLATMEM
58#define pfn_valid(pfn) ((pfn) < max_mapnr) 59#define pfn_valid(pfn) ((pfn) < max_mapnr)
diff --git a/include/asm-powerpc/page_32.h b/include/asm-powerpc/page_32.h
index 65ea19eec956..51f8134b5939 100644
--- a/include/asm-powerpc/page_32.h
+++ b/include/asm-powerpc/page_32.h
@@ -3,8 +3,6 @@
3 3
4#define VM_DATA_DEFAULT_FLAGS VM_DATA_DEFAULT_FLAGS32 4#define VM_DATA_DEFAULT_FLAGS VM_DATA_DEFAULT_FLAGS32
5 5
6#define PPC_MEMSTART 0
7
8#ifdef CONFIG_NOT_COHERENT_CACHE 6#ifdef CONFIG_NOT_COHERENT_CACHE
9#define ARCH_KMALLOC_MINALIGN L1_CACHE_BYTES 7#define ARCH_KMALLOC_MINALIGN L1_CACHE_BYTES
10#endif 8#endif
diff --git a/include/asm-powerpc/pasemi_dma.h b/include/asm-powerpc/pasemi_dma.h
index b4526ff3a50d..19fd7933e2d9 100644
--- a/include/asm-powerpc/pasemi_dma.h
+++ b/include/asm-powerpc/pasemi_dma.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2006 PA Semi, Inc 2 * Copyright (C) 2006-2008 PA Semi, Inc
3 * 3 *
4 * Hardware register layout and descriptor formats for the on-board 4 * Hardware register layout and descriptor formats for the on-board
5 * DMA engine on PA Semi PWRficient. Used by ethernet, function and security 5 * DMA engine on PA Semi PWRficient. Used by ethernet, function and security
@@ -40,6 +40,11 @@ enum {
40 PAS_DMA_COM_TXSTA = 0x104, /* Transmit Status Register */ 40 PAS_DMA_COM_TXSTA = 0x104, /* Transmit Status Register */
41 PAS_DMA_COM_RXCMD = 0x108, /* Receive Command Register */ 41 PAS_DMA_COM_RXCMD = 0x108, /* Receive Command Register */
42 PAS_DMA_COM_RXSTA = 0x10c, /* Receive Status Register */ 42 PAS_DMA_COM_RXSTA = 0x10c, /* Receive Status Register */
43 PAS_DMA_COM_CFG = 0x114, /* Common config reg */
44 PAS_DMA_TXF_SFLG0 = 0x140, /* Set flags */
45 PAS_DMA_TXF_SFLG1 = 0x144, /* Set flags */
46 PAS_DMA_TXF_CFLG0 = 0x148, /* Set flags */
47 PAS_DMA_TXF_CFLG1 = 0x14c, /* Set flags */
43}; 48};
44 49
45 50
@@ -123,11 +128,16 @@ enum {
123#define PAS_DMA_TXCHAN_TCMDSTA_DA 0x00000100 128#define PAS_DMA_TXCHAN_TCMDSTA_DA 0x00000100
124#define PAS_DMA_TXCHAN_CFG(c) (0x304+(c)*_PAS_DMA_TXCHAN_STRIDE) 129#define PAS_DMA_TXCHAN_CFG(c) (0x304+(c)*_PAS_DMA_TXCHAN_STRIDE)
125#define PAS_DMA_TXCHAN_CFG_TY_IFACE 0x00000000 /* Type = interface */ 130#define PAS_DMA_TXCHAN_CFG_TY_IFACE 0x00000000 /* Type = interface */
131#define PAS_DMA_TXCHAN_CFG_TY_COPY 0x00000001 /* Type = copy only */
132#define PAS_DMA_TXCHAN_CFG_TY_FUNC 0x00000002 /* Type = function */
133#define PAS_DMA_TXCHAN_CFG_TY_XOR 0x00000003 /* Type = xor only */
126#define PAS_DMA_TXCHAN_CFG_TATTR_M 0x0000003c 134#define PAS_DMA_TXCHAN_CFG_TATTR_M 0x0000003c
127#define PAS_DMA_TXCHAN_CFG_TATTR_S 2 135#define PAS_DMA_TXCHAN_CFG_TATTR_S 2
128#define PAS_DMA_TXCHAN_CFG_TATTR(x) (((x) << PAS_DMA_TXCHAN_CFG_TATTR_S) & \ 136#define PAS_DMA_TXCHAN_CFG_TATTR(x) (((x) << PAS_DMA_TXCHAN_CFG_TATTR_S) & \
129 PAS_DMA_TXCHAN_CFG_TATTR_M) 137 PAS_DMA_TXCHAN_CFG_TATTR_M)
130#define PAS_DMA_TXCHAN_CFG_WT_M 0x000001c0 138#define PAS_DMA_TXCHAN_CFG_LPDQ 0x00000800
139#define PAS_DMA_TXCHAN_CFG_LPSQ 0x00000400
140#define PAS_DMA_TXCHAN_CFG_WT_M 0x000003c0
131#define PAS_DMA_TXCHAN_CFG_WT_S 6 141#define PAS_DMA_TXCHAN_CFG_WT_S 6
132#define PAS_DMA_TXCHAN_CFG_WT(x) (((x) << PAS_DMA_TXCHAN_CFG_WT_S) & \ 142#define PAS_DMA_TXCHAN_CFG_WT(x) (((x) << PAS_DMA_TXCHAN_CFG_WT_S) & \
133 PAS_DMA_TXCHAN_CFG_WT_M) 143 PAS_DMA_TXCHAN_CFG_WT_M)
@@ -394,11 +404,62 @@ enum {
394 XCT_COPY_LLEN_M) 404 XCT_COPY_LLEN_M)
395#define XCT_COPY_SE 0x0000000000000001ull 405#define XCT_COPY_SE 0x0000000000000001ull
396 406
407/* Function descriptor fields */
408#define XCT_FUN_T 0x8000000000000000ull
409#define XCT_FUN_ST 0x4000000000000000ull
410#define XCT_FUN_RR_M 0x3000000000000000ull
411#define XCT_FUN_RR_NORES 0x0000000000000000ull
412#define XCT_FUN_RR_8BRES 0x1000000000000000ull
413#define XCT_FUN_RR_24BRES 0x2000000000000000ull
414#define XCT_FUN_RR_40BRES 0x3000000000000000ull
415#define XCT_FUN_I 0x0800000000000000ull
416#define XCT_FUN_O 0x0400000000000000ull
417#define XCT_FUN_E 0x0200000000000000ull
418#define XCT_FUN_FUN_M 0x01c0000000000000ull
419#define XCT_FUN_FUN_S 54
420#define XCT_FUN_FUN(x) ((((long)(x)) << XCT_FUN_FUN_S) & XCT_FUN_FUN_M)
421#define XCT_FUN_CRM_M 0x0038000000000000ull
422#define XCT_FUN_CRM_NOP 0x0000000000000000ull
423#define XCT_FUN_CRM_SIG 0x0008000000000000ull
424#define XCT_FUN_LLEN_M 0x0007ffff00000000ull
425#define XCT_FUN_LLEN_S 32
426#define XCT_FUN_LLEN(x) ((((long)(x)) << XCT_FUN_LLEN_S) & XCT_FUN_LLEN_M)
427#define XCT_FUN_SHL_M 0x00000000f8000000ull
428#define XCT_FUN_SHL_S 27
429#define XCT_FUN_SHL(x) ((((long)(x)) << XCT_FUN_SHL_S) & XCT_FUN_SHL_M)
430#define XCT_FUN_CHL_M 0x0000000007c00000ull
431#define XCT_FUN_HSZ_M 0x00000000003c0000ull
432#define XCT_FUN_ALG_M 0x0000000000038000ull
433#define XCT_FUN_HP 0x0000000000004000ull
434#define XCT_FUN_BCM_M 0x0000000000003800ull
435#define XCT_FUN_BCP_M 0x0000000000000600ull
436#define XCT_FUN_SIG_M 0x00000000000001f0ull
437#define XCT_FUN_SIG_TCP4 0x0000000000000140ull
438#define XCT_FUN_SIG_TCP6 0x0000000000000150ull
439#define XCT_FUN_SIG_UDP4 0x0000000000000160ull
440#define XCT_FUN_SIG_UDP6 0x0000000000000170ull
441#define XCT_FUN_A 0x0000000000000008ull
442#define XCT_FUN_C 0x0000000000000004ull
443#define XCT_FUN_AL2 0x0000000000000002ull
444#define XCT_FUN_SE 0x0000000000000001ull
445
446/* Function descriptor 8byte result fields */
447#define XCT_FUNRES_8B_CS_M 0x0000ffff00000000ull
448#define XCT_FUNRES_8B_CS_S 32
449#define XCT_FUNRES_8B_CRC_M 0x00000000ffffffffull
450#define XCT_FUNRES_8B_CRC_S 0
451
397/* Control descriptor fields */ 452/* Control descriptor fields */
398#define CTRL_CMD_T 0x8000000000000000ull 453#define CTRL_CMD_T 0x8000000000000000ull
399#define CTRL_CMD_META_EVT 0x2000000000000000ull 454#define CTRL_CMD_META_EVT 0x2000000000000000ull
400#define CTRL_CMD_O 0x0400000000000000ull 455#define CTRL_CMD_O 0x0400000000000000ull
401#define CTRL_CMD_REG_M 0x000000000000000full 456#define CTRL_CMD_ETYPE_M 0x0038000000000000ull
457#define CTRL_CMD_ETYPE_EXT 0x0000000000000000ull
458#define CTRL_CMD_ETYPE_WSET 0x0020000000000000ull
459#define CTRL_CMD_ETYPE_WCLR 0x0028000000000000ull
460#define CTRL_CMD_ETYPE_SET 0x0030000000000000ull
461#define CTRL_CMD_ETYPE_CLR 0x0038000000000000ull
462#define CTRL_CMD_REG_M 0x000000000000007full
402#define CTRL_CMD_REG_S 0 463#define CTRL_CMD_REG_S 0
403#define CTRL_CMD_REG(x) ((((long)(x)) << CTRL_CMD_REG_S) & \ 464#define CTRL_CMD_REG(x) ((((long)(x)) << CTRL_CMD_REG_S) & \
404 CTRL_CMD_REG_M) 465 CTRL_CMD_REG_M)
@@ -461,6 +522,16 @@ extern void *pasemi_dma_alloc_buf(struct pasemi_dmachan *chan, int size,
461extern void pasemi_dma_free_buf(struct pasemi_dmachan *chan, int size, 522extern void pasemi_dma_free_buf(struct pasemi_dmachan *chan, int size,
462 dma_addr_t *handle); 523 dma_addr_t *handle);
463 524
525/* Routines to allocate flags (events) for channel syncronization */
526extern int pasemi_dma_alloc_flag(void);
527extern void pasemi_dma_free_flag(int flag);
528extern void pasemi_dma_set_flag(int flag);
529extern void pasemi_dma_clear_flag(int flag);
530
531/* Routines to allocate function engines */
532extern int pasemi_dma_alloc_fun(void);
533extern void pasemi_dma_free_fun(int fun);
534
464/* Initialize the library, must be called before any other functions */ 535/* Initialize the library, must be called before any other functions */
465extern int pasemi_dma_init(void); 536extern int pasemi_dma_init(void);
466 537
diff --git a/include/asm-powerpc/pci-bridge.h b/include/asm-powerpc/pci-bridge.h
index e5802c62f428..b95d033ae6e6 100644
--- a/include/asm-powerpc/pci-bridge.h
+++ b/include/asm-powerpc/pci-bridge.h
@@ -117,7 +117,7 @@ struct pci_controller {
117 117
118#ifndef CONFIG_PPC64 118#ifndef CONFIG_PPC64
119 119
120static inline struct pci_controller *pci_bus_to_host(struct pci_bus *bus) 120static inline struct pci_controller *pci_bus_to_host(const struct pci_bus *bus)
121{ 121{
122 return bus->sysdata; 122 return bus->sysdata;
123} 123}
@@ -235,7 +235,7 @@ extern void pcibios_fixup_new_pci_devices(struct pci_bus *bus);
235 235
236extern int pcibios_remove_root_bus(struct pci_controller *phb); 236extern int pcibios_remove_root_bus(struct pci_controller *phb);
237 237
238static inline struct pci_controller *pci_bus_to_host(struct pci_bus *bus) 238static inline struct pci_controller *pci_bus_to_host(const struct pci_bus *bus)
239{ 239{
240 struct device_node *busdn = bus->sysdata; 240 struct device_node *busdn = bus->sysdata;
241 241
diff --git a/include/asm-powerpc/pgtable-ppc32.h b/include/asm-powerpc/pgtable-ppc32.h
index 2c79f550272b..daea7692d070 100644
--- a/include/asm-powerpc/pgtable-ppc32.h
+++ b/include/asm-powerpc/pgtable-ppc32.h
@@ -98,9 +98,6 @@ extern int icache_44x_need_flush;
98#define USER_PTRS_PER_PGD (TASK_SIZE / PGDIR_SIZE) 98#define USER_PTRS_PER_PGD (TASK_SIZE / PGDIR_SIZE)
99#define FIRST_USER_ADDRESS 0 99#define FIRST_USER_ADDRESS 0
100 100
101#define USER_PGD_PTRS (PAGE_OFFSET >> PGDIR_SHIFT)
102#define KERNEL_PGD_PTRS (PTRS_PER_PGD-USER_PGD_PTRS)
103
104#define pte_ERROR(e) \ 101#define pte_ERROR(e) \
105 printk("%s:%d: bad pte %llx.\n", __FILE__, __LINE__, \ 102 printk("%s:%d: bad pte %llx.\n", __FILE__, __LINE__, \
106 (unsigned long long)pte_val(e)) 103 (unsigned long long)pte_val(e))
@@ -420,7 +417,8 @@ extern int icache_44x_need_flush;
420#define _PAGE_IO (_PAGE_KERNEL | _PAGE_NO_CACHE | _PAGE_GUARDED) 417#define _PAGE_IO (_PAGE_KERNEL | _PAGE_NO_CACHE | _PAGE_GUARDED)
421#define _PAGE_RAM (_PAGE_KERNEL | _PAGE_HWEXEC) 418#define _PAGE_RAM (_PAGE_KERNEL | _PAGE_HWEXEC)
422 419
423#if defined(CONFIG_KGDB) || defined(CONFIG_XMON) || defined(CONFIG_BDI_SWITCH) 420#if defined(CONFIG_KGDB) || defined(CONFIG_XMON) || defined(CONFIG_BDI_SWITCH) ||\
421 defined(CONFIG_KPROBES)
424/* We want the debuggers to be able to set breakpoints anywhere, so 422/* We want the debuggers to be able to set breakpoints anywhere, so
425 * don't write protect the kernel text */ 423 * don't write protect the kernel text */
426#define _PAGE_RAM_TEXT _PAGE_RAM 424#define _PAGE_RAM_TEXT _PAGE_RAM
@@ -692,7 +690,7 @@ extern pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn,
692#define pmd_page_vaddr(pmd) \ 690#define pmd_page_vaddr(pmd) \
693 ((unsigned long) (pmd_val(pmd) & PAGE_MASK)) 691 ((unsigned long) (pmd_val(pmd) & PAGE_MASK))
694#define pmd_page(pmd) \ 692#define pmd_page(pmd) \
695 (mem_map + (__pa(pmd_val(pmd)) >> PAGE_SHIFT)) 693 pfn_to_page((__pa(pmd_val(pmd)) >> PAGE_SHIFT))
696#endif 694#endif
697 695
698/* to find an entry in a kernel page-table-directory */ 696/* to find an entry in a kernel page-table-directory */
diff --git a/include/asm-powerpc/phyp_dump.h b/include/asm-powerpc/phyp_dump.h
new file mode 100644
index 000000000000..fa74c6c3e106
--- /dev/null
+++ b/include/asm-powerpc/phyp_dump.h
@@ -0,0 +1,47 @@
1/*
2 * Hypervisor-assisted dump
3 *
4 * Linas Vepstas, Manish Ahuja 2008
5 * Copyright 2008 IBM Corp.
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version
10 * 2 of the License, or (at your option) any later version.
11 */
12
13#ifndef _PPC64_PHYP_DUMP_H
14#define _PPC64_PHYP_DUMP_H
15
16#ifdef CONFIG_PHYP_DUMP
17
18/* The RMR region will be saved for later dumping
19 * whenever the kernel crashes. Set this to 256MB. */
20#define PHYP_DUMP_RMR_START 0x0
21#define PHYP_DUMP_RMR_END (1UL<<28)
22
23struct phyp_dump {
24 /* Memory that is reserved during very early boot. */
25 unsigned long init_reserve_start;
26 unsigned long init_reserve_size;
27 /* cmd line options during boot */
28 unsigned long reserve_bootvar;
29 unsigned long phyp_dump_at_boot;
30 /* Check status during boot if dump supported, active & present*/
31 unsigned long phyp_dump_configured;
32 unsigned long phyp_dump_is_active;
33 /* store cpu & hpte size */
34 unsigned long cpu_state_size;
35 unsigned long hpte_region_size;
36 /* previous scratch area values */
37 unsigned long reserved_scratch_addr;
38 unsigned long reserved_scratch_size;
39};
40
41extern struct phyp_dump *phyp_dump_info;
42
43int early_init_dt_scan_phyp_dump(unsigned long node,
44 const char *uname, int depth, void *data);
45
46#endif /* CONFIG_PHYP_DUMP */
47#endif /* _PPC64_PHYP_DUMP_H */
diff --git a/include/asm-powerpc/pmi.h b/include/asm-powerpc/pmi.h
index 2259d4ce3846..e1dc090748df 100644
--- a/include/asm-powerpc/pmi.h
+++ b/include/asm-powerpc/pmi.h
@@ -29,8 +29,6 @@
29 29
30#ifdef __KERNEL__ 30#ifdef __KERNEL__
31 31
32#include <asm/of_device.h>
33
34#define PMI_TYPE_FREQ_CHANGE 0x01 32#define PMI_TYPE_FREQ_CHANGE 0x01
35#define PMI_READ_TYPE 0 33#define PMI_READ_TYPE 0
36#define PMI_READ_DATA0 1 34#define PMI_READ_DATA0 1
diff --git a/include/asm-powerpc/ppc4xx.h b/include/asm-powerpc/ppc4xx.h
new file mode 100644
index 000000000000..033039a80c42
--- /dev/null
+++ b/include/asm-powerpc/ppc4xx.h
@@ -0,0 +1,18 @@
1/*
2 * PPC4xx Prototypes and definitions
3 *
4 * Copyright 2008 DENX Software Engineering, Stefan Roese <sr@denx.de>
5 *
6 * This is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 */
12
13#ifndef __ASM_POWERPC_PPC4xx_H__
14#define __ASM_POWERPC_PPC4xx_H__
15
16extern void ppc4xx_reset_system(char *cmd);
17
18#endif /* __ASM_POWERPC_PPC4xx_H__ */
diff --git a/include/asm-powerpc/ps3.h b/include/asm-powerpc/ps3.h
index 2b693673eff4..9e8ed6824e15 100644
--- a/include/asm-powerpc/ps3.h
+++ b/include/asm-powerpc/ps3.h
@@ -434,8 +434,11 @@ struct ps3_sys_manager_ops {
434}; 434};
435 435
436void ps3_sys_manager_register_ops(const struct ps3_sys_manager_ops *ops); 436void ps3_sys_manager_register_ops(const struct ps3_sys_manager_ops *ops);
437void ps3_sys_manager_power_off(void); 437void __noreturn ps3_sys_manager_power_off(void);
438void ps3_sys_manager_restart(void); 438void __noreturn ps3_sys_manager_restart(void);
439void __noreturn ps3_sys_manager_halt(void);
440int ps3_sys_manager_get_wol(void);
441void ps3_sys_manager_set_wol(int state);
439 442
440struct ps3_prealloc { 443struct ps3_prealloc {
441 const char *name; 444 const char *name;
diff --git a/include/asm-powerpc/ptrace.h b/include/asm-powerpc/ptrace.h
index 891d68932f39..39023dde1cc4 100644
--- a/include/asm-powerpc/ptrace.h
+++ b/include/asm-powerpc/ptrace.h
@@ -58,6 +58,11 @@ struct pt_regs {
58#define __ARCH_WANT_COMPAT_SYS_PTRACE 58#define __ARCH_WANT_COMPAT_SYS_PTRACE
59 59
60#define STACK_FRAME_OVERHEAD 112 /* size of minimum stack frame */ 60#define STACK_FRAME_OVERHEAD 112 /* size of minimum stack frame */
61#define STACK_FRAME_LR_SAVE 2 /* Location of LR in stack frame */
62#define STACK_FRAME_REGS_MARKER ASM_CONST(0x7265677368657265)
63#define STACK_INT_FRAME_SIZE (sizeof(struct pt_regs) + \
64 STACK_FRAME_OVERHEAD + 288)
65#define STACK_FRAME_MARKER 12
61 66
62/* Size of dummy stack frame allocated when calling signal handler. */ 67/* Size of dummy stack frame allocated when calling signal handler. */
63#define __SIGNAL_FRAMESIZE 128 68#define __SIGNAL_FRAMESIZE 128
@@ -66,6 +71,10 @@ struct pt_regs {
66#else /* __powerpc64__ */ 71#else /* __powerpc64__ */
67 72
68#define STACK_FRAME_OVERHEAD 16 /* size of minimum stack frame */ 73#define STACK_FRAME_OVERHEAD 16 /* size of minimum stack frame */
74#define STACK_FRAME_LR_SAVE 1 /* Location of LR in stack frame */
75#define STACK_FRAME_REGS_MARKER ASM_CONST(0x72656773)
76#define STACK_INT_FRAME_SIZE (sizeof(struct pt_regs) + STACK_FRAME_OVERHEAD)
77#define STACK_FRAME_MARKER 2
69 78
70/* Size of stack frame allocated when calling signal handler. */ 79/* Size of stack frame allocated when calling signal handler. */
71#define __SIGNAL_FRAMESIZE 64 80#define __SIGNAL_FRAMESIZE 64
diff --git a/include/asm-powerpc/qe.h b/include/asm-powerpc/qe.h
index 430dc77b35fc..c3be6e2e1490 100644
--- a/include/asm-powerpc/qe.h
+++ b/include/asm-powerpc/qe.h
@@ -85,6 +85,7 @@ extern int par_io_data_set(u8 port, u8 pin, u8 val);
85/* QE internal API */ 85/* QE internal API */
86int qe_issue_cmd(u32 cmd, u32 device, u8 mcn_protocol, u32 cmd_input); 86int qe_issue_cmd(u32 cmd, u32 device, u8 mcn_protocol, u32 cmd_input);
87enum qe_clock qe_clock_source(const char *source); 87enum qe_clock qe_clock_source(const char *source);
88unsigned int qe_get_brg_clk(void);
88int qe_setbrg(enum qe_clock brg, unsigned int rate, unsigned int multiplier); 89int qe_setbrg(enum qe_clock brg, unsigned int rate, unsigned int multiplier);
89int qe_get_snum(void); 90int qe_get_snum(void);
90void qe_put_snum(u8 snum); 91void qe_put_snum(u8 snum);
@@ -92,7 +93,16 @@ unsigned long qe_muram_alloc(int size, int align);
92int qe_muram_free(unsigned long offset); 93int qe_muram_free(unsigned long offset);
93unsigned long qe_muram_alloc_fixed(unsigned long offset, int size); 94unsigned long qe_muram_alloc_fixed(unsigned long offset, int size);
94void qe_muram_dump(void); 95void qe_muram_dump(void);
95void *qe_muram_addr(unsigned long offset); 96
97static inline void __iomem *qe_muram_addr(unsigned long offset)
98{
99 return (void __iomem *)&qe_immr->muram[offset];
100}
101
102static inline unsigned long qe_muram_offset(void __iomem *addr)
103{
104 return addr - (void __iomem *)qe_immr->muram;
105}
96 106
97/* Structure that defines QE firmware binary files. 107/* Structure that defines QE firmware binary files.
98 * 108 *
diff --git a/include/asm-powerpc/rwsem.h b/include/asm-powerpc/rwsem.h
index cefc14728cc5..a6cc93b78b98 100644
--- a/include/asm-powerpc/rwsem.h
+++ b/include/asm-powerpc/rwsem.h
@@ -32,11 +32,20 @@ struct rw_semaphore {
32#define RWSEM_ACTIVE_WRITE_BIAS (RWSEM_WAITING_BIAS + RWSEM_ACTIVE_BIAS) 32#define RWSEM_ACTIVE_WRITE_BIAS (RWSEM_WAITING_BIAS + RWSEM_ACTIVE_BIAS)
33 spinlock_t wait_lock; 33 spinlock_t wait_lock;
34 struct list_head wait_list; 34 struct list_head wait_list;
35#ifdef CONFIG_DEBUG_LOCK_ALLOC
36 struct lockdep_map dep_map;
37#endif
35}; 38};
36 39
40#ifdef CONFIG_DEBUG_LOCK_ALLOC
41# define __RWSEM_DEP_MAP_INIT(lockname) , .dep_map = { .name = #lockname }
42#else
43# define __RWSEM_DEP_MAP_INIT(lockname)
44#endif
45
37#define __RWSEM_INITIALIZER(name) \ 46#define __RWSEM_INITIALIZER(name) \
38 { RWSEM_UNLOCKED_VALUE, SPIN_LOCK_UNLOCKED, \ 47 { RWSEM_UNLOCKED_VALUE, __SPIN_LOCK_UNLOCKED((name).wait_lock), \
39 LIST_HEAD_INIT((name).wait_list) } 48 LIST_HEAD_INIT((name).wait_list) __RWSEM_DEP_MAP_INIT(name) }
40 49
41#define DECLARE_RWSEM(name) \ 50#define DECLARE_RWSEM(name) \
42 struct rw_semaphore name = __RWSEM_INITIALIZER(name) 51 struct rw_semaphore name = __RWSEM_INITIALIZER(name)
@@ -46,12 +55,15 @@ extern struct rw_semaphore *rwsem_down_write_failed(struct rw_semaphore *sem);
46extern struct rw_semaphore *rwsem_wake(struct rw_semaphore *sem); 55extern struct rw_semaphore *rwsem_wake(struct rw_semaphore *sem);
47extern struct rw_semaphore *rwsem_downgrade_wake(struct rw_semaphore *sem); 56extern struct rw_semaphore *rwsem_downgrade_wake(struct rw_semaphore *sem);
48 57
49static inline void init_rwsem(struct rw_semaphore *sem) 58extern void __init_rwsem(struct rw_semaphore *sem, const char *name,
50{ 59 struct lock_class_key *key);
51 sem->count = RWSEM_UNLOCKED_VALUE; 60
52 spin_lock_init(&sem->wait_lock); 61#define init_rwsem(sem) \
53 INIT_LIST_HEAD(&sem->wait_list); 62 do { \
54} 63 static struct lock_class_key __key; \
64 \
65 __init_rwsem((sem), #sem, &__key); \
66 } while (0)
55 67
56/* 68/*
57 * lock for reading 69 * lock for reading
@@ -78,7 +90,7 @@ static inline int __down_read_trylock(struct rw_semaphore *sem)
78/* 90/*
79 * lock for writing 91 * lock for writing
80 */ 92 */
81static inline void __down_write(struct rw_semaphore *sem) 93static inline void __down_write_nested(struct rw_semaphore *sem, int subclass)
82{ 94{
83 int tmp; 95 int tmp;
84 96
@@ -88,6 +100,11 @@ static inline void __down_write(struct rw_semaphore *sem)
88 rwsem_down_write_failed(sem); 100 rwsem_down_write_failed(sem);
89} 101}
90 102
103static inline void __down_write(struct rw_semaphore *sem)
104{
105 __down_write_nested(sem, 0);
106}
107
91static inline int __down_write_trylock(struct rw_semaphore *sem) 108static inline int __down_write_trylock(struct rw_semaphore *sem)
92{ 109{
93 int tmp; 110 int tmp;
diff --git a/include/asm-powerpc/sparsemem.h b/include/asm-powerpc/sparsemem.h
index e8b493d52b4f..9aea8e9f0bd1 100644
--- a/include/asm-powerpc/sparsemem.h
+++ b/include/asm-powerpc/sparsemem.h
@@ -15,6 +15,7 @@
15 15
16#ifdef CONFIG_MEMORY_HOTPLUG 16#ifdef CONFIG_MEMORY_HOTPLUG
17extern void create_section_mapping(unsigned long start, unsigned long end); 17extern void create_section_mapping(unsigned long start, unsigned long end);
18extern int remove_section_mapping(unsigned long start, unsigned long end);
18#ifdef CONFIG_NUMA 19#ifdef CONFIG_NUMA
19extern int hot_add_scn_to_nid(unsigned long scn_addr); 20extern int hot_add_scn_to_nid(unsigned long scn_addr);
20#else 21#else
diff --git a/include/asm-powerpc/spinlock.h b/include/asm-powerpc/spinlock.h
index cc4cfceac67c..258c93993190 100644
--- a/include/asm-powerpc/spinlock.h
+++ b/include/asm-powerpc/spinlock.h
@@ -19,6 +19,7 @@
19 * 19 *
20 * (the type definitions are in asm/spinlock_types.h) 20 * (the type definitions are in asm/spinlock_types.h)
21 */ 21 */
22#include <linux/irqflags.h>
22#ifdef CONFIG_PPC64 23#ifdef CONFIG_PPC64
23#include <asm/paca.h> 24#include <asm/paca.h>
24#include <asm/hvcall.h> 25#include <asm/hvcall.h>
diff --git a/include/asm-powerpc/string.h b/include/asm-powerpc/string.h
index aa40f92c298d..e40010abcaf1 100644
--- a/include/asm-powerpc/string.h
+++ b/include/asm-powerpc/string.h
@@ -7,6 +7,7 @@
7#define __HAVE_ARCH_STRNCPY 7#define __HAVE_ARCH_STRNCPY
8#define __HAVE_ARCH_STRLEN 8#define __HAVE_ARCH_STRLEN
9#define __HAVE_ARCH_STRCMP 9#define __HAVE_ARCH_STRCMP
10#define __HAVE_ARCH_STRNCMP
10#define __HAVE_ARCH_STRCAT 11#define __HAVE_ARCH_STRCAT
11#define __HAVE_ARCH_MEMSET 12#define __HAVE_ARCH_MEMSET
12#define __HAVE_ARCH_MEMCPY 13#define __HAVE_ARCH_MEMCPY
@@ -18,6 +19,7 @@ extern char * strcpy(char *,const char *);
18extern char * strncpy(char *,const char *, __kernel_size_t); 19extern char * strncpy(char *,const char *, __kernel_size_t);
19extern __kernel_size_t strlen(const char *); 20extern __kernel_size_t strlen(const char *);
20extern int strcmp(const char *,const char *); 21extern int strcmp(const char *,const char *);
22extern int strncmp(const char *, const char *, __kernel_size_t);
21extern char * strcat(char *, const char *); 23extern char * strcat(char *, const char *);
22extern void * memset(void *,int,__kernel_size_t); 24extern void * memset(void *,int,__kernel_size_t);
23extern void * memcpy(void *,const void *,__kernel_size_t); 25extern void * memcpy(void *,const void *,__kernel_size_t);
diff --git a/include/asm-powerpc/system.h b/include/asm-powerpc/system.h
index 29552ff182aa..fab1674b31b6 100644
--- a/include/asm-powerpc/system.h
+++ b/include/asm-powerpc/system.h
@@ -5,6 +5,7 @@
5#define _ASM_POWERPC_SYSTEM_H 5#define _ASM_POWERPC_SYSTEM_H
6 6
7#include <linux/kernel.h> 7#include <linux/kernel.h>
8#include <linux/irqflags.h>
8 9
9#include <asm/hw_irq.h> 10#include <asm/hw_irq.h>
10 11
diff --git a/include/asm-powerpc/topology.h b/include/asm-powerpc/topology.h
index ca23b681ad05..100c6fbfc587 100644
--- a/include/asm-powerpc/topology.h
+++ b/include/asm-powerpc/topology.h
@@ -96,11 +96,10 @@ static inline void sysfs_remove_device_from_node(struct sys_device *dev,
96{ 96{
97} 97}
98 98
99#endif /* CONFIG_NUMA */
99 100
100#include <asm-generic/topology.h> 101#include <asm-generic/topology.h>
101 102
102#endif /* CONFIG_NUMA */
103
104#ifdef CONFIG_SMP 103#ifdef CONFIG_SMP
105#include <asm/cputable.h> 104#include <asm/cputable.h>
106#define smt_capable() (cpu_has_feature(CPU_FTR_SMT)) 105#define smt_capable() (cpu_has_feature(CPU_FTR_SMT))
diff --git a/include/asm-powerpc/types.h b/include/asm-powerpc/types.h
index 903fd1932436..c243a6ac60e5 100644
--- a/include/asm-powerpc/types.h
+++ b/include/asm-powerpc/types.h
@@ -84,6 +84,13 @@ typedef unsigned long long u64;
84 84
85typedef __vector128 vector128; 85typedef __vector128 vector128;
86 86
87/* Physical address used by some IO functions */
88#if defined(CONFIG_PPC64) || defined(CONFIG_PHYS_64BIT)
89typedef u64 phys_addr_t;
90#else
91typedef u32 phys_addr_t;
92#endif
93
87#ifdef __powerpc64__ 94#ifdef __powerpc64__
88typedef u64 dma_addr_t; 95typedef u64 dma_addr_t;
89#else 96#else
diff --git a/include/asm-ppc/ocp.h b/include/asm-ppc/ocp.h
index 1379a4f76de3..3909a2eec286 100644
--- a/include/asm-ppc/ocp.h
+++ b/include/asm-ppc/ocp.h
@@ -31,7 +31,6 @@
31 31
32#include <asm/mmu.h> 32#include <asm/mmu.h>
33#include <asm/ocp_ids.h> 33#include <asm/ocp_ids.h>
34#include <asm/semaphore.h>
35 34
36#ifdef CONFIG_PPC_OCP 35#ifdef CONFIG_PPC_OCP
37 36
diff --git a/include/asm-sh/bugs.h b/include/asm-sh/bugs.h
index cfda7d5bf026..121b2ecddfc3 100644
--- a/include/asm-sh/bugs.h
+++ b/include/asm-sh/bugs.h
@@ -25,7 +25,7 @@ static void __init check_bugs(void)
25 case CPU_SH7619: 25 case CPU_SH7619:
26 *p++ = '2'; 26 *p++ = '2';
27 break; 27 break;
28 case CPU_SH7203 ... CPU_SH7263: 28 case CPU_SH7203 ... CPU_MXG:
29 *p++ = '2'; 29 *p++ = '2';
30 *p++ = 'a'; 30 *p++ = 'a';
31 break; 31 break;
diff --git a/include/asm-sh/cpu-sh4/freq.h b/include/asm-sh/cpu-sh4/freq.h
index ec028c649215..da46e67ae26d 100644
--- a/include/asm-sh/cpu-sh4/freq.h
+++ b/include/asm-sh/cpu-sh4/freq.h
@@ -10,14 +10,14 @@
10#ifndef __ASM_CPU_SH4_FREQ_H 10#ifndef __ASM_CPU_SH4_FREQ_H
11#define __ASM_CPU_SH4_FREQ_H 11#define __ASM_CPU_SH4_FREQ_H
12 12
13#if defined(CONFIG_CPU_SUBTYPE_SH7722) || defined(CONFIG_CPU_SUBTYPE_SH7366) 13#if defined(CONFIG_CPU_SUBTYPE_SH7722) || \
14 defined(CONFIG_CPU_SUBTYPE_SH7723) || \
15 defined(CONFIG_CPU_SUBTYPE_SH7366)
14#define FRQCR 0xa4150000 16#define FRQCR 0xa4150000
15#define VCLKCR 0xa4150004 17#define VCLKCR 0xa4150004
16#define SCLKACR 0xa4150008 18#define SCLKACR 0xa4150008
17#define SCLKBCR 0xa415000c 19#define SCLKBCR 0xa415000c
18#if defined(CONFIG_CPU_SUBTYPE_SH7722)
19#define IrDACLKCR 0xa4150010 20#define IrDACLKCR 0xa4150010
20#endif
21#elif defined(CONFIG_CPU_SUBTYPE_SH7763) || \ 21#elif defined(CONFIG_CPU_SUBTYPE_SH7763) || \
22 defined(CONFIG_CPU_SUBTYPE_SH7780) 22 defined(CONFIG_CPU_SUBTYPE_SH7780)
23#define FRQCR 0xffc80000 23#define FRQCR 0xffc80000
diff --git a/include/asm-sh/cpu-sh4/rtc.h b/include/asm-sh/cpu-sh4/rtc.h
index f3d0f53275e4..25b1e6adfe8c 100644
--- a/include/asm-sh/cpu-sh4/rtc.h
+++ b/include/asm-sh/cpu-sh4/rtc.h
@@ -1,7 +1,12 @@
1#ifndef __ASM_SH_CPU_SH4_RTC_H 1#ifndef __ASM_SH_CPU_SH4_RTC_H
2#define __ASM_SH_CPU_SH4_RTC_H 2#define __ASM_SH_CPU_SH4_RTC_H
3 3
4#ifdef CONFIG_CPU_SUBTYPE_SH7723
5#define rtc_reg_size sizeof(u16)
6#else
4#define rtc_reg_size sizeof(u32) 7#define rtc_reg_size sizeof(u32)
8#endif
9
5#define RTC_BIT_INVERTED 0x40 /* bug on SH7750, SH7750S */ 10#define RTC_BIT_INVERTED 0x40 /* bug on SH7750, SH7750S */
6#define RTC_DEF_CAPABILITIES RTC_CAP_4_DIGIT_YEAR 11#define RTC_DEF_CAPABILITIES RTC_CAP_4_DIGIT_YEAR
7 12
diff --git a/include/asm-sh/migor.h b/include/asm-sh/migor.h
new file mode 100644
index 000000000000..2329363afdc3
--- /dev/null
+++ b/include/asm-sh/migor.h
@@ -0,0 +1,58 @@
1#ifndef __ASM_SH_MIGOR_H
2#define __ASM_SH_MIGOR_H
3
4/*
5 * linux/include/asm-sh/migor.h
6 *
7 * Copyright (C) 2008 Renesas Solutions
8 *
9 * Portions Copyright (C) 2007 Nobuhiro Iwamatsu
10 *
11 * This file is subject to the terms and conditions of the GNU General Public
12 * License. See the file "COPYING" in the main directory of this archive
13 * for more details.
14 *
15 */
16#include <asm/addrspace.h>
17
18/* GPIO */
19#define MSTPCR0 0xa4150030
20#define MSTPCR1 0xa4150034
21#define MSTPCR2 0xa4150038
22
23#define PORT_PACR 0xa4050100
24#define PORT_PDCR 0xa4050106
25#define PORT_PECR 0xa4050108
26#define PORT_PHCR 0xa405010e
27#define PORT_PJCR 0xa4050110
28#define PORT_PKCR 0xa4050112
29#define PORT_PLCR 0xa4050114
30#define PORT_PMCR 0xa4050116
31#define PORT_PRCR 0xa405011c
32#define PORT_PWCR 0xa4050146
33#define PORT_PXCR 0xa4050148
34#define PORT_PYCR 0xa405014a
35#define PORT_PZCR 0xa405014c
36#define PORT_PADR 0xa4050120
37#define PORT_PWDR 0xa4050166
38
39#define PORT_HIZCRA 0xa4050158
40#define PORT_HIZCRC 0xa405015c
41
42#define PORT_MSELCRB 0xa4050182
43
44#define MSTPCR1 0xa4150034
45#define MSTPCR2 0xa4150038
46
47#define PORT_PSELA 0xa405014e
48#define PORT_PSELB 0xa4050150
49#define PORT_PSELC 0xa4050152
50#define PORT_PSELD 0xa4050154
51
52#define PORT_HIZCRA 0xa4050158
53#define PORT_HIZCRB 0xa405015a
54#define PORT_HIZCRC 0xa405015c
55
56#define BSC_CS6ABCR 0xfec1001c
57
58#endif /* __ASM_SH_MIGOR_H */
diff --git a/include/asm-sh/mpc1211/pci.h b/include/asm-sh/mpc1211/pci.h
index 5d3712c3a701..d9162c5ed76a 100644
--- a/include/asm-sh/mpc1211/pci.h
+++ b/include/asm-sh/mpc1211/pci.h
@@ -24,8 +24,6 @@
24#define PCI_PROBE_BIOS 1 24#define PCI_PROBE_BIOS 1
25#define PCI_PROBE_CONF1 2 25#define PCI_PROBE_CONF1 2
26#define PCI_PROBE_CONF2 4 26#define PCI_PROBE_CONF2 4
27#define PCI_NO_SORT 0x100
28#define PCI_BIOS_SORT 0x200
29#define PCI_NO_CHECKS 0x400 27#define PCI_NO_CHECKS 0x400
30#define PCI_ASSIGN_ROMS 0x1000 28#define PCI_ASSIGN_ROMS 0x1000
31#define PCI_BIOS_IRQ_SCAN 0x2000 29#define PCI_BIOS_IRQ_SCAN 0x2000
diff --git a/include/asm-sh/processor.h b/include/asm-sh/processor.h
index ec707b98e5b9..b7c7ce80f03e 100644
--- a/include/asm-sh/processor.h
+++ b/include/asm-sh/processor.h
@@ -16,7 +16,7 @@ enum cpu_type {
16 CPU_SH7619, 16 CPU_SH7619,
17 17
18 /* SH-2A types */ 18 /* SH-2A types */
19 CPU_SH7203, CPU_SH7206, CPU_SH7263, 19 CPU_SH7203, CPU_SH7206, CPU_SH7263, CPU_MXG,
20 20
21 /* SH-3 types */ 21 /* SH-3 types */
22 CPU_SH7705, CPU_SH7706, CPU_SH7707, 22 CPU_SH7705, CPU_SH7706, CPU_SH7707,
@@ -29,7 +29,8 @@ enum cpu_type {
29 CPU_SH7760, CPU_SH4_202, CPU_SH4_501, 29 CPU_SH7760, CPU_SH4_202, CPU_SH4_501,
30 30
31 /* SH-4A types */ 31 /* SH-4A types */
32 CPU_SH7763, CPU_SH7770, CPU_SH7780, CPU_SH7781, CPU_SH7785, CPU_SHX3, 32 CPU_SH7763, CPU_SH7770, CPU_SH7780, CPU_SH7781, CPU_SH7785,
33 CPU_SH7723, CPU_SHX3,
33 34
34 /* SH4AL-DSP types */ 35 /* SH4AL-DSP types */
35 CPU_SH7343, CPU_SH7722, CPU_SH7366, 36 CPU_SH7343, CPU_SH7722, CPU_SH7366,
diff --git a/include/asm-sh/r7780rp.h b/include/asm-sh/r7780rp.h
index 1770460a4616..a33838f23a6d 100644
--- a/include/asm-sh/r7780rp.h
+++ b/include/asm-sh/r7780rp.h
@@ -55,11 +55,11 @@
55#define PA_SCSPTR1 (PA_BCR+0x0524) /* SCIF1 Serial Port control */ 55#define PA_SCSPTR1 (PA_BCR+0x0524) /* SCIF1 Serial Port control */
56#define PA_SCLSR1 (PA_BCR+0x0528) /* SCIF1 Line Status control */ 56#define PA_SCLSR1 (PA_BCR+0x0528) /* SCIF1 Line Status control */
57#define PA_SCRER1 (PA_BCR+0x052c) /* SCIF1 Serial Error control */ 57#define PA_SCRER1 (PA_BCR+0x052c) /* SCIF1 Serial Error control */
58#define PA_ICCR (PA_BCR+0x0600) /* Serial control */ 58#define PA_SMCR (PA_BCR+0x0600) /* 2-wire Serial control */
59#define PA_SAR (PA_BCR+0x0602) /* Serial Slave control */ 59#define PA_SMSMADR (PA_BCR+0x0602) /* 2-wire Serial Slave control */
60#define PA_MDR (PA_BCR+0x0604) /* Serial Mode control */ 60#define PA_SMMR (PA_BCR+0x0604) /* 2-wire Serial Mode control */
61#define PA_ADR1 (PA_BCR+0x0606) /* Serial Address1 control */ 61#define PA_SMSADR1 (PA_BCR+0x0606) /* 2-wire Serial Address1 control */
62#define PA_DAR1 (PA_BCR+0x0646) /* Serial Data1 control */ 62#define PA_SMTRDR1 (PA_BCR+0x0646) /* 2-wire Serial Data1 control */
63#define PA_VERREG (PA_BCR+0x0700) /* FPGA Version Register */ 63#define PA_VERREG (PA_BCR+0x0700) /* FPGA Version Register */
64#define PA_POFF (PA_BCR+0x0800) /* System Power Off control */ 64#define PA_POFF (PA_BCR+0x0800) /* System Power Off control */
65#define PA_PMR (PA_BCR+0x0900) /* */ 65#define PA_PMR (PA_BCR+0x0900) /* */
@@ -107,11 +107,11 @@
107#define PA_SCFCR (PA_BCR+0x040c) /* SCIF FIFO control */ 107#define PA_SCFCR (PA_BCR+0x040c) /* SCIF FIFO control */
108#define PA_SCFDR (PA_BCR+0x040e) /* SCIF FIFO data control */ 108#define PA_SCFDR (PA_BCR+0x040e) /* SCIF FIFO data control */
109#define PA_SCLSR (PA_BCR+0x0412) /* SCIF Line Status control */ 109#define PA_SCLSR (PA_BCR+0x0412) /* SCIF Line Status control */
110#define PA_ICCR (PA_BCR+0x0500) /* Serial control */ 110#define PA_SMCR (PA_BCR+0x0500) /* 2-wire Serial control */
111#define PA_SAR (PA_BCR+0x0502) /* Serial Slave control */ 111#define PA_SMSMADR (PA_BCR+0x0502) /* 2-wire Serial Slave control */
112#define PA_MDR (PA_BCR+0x0504) /* Serial Mode control */ 112#define PA_SMMR (PA_BCR+0x0504) /* 2-wire Serial Mode control */
113#define PA_ADR1 (PA_BCR+0x0506) /* Serial Address1 control */ 113#define PA_SMSADR1 (PA_BCR+0x0506) /* 2-wire Serial Address1 control */
114#define PA_DAR1 (PA_BCR+0x0546) /* Serial Data1 control */ 114#define PA_SMTRDR1 (PA_BCR+0x0546) /* 2-wire Serial Data1 control */
115#define PA_VERREG (PA_BCR+0x0600) /* FPGA Version Register */ 115#define PA_VERREG (PA_BCR+0x0600) /* FPGA Version Register */
116 116
117#define PA_AX88796L 0xa5800400 /* AX88796L Area */ 117#define PA_AX88796L 0xa5800400 /* AX88796L Area */
@@ -190,6 +190,8 @@
190#define IRQ_TP (HL_FPGA_IRQ_BASE + 12) 190#define IRQ_TP (HL_FPGA_IRQ_BASE + 12)
191#define IRQ_RTC (HL_FPGA_IRQ_BASE + 13) 191#define IRQ_RTC (HL_FPGA_IRQ_BASE + 13)
192#define IRQ_TH_ALERT (HL_FPGA_IRQ_BASE + 14) 192#define IRQ_TH_ALERT (HL_FPGA_IRQ_BASE + 14)
193#define IRQ_SCIF0 (HL_FPGA_IRQ_BASE + 15)
194#define IRQ_SCIF1 (HL_FPGA_IRQ_BASE + 16)
193 195
194unsigned char *highlander_init_irq_r7780mp(void); 196unsigned char *highlander_init_irq_r7780mp(void);
195unsigned char *highlander_init_irq_r7780rp(void); 197unsigned char *highlander_init_irq_r7780rp(void);
diff --git a/include/asm-sh/se7721.h b/include/asm-sh/se7721.h
new file mode 100644
index 000000000000..b957f6041193
--- /dev/null
+++ b/include/asm-sh/se7721.h
@@ -0,0 +1,70 @@
1/*
2 * Copyright (C) 2008 Renesas Solutions Corp.
3 *
4 * Hitachi UL SolutionEngine 7721 Support.
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
8 * for more details.
9 *
10 */
11
12#ifndef __ASM_SH_SE7721_H
13#define __ASM_SH_SE7721_H
14#include <asm/addrspace.h>
15
16/* Box specific addresses. */
17#define SE_AREA0_WIDTH 2 /* Area0: 32bit */
18#define PA_ROM 0xa0000000 /* EPROM */
19#define PA_ROM_SIZE 0x00200000 /* EPROM size 2M byte */
20#define PA_FROM 0xa1000000 /* Flash-ROM */
21#define PA_FROM_SIZE 0x01000000 /* Flash-ROM size 16M byte */
22#define PA_EXT1 0xa4000000
23#define PA_EXT1_SIZE 0x04000000
24#define PA_SDRAM 0xaC000000 /* SDRAM(Area3) 64MB */
25#define PA_SDRAM_SIZE 0x04000000
26
27#define PA_EXT4 0xb0000000
28#define PA_EXT4_SIZE 0x04000000
29
30#define PA_PERIPHERAL 0xB8000000
31
32#define PA_PCIC PA_PERIPHERAL
33#define PA_MRSHPC (PA_PERIPHERAL + 0x003fffe0)
34#define PA_MRSHPC_MW1 (PA_PERIPHERAL + 0x00400000)
35#define PA_MRSHPC_MW2 (PA_PERIPHERAL + 0x00500000)
36#define PA_MRSHPC_IO (PA_PERIPHERAL + 0x00600000)
37#define MRSHPC_OPTION (PA_MRSHPC + 6)
38#define MRSHPC_CSR (PA_MRSHPC + 8)
39#define MRSHPC_ISR (PA_MRSHPC + 10)
40#define MRSHPC_ICR (PA_MRSHPC + 12)
41#define MRSHPC_CPWCR (PA_MRSHPC + 14)
42#define MRSHPC_MW0CR1 (PA_MRSHPC + 16)
43#define MRSHPC_MW1CR1 (PA_MRSHPC + 18)
44#define MRSHPC_IOWCR1 (PA_MRSHPC + 20)
45#define MRSHPC_MW0CR2 (PA_MRSHPC + 22)
46#define MRSHPC_MW1CR2 (PA_MRSHPC + 24)
47#define MRSHPC_IOWCR2 (PA_MRSHPC + 26)
48#define MRSHPC_CDCR (PA_MRSHPC + 28)
49#define MRSHPC_PCIC_INFO (PA_MRSHPC + 30)
50
51#define PA_LED 0xB6800000 /* 8bit LED */
52#define PA_FPGA 0xB7000000 /* FPGA base address */
53
54#define MRSHPC_IRQ0 10
55
56#define FPGA_ILSR1 (PA_FPGA + 0x02)
57#define FPGA_ILSR2 (PA_FPGA + 0x03)
58#define FPGA_ILSR3 (PA_FPGA + 0x04)
59#define FPGA_ILSR4 (PA_FPGA + 0x05)
60#define FPGA_ILSR5 (PA_FPGA + 0x06)
61#define FPGA_ILSR6 (PA_FPGA + 0x07)
62#define FPGA_ILSR7 (PA_FPGA + 0x08)
63#define FPGA_ILSR8 (PA_FPGA + 0x09)
64
65void init_se7721_IRQ(void);
66
67#define __IO_PREFIX se7721
68#include <asm/io_generic.h>
69
70#endif /* __ASM_SH_SE7721_H */
diff --git a/include/asm-sh/se7722.h b/include/asm-sh/se7722.h
index e0e89fcb8388..3690fe5857a4 100644
--- a/include/asm-sh/se7722.h
+++ b/include/asm-sh/se7722.h
@@ -77,6 +77,8 @@
77#define PORT_PSELA 0xA405014EUL 77#define PORT_PSELA 0xA405014EUL
78#define PORT_PYCR 0xA405014AUL 78#define PORT_PYCR 0xA405014AUL
79#define PORT_PZCR 0xA405014CUL 79#define PORT_PZCR 0xA405014CUL
80#define PORT_HIZCRA 0xA4050158UL
81#define PORT_HIZCRC 0xA405015CUL
80 82
81/* IRQ */ 83/* IRQ */
82#define IRQ0_IRQ 32 84#define IRQ0_IRQ 32
diff --git a/include/asm-sh/sh_keysc.h b/include/asm-sh/sh_keysc.h
new file mode 100644
index 000000000000..b5a4dd5a9729
--- /dev/null
+++ b/include/asm-sh/sh_keysc.h
@@ -0,0 +1,13 @@
1#ifndef __ASM_KEYSC_H__
2#define __ASM_KEYSC_H__
3
4#define SH_KEYSC_MAXKEYS 30
5
6struct sh_keysc_info {
7 enum { SH_KEYSC_MODE_1, SH_KEYSC_MODE_2, SH_KEYSC_MODE_3 } mode;
8 int scan_timing; /* 0 -> 7, see KYCR1, SCN[2:0] */
9 int delay;
10 int keycodes[SH_KEYSC_MAXKEYS];
11};
12
13#endif /* __ASM_KEYSC_H__ */
diff --git a/include/asm-sh/system.h b/include/asm-sh/system.h
index 5145aa2a0ce9..e65b6b822cb3 100644
--- a/include/asm-sh/system.h
+++ b/include/asm-sh/system.h
@@ -146,6 +146,8 @@ extern unsigned int instruction_size(unsigned int insn);
146 146
147extern unsigned long cached_to_uncached; 147extern unsigned long cached_to_uncached;
148 148
149extern struct dentry *sh_debugfs_root;
150
149/* XXX 151/* XXX
150 * disable hlt during certain critical i/o operations 152 * disable hlt during certain critical i/o operations
151 */ 153 */
diff --git a/include/asm-sh/topology.h b/include/asm-sh/topology.h
index f402a3b1cfa4..34cdb28e8f44 100644
--- a/include/asm-sh/topology.h
+++ b/include/asm-sh/topology.h
@@ -16,7 +16,7 @@
16 .cache_nice_tries = 2, \ 16 .cache_nice_tries = 2, \
17 .busy_idx = 3, \ 17 .busy_idx = 3, \
18 .idle_idx = 2, \ 18 .idle_idx = 2, \
19 .newidle_idx = 0, \ 19 .newidle_idx = 2, \
20 .wake_idx = 1, \ 20 .wake_idx = 1, \
21 .forkexec_idx = 1, \ 21 .forkexec_idx = 1, \
22 .flags = SD_LOAD_BALANCE \ 22 .flags = SD_LOAD_BALANCE \
diff --git a/include/asm-sh/uaccess_32.h b/include/asm-sh/uaccess_32.h
index c0318b608893..1e41fda74bd3 100644
--- a/include/asm-sh/uaccess_32.h
+++ b/include/asm-sh/uaccess_32.h
@@ -55,13 +55,10 @@ static inline void set_fs(mm_segment_t s)
55 * If we don't have an MMU (or if its disabled) the only thing we really have 55 * If we don't have an MMU (or if its disabled) the only thing we really have
56 * to look out for is if the address resides somewhere outside of what 56 * to look out for is if the address resides somewhere outside of what
57 * available RAM we have. 57 * available RAM we have.
58 *
59 * TODO: This check could probably also stand to be restricted somewhat more..
60 * though it still does the Right Thing(tm) for the time being.
61 */ 58 */
62static inline int __access_ok(unsigned long addr, unsigned long size) 59static inline int __access_ok(unsigned long addr, unsigned long size)
63{ 60{
64 return ((addr >= memory_start) && ((addr + size) < memory_end)); 61 return 1;
65} 62}
66#else /* CONFIG_MMU */ 63#else /* CONFIG_MMU */
67#define __addr_ok(addr) \ 64#define __addr_ok(addr) \
diff --git a/include/asm-sparc/Kbuild b/include/asm-sparc/Kbuild
index c6a55cf0d337..671223718f0a 100644
--- a/include/asm-sparc/Kbuild
+++ b/include/asm-sparc/Kbuild
@@ -5,7 +5,6 @@ header-y += asi.h
5header-y += bpp.h 5header-y += bpp.h
6header-y += jsflash.h 6header-y += jsflash.h
7header-y += openpromio.h 7header-y += openpromio.h
8header-y += pconf.h
9header-y += reg.h 8header-y += reg.h
10header-y += traps.h 9header-y += traps.h
11header-y += vfc_ioctls.h 10header-y += vfc_ioctls.h
diff --git a/include/asm-sparc/a.out-core.h b/include/asm-sparc/a.out-core.h
deleted file mode 100644
index e8fd338ed0b2..000000000000
--- a/include/asm-sparc/a.out-core.h
+++ /dev/null
@@ -1,52 +0,0 @@
1/* a.out coredump register dumper
2 *
3 * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved.
4 * Written by David Howells (dhowells@redhat.com)
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public Licence
8 * as published by the Free Software Foundation; either version
9 * 2 of the Licence, or (at your option) any later version.
10 */
11
12#ifndef _ASM_A_OUT_CORE_H
13#define _ASM_A_OUT_CORE_H
14
15#ifdef __KERNEL__
16
17#include <linux/user.h>
18
19/*
20 * fill in the user structure for an a.out core dump
21 */
22static inline void aout_dump_thread(struct pt_regs *regs, struct user *dump)
23{
24 unsigned long first_stack_page;
25
26 dump->magic = SUNOS_CORE_MAGIC;
27 dump->len = sizeof(struct user);
28 dump->regs.psr = regs->psr;
29 dump->regs.pc = regs->pc;
30 dump->regs.npc = regs->npc;
31 dump->regs.y = regs->y;
32 /* fuck me plenty */
33 memcpy(&dump->regs.regs[0], &regs->u_regs[1], (sizeof(unsigned long) * 15));
34 dump->uexec = current->thread.core_exec;
35 dump->u_tsize = (((unsigned long) current->mm->end_code) -
36 ((unsigned long) current->mm->start_code)) & ~(PAGE_SIZE - 1);
37 dump->u_dsize = ((unsigned long) (current->mm->brk + (PAGE_SIZE-1)));
38 dump->u_dsize -= dump->u_tsize;
39 dump->u_dsize &= ~(PAGE_SIZE - 1);
40 first_stack_page = (regs->u_regs[UREG_FP] & ~(PAGE_SIZE - 1));
41 dump->u_ssize = (TASK_SIZE - first_stack_page) & ~(PAGE_SIZE - 1);
42 memcpy(&dump->fpu.fpstatus.fregs.regs[0], &current->thread.float_regs[0], (sizeof(unsigned long) * 32));
43 dump->fpu.fpstatus.fsr = current->thread.fsr;
44 dump->fpu.fpstatus.flags = dump->fpu.fpstatus.extra = 0;
45 dump->fpu.fpstatus.fpq_count = current->thread.fpqdepth;
46 memcpy(&dump->fpu.fpstatus.fpq[0], &current->thread.fpqueue[0],
47 ((sizeof(unsigned long) * 2) * 16));
48 dump->sigcode = 0;
49}
50
51#endif /* __KERNEL__ */
52#endif /* _ASM_A_OUT_CORE_H */
diff --git a/include/asm-sparc/a.out.h b/include/asm-sparc/a.out.h
deleted file mode 100644
index 2f1c3748a068..000000000000
--- a/include/asm-sparc/a.out.h
+++ /dev/null
@@ -1,97 +0,0 @@
1#ifndef __SPARC_A_OUT_H__
2#define __SPARC_A_OUT_H__
3
4#define SPARC_PGSIZE 0x2000 /* Thanks to the sun4 architecture... */
5#define SEGMENT_SIZE SPARC_PGSIZE /* whee... */
6
7#ifndef __ASSEMBLY__
8
9struct exec {
10 unsigned char a_dynamic:1; /* A __DYNAMIC is in this image */
11 unsigned char a_toolversion:7;
12 unsigned char a_machtype;
13 unsigned short a_info;
14 unsigned int a_text; /* length of text, in bytes */
15 unsigned int a_data; /* length of data, in bytes */
16 unsigned int a_bss; /* length of bss, in bytes */
17 unsigned int a_syms; /* length of symbol table, in bytes */
18 unsigned int a_entry; /* where program begins */
19 unsigned int a_trsize;
20 unsigned int a_drsize;
21};
22
23#endif /* !__ASSEMBLY__ */
24
25/* Where in the file does the text information begin? */
26#define N_TXTOFF(x) (N_MAGIC(x) == ZMAGIC ? 0 : sizeof (struct exec))
27
28/* Where do the Symbols start? */
29#define N_SYMOFF(x) (N_TXTOFF(x) + (x).a_text + \
30 (x).a_data + (x).a_trsize + \
31 (x).a_drsize)
32
33/* Where does text segment go in memory after being loaded? */
34#define N_TXTADDR(x) (unsigned long)(((N_MAGIC(x) == ZMAGIC) && \
35 ((x).a_entry < SPARC_PGSIZE)) ? \
36 0 : SPARC_PGSIZE)
37
38/* And same for the data segment.. */
39#define N_DATADDR(x) (N_MAGIC(x)==OMAGIC ? \
40 (N_TXTADDR(x) + (x).a_text) \
41 : (unsigned long) (_N_SEGMENT_ROUND (_N_TXTENDADDR(x))))
42
43#define N_TRSIZE(a) ((a).a_trsize)
44#define N_DRSIZE(a) ((a).a_drsize)
45#define N_SYMSIZE(a) ((a).a_syms)
46
47#ifndef __ASSEMBLY__
48
49/*
50 * Sparc relocation types
51 */
52enum reloc_type
53{
54 RELOC_8,
55 RELOC_16,
56 RELOC_32, /* simplest relocs */
57 RELOC_DISP8,
58 RELOC_DISP16,
59 RELOC_DISP32, /* Disp's (pc-rel) */
60 RELOC_WDISP30,
61 RELOC_WDISP22, /* SR word disp's */
62 RELOC_HI22,
63 RELOC_22, /* SR 22-bit relocs */
64 RELOC_13,
65 RELOC_LO10, /* SR 13&10-bit relocs */
66 RELOC_SFA_BASE,
67 RELOC_SFA_OFF13, /* SR S.F.A. relocs */
68 RELOC_BASE10,
69 RELOC_BASE13,
70 RELOC_BASE22, /* base_relative pic */
71 RELOC_PC10,
72 RELOC_PC22, /* special pc-rel pic */
73 RELOC_JMP_TBL, /* jmp_tbl_rel in pic */
74 RELOC_SEGOFF16, /* ShLib offset-in-seg */
75 RELOC_GLOB_DAT,
76 RELOC_JMP_SLOT,
77 RELOC_RELATIVE /* rtld relocs */
78};
79
80/*
81 * Format of a relocation datum.
82 */
83struct relocation_info /* used when header.a_machtype == M_SPARC */
84{
85 unsigned int r_address; /* relocation addr */
86 unsigned int r_index:24; /* segment index or symbol index */
87 unsigned int r_extern:1; /* if F, r_index==SEG#; if T, SYM idx */
88 unsigned int r_pad:2; /* <unused> */
89 enum reloc_type r_type:5; /* type of relocation to perform */
90 int r_addend; /* addend for relocation value */
91};
92
93#define N_RELOCATION_INFO_DECLARED 1
94
95#endif /* !(__ASSEMBLY__) */
96
97#endif /* __SPARC_A_OUT_H__ */
diff --git a/include/asm-sparc/floppy.h b/include/asm-sparc/floppy.h
index dbe7a586be5b..d3978e068e2b 100644
--- a/include/asm-sparc/floppy.h
+++ b/include/asm-sparc/floppy.h
@@ -280,7 +280,7 @@ static inline void sun_fd_enable_dma(void)
280 280
281/* Our low-level entry point in arch/sparc/kernel/entry.S */ 281/* Our low-level entry point in arch/sparc/kernel/entry.S */
282extern int sparc_floppy_request_irq(int irq, unsigned long flags, 282extern int sparc_floppy_request_irq(int irq, unsigned long flags,
283 irqreturn_t (*irq_handler)(int irq, void *)); 283 irq_handler_t irq_handler);
284 284
285static int sun_fd_request_irq(void) 285static int sun_fd_request_irq(void)
286{ 286{
diff --git a/include/asm-sparc/head.h b/include/asm-sparc/head.h
index 1a03c28da92d..fcdba5116339 100644
--- a/include/asm-sparc/head.h
+++ b/include/asm-sparc/head.h
@@ -46,45 +46,12 @@
46 b linux_sparc_syscall; \ 46 b linux_sparc_syscall; \
47 rd %psr, %l0; 47 rd %psr, %l0;
48 48
49/* Software trap for SunOS4.1.x system calls. */
50#define SUNOS_SYSCALL_TRAP \
51 rd %psr, %l0; \
52 sethi %hi(sunos_sys_table), %l7; \
53 b linux_sparc_syscall; \
54 or %l7, %lo(sunos_sys_table), %l7;
55
56#define SUNOS_NO_SYSCALL_TRAP \
57 b sunos_syscall; \
58 rd %psr, %l0; \
59 nop; \
60 nop;
61
62/* Software trap for Slowaris system calls. */
63#define SOLARIS_SYSCALL_TRAP \
64 b solaris_syscall; \
65 rd %psr, %l0; \
66 nop; \
67 nop;
68
69#define INDIRECT_SOLARIS_SYSCALL(x) \
70 mov x, %g1; \
71 b solaris_syscall; \
72 rd %psr, %l0; \
73 nop;
74
75#define BREAKPOINT_TRAP \ 49#define BREAKPOINT_TRAP \
76 b breakpoint_trap; \ 50 b breakpoint_trap; \
77 rd %psr,%l0; \ 51 rd %psr,%l0; \
78 nop; \ 52 nop; \
79 nop; 53 nop;
80 54
81/* Software trap for Sparc-netbsd system calls. */
82#define NETBSD_SYSCALL_TRAP \
83 sethi %hi(sys_call_table), %l7; \
84 or %l7, %lo(sys_call_table), %l7; \
85 b bsd_syscall; \
86 rd %psr, %l0;
87
88/* The Get Condition Codes software trap for userland. */ 55/* The Get Condition Codes software trap for userland. */
89#define GETCC_TRAP \ 56#define GETCC_TRAP \
90 b getcc_trap_handler; mov %psr, %l0; nop; nop; 57 b getcc_trap_handler; mov %psr, %l0; nop; nop;
diff --git a/include/asm-sparc/ioctls.h b/include/asm-sparc/ioctls.h
index 058c2064f706..3f4d0087b6a3 100644
--- a/include/asm-sparc/ioctls.h
+++ b/include/asm-sparc/ioctls.h
@@ -43,8 +43,6 @@
43#define __TIOCSETX _IOW('t', 34, int) /* SunOS Specific */ 43#define __TIOCSETX _IOW('t', 34, int) /* SunOS Specific */
44#define __TIOCGETX _IOR('t', 35, int) /* SunOS Specific */ 44#define __TIOCGETX _IOR('t', 35, int) /* SunOS Specific */
45#define TIOCCONS _IO('t', 36) 45#define TIOCCONS _IO('t', 36)
46#define __TIOCSSIZE _IOW('t', 37, struct sunos_ttysize) /* SunOS Specific */
47#define __TIOCGSIZE _IOR('t', 38, struct sunos_ttysize) /* SunOS Specific */
48#define TIOCGSOFTCAR _IOR('t', 100, int) 46#define TIOCGSOFTCAR _IOR('t', 100, int)
49#define TIOCSSOFTCAR _IOW('t', 101, int) 47#define TIOCSSOFTCAR _IOW('t', 101, int)
50#define __TIOCUCNTL _IOW('t', 102, int) /* SunOS Specific */ 48#define __TIOCUCNTL _IOW('t', 102, int) /* SunOS Specific */
diff --git a/include/asm-sparc/mman.h b/include/asm-sparc/mman.h
index b7dc40bc68f4..e18be984c01d 100644
--- a/include/asm-sparc/mman.h
+++ b/include/asm-sparc/mman.h
@@ -22,19 +22,6 @@
22#define MAP_POPULATE 0x8000 /* populate (prefault) pagetables */ 22#define MAP_POPULATE 0x8000 /* populate (prefault) pagetables */
23#define MAP_NONBLOCK 0x10000 /* do not block on IO */ 23#define MAP_NONBLOCK 0x10000 /* do not block on IO */
24 24
25/* XXX Need to add flags to SunOS's mctl, mlockall, and madvise system
26 * XXX calls.
27 */
28
29/* SunOS sys_mctl() stuff... */
30#define MC_SYNC 1 /* Sync pages in memory with storage (usu. a file) */
31#define MC_LOCK 2 /* Lock pages into core ram, do not allow swapping of them */
32#define MC_UNLOCK 3 /* Unlock pages locked via previous mctl() with MC_LOCK arg */
33#define MC_LOCKAS 5 /* Lock an entire address space of the calling process */
34#define MC_UNLOCKAS 6 /* Unlock entire address space of calling process */
35
36#define MADV_FREE 0x5 /* (Solaris) contents can be freed */
37
38#ifdef __KERNEL__ 25#ifdef __KERNEL__
39#ifndef __ASSEMBLY__ 26#ifndef __ASSEMBLY__
40#define arch_mmap_check sparc_mmap_check 27#define arch_mmap_check sparc_mmap_check
diff --git a/include/asm-sparc/namei.h b/include/asm-sparc/namei.h
index f2461e8a11ac..618344d89cc4 100644
--- a/include/asm-sparc/namei.h
+++ b/include/asm-sparc/namei.h
@@ -8,19 +8,6 @@
8#ifndef __SPARC_NAMEI_H 8#ifndef __SPARC_NAMEI_H
9#define __SPARC_NAMEI_H 9#define __SPARC_NAMEI_H
10 10
11#define SPARC_BSD_EMUL "/usr/gnemul/sunos/" 11#define __emul_prefix() NULL
12#define SPARC_SOL_EMUL "/usr/gnemul/solaris/"
13
14static inline char * __emul_prefix(void)
15{
16 switch (current->personality) {
17 case PER_SUNOS:
18 return SPARC_BSD_EMUL;
19 case PER_SVR4:
20 return SPARC_SOL_EMUL;
21 default:
22 return NULL;
23 }
24}
25 12
26#endif /* __SPARC_NAMEI_H */ 13#endif /* __SPARC_NAMEI_H */
diff --git a/include/asm-sparc/pconf.h b/include/asm-sparc/pconf.h
deleted file mode 100644
index d73c1f1c49dc..000000000000
--- a/include/asm-sparc/pconf.h
+++ /dev/null
@@ -1,25 +0,0 @@
1/* $Id: pconf.h,v 1.3 1996/04/25 06:13:25 davem Exp $
2 * pconf.h: pathconf() and fpathconf() defines for SunOS
3 * system call compatibility.
4 *
5 * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
6 */
7
8#ifndef _SPARC_PCONF_H
9#define _SPARC_PCONF_H
10
11#include <linux/fs.h>
12#include <linux/limits.h>
13
14#define _PCONF_LINK 1 /* Max number of links to an object */
15#define _PCONF_CANON 2 /* TTY input buffer line size */
16#define _PCONF_INPUT 3 /* Biggest packet a tty can imbibe at once */
17#define _PCONF_NAME 4 /* Filename length max */
18#define _PCONF_PATH 5 /* Max size of a pathname */
19#define _PCONF_PIPE 6 /* Buffer size for a pipe */
20#define _PCONF_CHRESTRICT 7 /* Can only root chown files? */
21#define _PCONF_NOTRUNC 8 /* Are pathnames truncated if too big? */
22#define _PCONF_VDISABLE 9 /* Magic char to disable special tty chars */
23#define _PCONF_MAXPCONF 9
24
25#endif /* !(_SPARC_PCONF_H) */
diff --git a/include/asm-sparc/processor.h b/include/asm-sparc/processor.h
index 40b1e41fdea7..e3006979709b 100644
--- a/include/asm-sparc/processor.h
+++ b/include/asm-sparc/processor.h
@@ -13,8 +13,6 @@
13 */ 13 */
14#define current_text_addr() ({ void *pc; __asm__("sethi %%hi(1f), %0; or %0, %%lo(1f), %0;\n1:" : "=r" (pc)); pc; }) 14#define current_text_addr() ({ void *pc; __asm__("sethi %%hi(1f), %0; or %0, %%lo(1f), %0;\n1:" : "=r" (pc)); pc; })
15 15
16#include <linux/a.out.h>
17
18#include <asm/psr.h> 16#include <asm/psr.h>
19#include <asm/ptrace.h> 17#include <asm/ptrace.h>
20#include <asm/head.h> 18#include <asm/head.h>
@@ -67,7 +65,6 @@ struct thread_struct {
67 struct fpq fpqueue[16]; 65 struct fpq fpqueue[16];
68 unsigned long flags; 66 unsigned long flags;
69 mm_segment_t current_ds; 67 mm_segment_t current_ds;
70 struct exec core_exec; /* just what it says. */
71 int new_signal; 68 int new_signal;
72}; 69};
73 70
diff --git a/include/asm-sparc/socket.h b/include/asm-sparc/socket.h
index 2e2bd0b7c8e3..a00e15df227c 100644
--- a/include/asm-sparc/socket.h
+++ b/include/asm-sparc/socket.h
@@ -24,9 +24,6 @@
24#define SO_SNDTIMEO 0x4000 24#define SO_SNDTIMEO 0x4000
25#define SO_ACCEPTCONN 0x8000 25#define SO_ACCEPTCONN 0x8000
26 26
27/* wha!??? */
28#define SO_DONTLINGER (~SO_LINGER) /* Older SunOS compat. hack */
29
30#define SO_SNDBUF 0x1001 27#define SO_SNDBUF 0x1001
31#define SO_RCVBUF 0x1002 28#define SO_RCVBUF 0x1002
32#define SO_SNDBUFFORCE 0x100a 29#define SO_SNDBUFFORCE 0x100a
diff --git a/include/asm-sparc/solerrno.h b/include/asm-sparc/solerrno.h
deleted file mode 100644
index 8abce7e4639f..000000000000
--- a/include/asm-sparc/solerrno.h
+++ /dev/null
@@ -1,132 +0,0 @@
1/* $Id: solerrno.h,v 1.5 1996/04/25 06:13:32 davem Exp $
2 * solerrno.h: Solaris error return codes for compatibility.
3 *
4 * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
5 */
6
7#ifndef _SPARC_SOLERRNO_H
8#define _SPARC_SOLERRNO_H
9
10#define SOL_EPERM 1 /* Required superuser access perms */
11#define SOL_ENOENT 2 /* File or directory does not exist */
12#define SOL_ESRCH 3 /* Process did not exist */
13#define SOL_EINTR 4 /* System call was interrupted */
14#define SOL_EIO 5 /* An i/o error occurred */
15#define SOL_ENXIO 6 /* Device or Address does not exist */
16#define SOL_E2BIG 7 /* Too many arguments were given */
17#define SOL_ENOEXEC 8 /* Header of executable was munged */
18#define SOL_EBADF 9 /* Bogus file number */
19#define SOL_ECHILD 10 /* No children of process exist */
20#define SOL_EAGAIN 11 /* beep beep, "try again later" */
21#define SOL_ENOMEM 12 /* No memory available */
22#define SOL_EACCES 13 /* Access not allowed */
23#define SOL_EFAULT 14 /* Address passed was invalid */
24#define SOL_ENOTBLK 15 /* blkdev op on non-block device */
25#define SOL_EBUSY 16 /* Mounted device was busy */
26#define SOL_EEXIST 17 /* File specified already exists */
27#define SOL_EXDEV 18 /* Link request across diff devices */
28#define SOL_ENODEV 19 /* Device does not exist on system */
29#define SOL_ENOTDIR 20 /* Dir operation on non-directory */
30#define SOL_EISDIR 21 /* File was of directory type */
31#define SOL_EINVAL 22 /* Argument passed was invalid */
32#define SOL_ENFILE 23 /* No more room in file table */
33#define SOL_EMFILE 24 /* Proc has too many files open */
34#define SOL_ENOTTY 25 /* Ioctl was invalid for req device */
35#define SOL_ETXTBSY 26 /* Text file in busy state */
36#define SOL_EFBIG 27 /* Too big of a file for operation */
37#define SOL_ENOSPC 28 /* Disk is full */
38#define SOL_ESPIPE 29 /* Seek attempted on non-seeking dev*/
39#define SOL_EROFS 30 /* Write attempted on read-only fs */
40#define SOL_EMLINK 31 /* Too many links in file search */
41#define SOL_EPIPE 32 /* Call a plumber */
42#define SOL_EDOM 33 /* Argument was out of fct domain */
43#define SOL_ERANGE 34 /* Could not represent math result */
44#define SOL_ENOMSG 35 /* Message of req type doesn't exist */
45#define SOL_EIDRM 36 /* Identifier has been removed */
46#define SOL_ECHRNG 37 /* Req channel number out of range */
47#define SOL_EL2NSYNC 38 /* Could not sync at run level 2 */
48#define SOL_EL3HLT 39 /* Halted at run level 3 */
49#define SOL_EL3RST 40 /* Reset at run level 3 */
50#define SOL_ELNRNG 41 /* Out of range link number */
51#define SOL_EUNATCH 42 /* Driver for protocol not attached */
52#define SOL_ENOCSI 43 /* CSI structure not around */
53#define SOL_EL2HLT 44 /* Halted at run level 2 */
54#define SOL_EDEADLK 45 /* Deadlock condition detected */
55#define SOL_ENOLCK 46 /* Record locks unavailable */
56#define SOL_ECANCELED 47 /* Cancellation of oper. happened */
57#define SOL_ENOTSUP 48 /* Attempt of unsupported operation */
58#define SOL_EDQUOT 49 /* Users disk quota exceeded */
59#define SOL_EBADE 50 /* Invalid exchange */
60#define SOL_EBADR 51 /* Request descriptor was invalid */
61#define SOL_EXFULL 52 /* Full exchange */
62#define SOL_ENOANO 53 /* ano does not exist */
63#define SOL_EBADRQC 54 /* Req code was invalid */
64#define SOL_EBADSLT 55 /* Bad slot number */
65#define SOL_EDEADLOCK 56 /* Deadlock in fs error */
66#define SOL_EBFONT 57 /* Font file format invalid */
67/* YOW, I LOVE SYSV STREAMS!!!! */
68#define SOL_ENOSTR 60 /* Stream-op on non-stream dev */
69#define SOL_ENODATA 61 /* No data avail at this time */
70#define SOL_ETIME 62 /* Expiration of time occurred */
71#define SOL_ENOSR 63 /* Streams resources exhausted */
72#define SOL_ENONET 64 /* No network connected */
73#define SOL_ENOPKG 65 /* Non-installed package */
74#define SOL_EREMOTE 66 /* Object was on remote machine */
75#define SOL_ENOLINK 67 /* Cut link */
76#define SOL_EADV 68 /* Error in advertise */
77#define SOL_ESRMNT 69 /* Some magic srmount problem */
78#define SOL_ECOMM 70 /* During send, comm error occurred */
79#define SOL_EPROTO 71 /* Protocol botch */
80#define SOL_EMULTIHOP 74 /* Multihop attempted */
81#define SOL_EBADMSG 77 /* Message was unreadable */
82#define SOL_ENAMETOOLONG 78 /* Too long of a path name */
83#define SOL_EOVERFLOW 79 /* Data type too small for datum */
84#define SOL_ENOTUNIQ 80 /* Logical name was not unique */
85#define SOL_EBADFD 81 /* Op cannot be performed on fd */
86#define SOL_EREMCHG 82 /* Remote address is now different */
87#define SOL_ELIBACC 83 /* Shared lib could not be accessed */
88#define SOL_ELIBBAD 84 /* ShLib is corrupted in some way */
89#define SOL_ELIBSCN 85 /* A.out ShLib problems */
90#define SOL_ELIBMAX 86 /* Exceeded ShLib linkage limit */
91#define SOL_ELIBEXEC 87 /* Execution of ShLib attempted */
92#define SOL_EILSEQ 88 /* Bad byte sequence found */
93#define SOL_ENOSYS 89 /* Invalid filesystem operation */
94#define SOL_ELOOP 90 /* Detected loop in symbolic links */
95#define SOL_ERESTART 91 /* System call is restartable */
96#define SOL_ESTRPIPE 92 /* Do not sleep in head of stream */
97#define SOL_ENOTEMPTY 93 /* Rmdir of non-empty directory */
98#define SOL_EUSERS 94 /* Over abundance of users for ufs */
99#define SOL_ENOTSOCK 95 /* Sock-op on non-sock */
100#define SOL_EDESTADDRREQ 96 /* No dest addr given, but needed */
101#define SOL_EMSGSIZE 97 /* Msg too big */
102#define SOL_EPROTOTYPE 98 /* Bad socket protocol */
103#define SOL_ENOPROTOOPT 99 /* Unavailable protocol */
104#define SOL_EPROTONOSUPPORT 120 /* Unsupported protocol */
105#define SOL_ESOCKTNOSUPPORT 121 /* Unsupported socket type */
106#define SOL_EOPNOTSUPP 122 /* Unsupported sock-op */
107#define SOL_EPFNOSUPPORT 123 /* Unsupported protocol family */
108#define SOL_EAFNOSUPPORT 124 /* Unsup addr family for protocol */
109#define SOL_EADDRINUSE 125 /* Req addr is already in use */
110#define SOL_EADDRNOTAVAIL 126 /* Req addr not available right now */
111#define SOL_ENETDOWN 127 /* Your subnet is on fire */
112#define SOL_ENETUNREACH 128 /* Someone playing with gateway and */
113 /* did not tell you he was going to */
114#define SOL_ENETRESET 129 /* Buy less-buggy ethernet cards */
115#define SOL_ECONNABORTED 130 /* Aborted connection due to sw */
116#define SOL_ECONNRESET 131 /* Your peers reset your connection */
117#define SOL_ENOBUFS 132 /* No buffer space available */
118#define SOL_EISCONN 133 /* Connect on already connected */
119 /* socket attempted */
120#define SOL_ENOTCONN 134 /* Comm on non-connected socket */
121#define SOL_ESHUTDOWN 143 /* Op attempted after sock-shutdown */
122#define SOL_ETOOMANYREFS 144 /* Reference limit exceeded */
123#define SOL_ETIMEDOUT 145 /* Timed out connection */
124#define SOL_ECONNREFUSED 146 /* Connection refused by remote host*/
125#define SOL_EHOSTDOWN 147 /* Remote host is up in flames */
126#define SOL_EHOSTUNREACH 148 /* Make a left at Easton Ave..... */
127#define SOL_EWOULDBLOCK EAGAIN /* Just an alias */
128#define SOL_EALREADY 149 /* Operation is already occurring */
129#define SOL_EINPROGRESS 150 /* Operation is happening now */
130#define SOL_ESTALE 151 /* Fungus growth on NFS file handle */
131
132#endif /* !(_SPARC_SOLERRNO_H) */
diff --git a/include/asm-sparc/svr4.h b/include/asm-sparc/svr4.h
deleted file mode 100644
index da1f1c980e2d..000000000000
--- a/include/asm-sparc/svr4.h
+++ /dev/null
@@ -1,119 +0,0 @@
1/* Solaris/SPARC constants and definitions --
2 * (C) 1996 Miguel de Icaza
3 *
4 * This file is not meant to be included by user level applications
5 * but the solaris syscall emulator
6 */
7
8#ifndef _SPARC_SVR4_H
9#define _SPARC_SVR4_H
10
11/* Signals as used by svr4 */
12typedef struct { /* signal set type */
13 ulong sigbits[4];
14} svr4_sigset_t;
15
16/* Values for siginfo.code */
17#define SVR4_SINOINFO 32767
18/* Siginfo, sucker expects bunch of information on those parameters */
19typedef union {
20 char total_size [128];
21 struct {
22 int signo;
23 int code;
24 int error;
25 union {
26 } data;
27 } siginfo;
28} svr4_siginfo_t;
29
30/* Context definition */
31
32/* Location of the user stored registers into a greg_t */
33enum {
34 SVR4_PSR, SVR4_PC, SVR4_NPC, SVR4_Y,
35 SVR4_G1, SVR4_G2, SVR4_G3, SVR4_G4,
36 SVR4_G5, SVR4_G6, SVR4_G7, SVR4_O0,
37 SVR4_O1, SVR4_O2, SVR4_O3, SVR4_O4,
38 SVR4_O5, SVR4_O6, SVR4_O7
39};
40
41/* sizeof (regs) / sizeof (greg_t), defined in the ABI */
42#define SVR4_NREGS 19
43#define SVR4_MAXWIN 31
44
45typedef struct {
46 uint rwin_lo[8];
47 uint rwin_in[8];
48} svr4_rwindow_t;
49
50typedef struct {
51 int count;
52 int __user *winptr [SVR4_MAXWIN]; /* pointer to the windows */
53 svr4_rwindow_t win[SVR4_MAXWIN]; /* the windows */
54} svr4_gwindows_t;
55
56typedef int svr4_gregset_t[SVR4_NREGS];
57
58typedef struct {
59 double fpu_regs[32];
60 void *fp_q;
61 unsigned fp_fsr;
62 u_char fp_nqel;
63 u_char fp_nqsize;
64 u_char inuse; /* if fpu is in use */
65} svr4_fregset_t;
66
67typedef struct {
68 uint id; /* if this holds "xrs" string => ptr is valid */
69 caddr_t ptr;
70} svr4_xrs_t;
71
72/* Machine dependent context */
73typedef struct {
74 svr4_gregset_t greg; /* registers 0..19 (see top) */
75 svr4_gwindows_t __user *gwin; /* may point to register windows */
76 svr4_fregset_t freg; /* floating point registers */
77 svr4_xrs_t xrs; /* mhm? */
78 long pad[19];
79} svr4_mcontext_t;
80
81/* flags for stack_t.flags */
82enum svr4_stack_flags {
83 SVR4_SS_ONSTACK,
84 SVR4_SS_DISABLE,
85};
86
87/* signal stack exection place, unsupported */
88typedef struct svr4_stack_t {
89 char __user *sp;
90 int size;
91 int flags;
92} svr4_stack_t;
93
94/* Context used by getcontext and setcontext */
95typedef struct svr4_ucontext_t {
96 u_long flags; /* context flags, indicate what is loaded */
97 struct svr4_ucontext *link;
98 svr4_sigset_t sigmask;
99 svr4_stack_t stack;
100 svr4_mcontext_t mcontext;
101 long pad[23];
102} svr4_ucontext_t;
103
104/* windows hold the windows as they were at signal time,
105 * ucontext->mcontext holds a pointer to them.
106 * addresses for uc and si are passed as parameters to svr4 signal
107 * handler
108 */
109
110/* This is the signal frame that is passed to the signal handler */
111typedef struct {
112 svr4_gwindows_t gw; /* windows */
113 svr4_ucontext_t uc; /* machine context */
114 svr4_siginfo_t si; /* siginfo */
115} svr4_signal_frame_t;
116
117#define SVR4_SF_ALIGNED (((sizeof (svr4_signal_frame_t) + 7) & (~7)))
118
119#endif /* include control */
diff --git a/include/asm-sparc/termios.h b/include/asm-sparc/termios.h
index 4333232abb9f..733d40504e1e 100644
--- a/include/asm-sparc/termios.h
+++ b/include/asm-sparc/termios.h
@@ -33,11 +33,6 @@ struct ltchars {
33}; 33};
34#endif /* __KERNEL__ */ 34#endif /* __KERNEL__ */
35 35
36struct sunos_ttysize {
37 int st_lines; /* Lines on the terminal */
38 int st_columns; /* Columns on the terminal */
39};
40
41struct winsize { 36struct winsize {
42 unsigned short ws_row; 37 unsigned short ws_row;
43 unsigned short ws_col; 38 unsigned short ws_col;
diff --git a/include/asm-sparc/user.h b/include/asm-sparc/user.h
index b5f1abf733d5..3400ea87f148 100644
--- a/include/asm-sparc/user.h
+++ b/include/asm-sparc/user.h
@@ -1,60 +1,6 @@
1/* $Id: user.h,v 1.5 1998/02/23 01:49:22 rth Exp $
2 * asm-sparc/user.h: Core file definitions for the Sparc.
3 *
4 * Keep in sync with reg.h. Actually, we could get rid of this
5 * one, since we won't a.out core dump that much anyways - miguel.
6 * Copyright (C) 1995 (davem@caip.rutgers.edu)
7 */
8#ifndef _SPARC_USER_H 1#ifndef _SPARC_USER_H
9#define _SPARC_USER_H 2#define _SPARC_USER_H
10 3
11#include <asm/a.out.h> 4/* Nothing to define. */
12struct sunos_regs {
13 unsigned long psr, pc, npc, y;
14 unsigned long regs[15];
15};
16
17struct sunos_fpqueue {
18 unsigned long *addr;
19 unsigned long inst;
20};
21
22struct sunos_fp {
23 union {
24 unsigned long regs[32];
25 double reg_dbls[16];
26 } fregs;
27 unsigned long fsr;
28 unsigned long flags;
29 unsigned long extra;
30 unsigned long fpq_count;
31 struct sunos_fpqueue fpq[16];
32};
33
34struct sunos_fpu {
35 struct sunos_fp fpstatus;
36};
37
38/* The SunOS core file header layout. */
39struct user {
40 unsigned long magic;
41 unsigned long len;
42 struct sunos_regs regs;
43 struct exec uexec;
44 int signal;
45 size_t u_tsize; /* all of these in bytes! */
46 size_t u_dsize;
47 size_t u_ssize;
48 char u_comm[17];
49 struct sunos_fpu fpu;
50 unsigned long sigcode; /* Special sigcontext subcode, if any */
51};
52
53#define NBPG 0x2000
54#define UPAGES 1
55#define HOST_TEXT_START_ADDR (u.start_code)
56#define HOST_DATA_START_ADDR (u.uexec.a_data)
57#define HOST_STACK_END_ADDR (- u.u_ssize * NBPG)
58#define SUNOS_CORE_MAGIC 0x080456
59 5
60#endif /* !(_SPARC_USER_H) */ 6#endif /* !(_SPARC_USER_H) */
diff --git a/include/asm-sparc64/Kbuild b/include/asm-sparc64/Kbuild
index a90dc82129d1..dce1cf9a9313 100644
--- a/include/asm-sparc64/Kbuild
+++ b/include/asm-sparc64/Kbuild
@@ -12,7 +12,6 @@ header-y += display7seg.h
12header-y += envctrl.h 12header-y += envctrl.h
13header-y += openprom.h 13header-y += openprom.h
14header-y += openpromio.h 14header-y += openpromio.h
15header-y += pconf.h
16header-y += psrcompat.h 15header-y += psrcompat.h
17header-y += pstate.h 16header-y += pstate.h
18header-y += reg.h 17header-y += reg.h
diff --git a/include/asm-sparc64/a.out-core.h b/include/asm-sparc64/a.out-core.h
deleted file mode 100644
index 3499b3c425ca..000000000000
--- a/include/asm-sparc64/a.out-core.h
+++ /dev/null
@@ -1,31 +0,0 @@
1/* a.out coredump register dumper
2 *
3 * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved.
4 * Written by David Howells (dhowells@redhat.com)
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public Licence
8 * as published by the Free Software Foundation; either version
9 * 2 of the Licence, or (at your option) any later version.
10 */
11
12#ifndef _ASM_A_OUT_CORE_H
13#define _ASM_A_OUT_CORE_H
14
15#ifdef __KERNEL__
16
17#include <linux/user.h>
18
19/*
20 * fill in the user structure for an a.out core dump
21 */
22static inline void aout_dump_thread(struct pt_regs *regs, struct user *dump)
23{
24 /* Only should be used for SunOS and ancient a.out
25 * SparcLinux binaries... Not worth implementing.
26 */
27 memset(dump, 0, sizeof(struct user));
28}
29
30#endif /* __KERNEL__ */
31#endif /* _ASM_A_OUT_CORE_H */
diff --git a/include/asm-sparc64/a.out.h b/include/asm-sparc64/a.out.h
deleted file mode 100644
index 44208c2a188e..000000000000
--- a/include/asm-sparc64/a.out.h
+++ /dev/null
@@ -1 +0,0 @@
1#include <asm-sparc/a.out.h>
diff --git a/include/asm-sparc64/ioctls.h b/include/asm-sparc64/ioctls.h
index 083c9a0f37de..c1be40647c99 100644
--- a/include/asm-sparc64/ioctls.h
+++ b/include/asm-sparc64/ioctls.h
@@ -44,8 +44,6 @@
44#define __TIOCSETX _IOW('t', 34, int) /* SunOS Specific */ 44#define __TIOCSETX _IOW('t', 34, int) /* SunOS Specific */
45#define __TIOCGETX _IOR('t', 35, int) /* SunOS Specific */ 45#define __TIOCGETX _IOR('t', 35, int) /* SunOS Specific */
46#define TIOCCONS _IO('t', 36) 46#define TIOCCONS _IO('t', 36)
47#define __TIOCSSIZE _IOW('t', 37, struct sunos_ttysize) /* SunOS Specific */
48#define __TIOCGSIZE _IOR('t', 38, struct sunos_ttysize) /* SunOS Specific */
49#define TIOCGSOFTCAR _IOR('t', 100, int) 47#define TIOCGSOFTCAR _IOR('t', 100, int)
50#define TIOCSSOFTCAR _IOW('t', 101, int) 48#define TIOCSSOFTCAR _IOW('t', 101, int)
51#define __TIOCUCNTL _IOW('t', 102, int) /* SunOS Specific */ 49#define __TIOCUCNTL _IOW('t', 102, int) /* SunOS Specific */
diff --git a/include/asm-sparc64/lmb.h b/include/asm-sparc64/lmb.h
new file mode 100644
index 000000000000..6a352cbcf520
--- /dev/null
+++ b/include/asm-sparc64/lmb.h
@@ -0,0 +1,10 @@
1#ifndef _SPARC64_LMB_H
2#define _SPARC64_LMB_H
3
4#include <asm/oplib.h>
5
6#define LMB_DBG(fmt...) prom_printf(fmt)
7
8#define LMB_REAL_LIMIT 0
9
10#endif /* !(_SPARC64_LMB_H) */
diff --git a/include/asm-sparc64/mman.h b/include/asm-sparc64/mman.h
index 8cc1860be630..e584563b56eb 100644
--- a/include/asm-sparc64/mman.h
+++ b/include/asm-sparc64/mman.h
@@ -22,19 +22,6 @@
22#define MAP_POPULATE 0x8000 /* populate (prefault) pagetables */ 22#define MAP_POPULATE 0x8000 /* populate (prefault) pagetables */
23#define MAP_NONBLOCK 0x10000 /* do not block on IO */ 23#define MAP_NONBLOCK 0x10000 /* do not block on IO */
24 24
25/* XXX Need to add flags to SunOS's mctl, mlockall, and madvise system
26 * XXX calls.
27 */
28
29/* SunOS sys_mctl() stuff... */
30#define MC_SYNC 1 /* Sync pages in memory with storage (usu. a file) */
31#define MC_LOCK 2 /* Lock pages into core ram, do not allow swapping of them */
32#define MC_UNLOCK 3 /* Unlock pages locked via previous mctl() with MC_LOCK arg */
33#define MC_LOCKAS 5 /* Lock an entire address space of the calling process */
34#define MC_UNLOCKAS 6 /* Unlock entire address space of calling process */
35
36#define MADV_FREE 0x5 /* (Solaris) contents can be freed */
37
38#ifdef __KERNEL__ 25#ifdef __KERNEL__
39#ifndef __ASSEMBLY__ 26#ifndef __ASSEMBLY__
40#define arch_mmap_check sparc64_mmap_check 27#define arch_mmap_check sparc64_mmap_check
diff --git a/include/asm-sparc64/namei.h b/include/asm-sparc64/namei.h
index ccda19e28695..275161f21213 100644
--- a/include/asm-sparc64/namei.h
+++ b/include/asm-sparc64/namei.h
@@ -8,19 +8,6 @@
8#ifndef __SPARC64_NAMEI_H 8#ifndef __SPARC64_NAMEI_H
9#define __SPARC64_NAMEI_H 9#define __SPARC64_NAMEI_H
10 10
11#define SPARC_BSD_EMUL "/usr/gnemul/sunos/" 11#define __emul_prefix() NULL
12#define SPARC_SOL_EMUL "/usr/gnemul/solaris/"
13
14static inline char * __emul_prefix(void)
15{
16 switch (current->personality) {
17 case PER_SUNOS:
18 return SPARC_BSD_EMUL;
19 case PER_SVR4:
20 return SPARC_SOL_EMUL;
21 default:
22 return NULL;
23 }
24}
25 12
26#endif /* __SPARC64_NAMEI_H */ 13#endif /* __SPARC64_NAMEI_H */
diff --git a/include/asm-sparc64/pconf.h b/include/asm-sparc64/pconf.h
deleted file mode 100644
index aad106a70908..000000000000
--- a/include/asm-sparc64/pconf.h
+++ /dev/null
@@ -1,25 +0,0 @@
1/* $Id: pconf.h,v 1.1 1996/12/02 00:09:10 davem Exp $
2 * pconf.h: pathconf() and fpathconf() defines for SunOS
3 * system call compatibility.
4 *
5 * Copyright (C) 1995, 1996 David S. Miller (davem@caip.rutgers.edu)
6 */
7
8#ifndef _SPARC64_PCONF_H
9#define _SPARC64_PCONF_H
10
11#include <linux/fs.h>
12#include <linux/limits.h>
13
14#define _PCONF_LINK 1 /* Max number of links to an object */
15#define _PCONF_CANON 2 /* TTY input buffer line size */
16#define _PCONF_INPUT 3 /* Biggest packet a tty can imbibe at once */
17#define _PCONF_NAME 4 /* Filename length max */
18#define _PCONF_PATH 5 /* Max size of a pathname */
19#define _PCONF_PIPE 6 /* Buffer size for a pipe */
20#define _PCONF_CHRESTRICT 7 /* Can only root chown files? */
21#define _PCONF_NOTRUNC 8 /* Are pathnames truncated if too big? */
22#define _PCONF_VDISABLE 9 /* Magic char to disable special tty chars */
23#define _PCONF_MAXPCONF 9
24
25#endif /* !(_SPARC64_PCONF_H) */
diff --git a/include/asm-sparc64/socket.h b/include/asm-sparc64/socket.h
index 44a625af6e31..8cf071fae3eb 100644
--- a/include/asm-sparc64/socket.h
+++ b/include/asm-sparc64/socket.h
@@ -24,9 +24,6 @@
24#define SO_SNDTIMEO 0x4000 24#define SO_SNDTIMEO 0x4000
25#define SO_ACCEPTCONN 0x8000 25#define SO_ACCEPTCONN 0x8000
26 26
27/* wha!??? */
28#define SO_DONTLINGER (~SO_LINGER) /* Older SunOS compat. hack */
29
30#define SO_SNDBUF 0x1001 27#define SO_SNDBUF 0x1001
31#define SO_RCVBUF 0x1002 28#define SO_RCVBUF 0x1002
32#define SO_SNDBUFFORCE 0x100a 29#define SO_SNDBUFFORCE 0x100a
diff --git a/include/asm-sparc64/solerrno.h b/include/asm-sparc64/solerrno.h
deleted file mode 100644
index a2ea6fcf3446..000000000000
--- a/include/asm-sparc64/solerrno.h
+++ /dev/null
@@ -1,132 +0,0 @@
1/* $Id: solerrno.h,v 1.1 1996/12/26 14:22:40 davem Exp $
2 * solerrno.h: Solaris error return codes for compatibility.
3 *
4 * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu)
5 */
6
7#ifndef _SPARC64_SOLERRNO_H
8#define _SPARC64_SOLERRNO_H
9
10#define SOL_EPERM 1 /* Required superuser access perms */
11#define SOL_ENOENT 2 /* File or directory does not exist */
12#define SOL_ESRCH 3 /* Process did not exist */
13#define SOL_EINTR 4 /* System call was interrupted */
14#define SOL_EIO 5 /* An i/o error occurred */
15#define SOL_ENXIO 6 /* Device or Address does not exist */
16#define SOL_E2BIG 7 /* Too many arguments were given */
17#define SOL_ENOEXEC 8 /* Header of executable was munged */
18#define SOL_EBADF 9 /* Bogus file number */
19#define SOL_ECHILD 10 /* No children of process exist */
20#define SOL_EAGAIN 11 /* beep beep, "try again later" */
21#define SOL_ENOMEM 12 /* No memory available */
22#define SOL_EACCES 13 /* Access not allowed */
23#define SOL_EFAULT 14 /* Address passed was invalid */
24#define SOL_ENOTBLK 15 /* blkdev op on non-block device */
25#define SOL_EBUSY 16 /* Mounted device was busy */
26#define SOL_EEXIST 17 /* File specified already exists */
27#define SOL_EXDEV 18 /* Link request across diff devices */
28#define SOL_ENODEV 19 /* Device does not exist on system */
29#define SOL_ENOTDIR 20 /* Dir operation on non-directory */
30#define SOL_EISDIR 21 /* File was of directory type */
31#define SOL_EINVAL 22 /* Argument passed was invalid */
32#define SOL_ENFILE 23 /* No more room in file table */
33#define SOL_EMFILE 24 /* Proc has too many files open */
34#define SOL_ENOTTY 25 /* Ioctl was invalid for req device */
35#define SOL_ETXTBSY 26 /* Text file in busy state */
36#define SOL_EFBIG 27 /* Too big of a file for operation */
37#define SOL_ENOSPC 28 /* Disk is full */
38#define SOL_ESPIPE 29 /* Seek attempted on non-seeking dev*/
39#define SOL_EROFS 30 /* Write attempted on read-only fs */
40#define SOL_EMLINK 31 /* Too many links in file search */
41#define SOL_EPIPE 32 /* Call a plumber */
42#define SOL_EDOM 33 /* Argument was out of fct domain */
43#define SOL_ERANGE 34 /* Could not represent math result */
44#define SOL_ENOMSG 35 /* Message of req type doesn't exist */
45#define SOL_EIDRM 36 /* Identifier has been removed */
46#define SOL_ECHRNG 37 /* Req channel number out of range */
47#define SOL_EL2NSYNC 38 /* Could not sync at run level 2 */
48#define SOL_EL3HLT 39 /* Halted at run level 3 */
49#define SOL_EL3RST 40 /* Reset at run level 3 */
50#define SOL_ELNRNG 41 /* Out of range link number */
51#define SOL_EUNATCH 42 /* Driver for protocol not attached */
52#define SOL_ENOCSI 43 /* CSI structure not around */
53#define SOL_EL2HLT 44 /* Halted at run level 2 */
54#define SOL_EDEADLK 45 /* Deadlock condition detected */
55#define SOL_ENOLCK 46 /* Record locks unavailable */
56#define SOL_ECANCELED 47 /* Cancellation of oper. happened */
57#define SOL_ENOTSUP 48 /* Attempt of unsupported operation */
58#define SOL_EDQUOT 49 /* Users disk quota exceeded */
59#define SOL_EBADE 50 /* Invalid exchange */
60#define SOL_EBADR 51 /* Request descriptor was invalid */
61#define SOL_EXFULL 52 /* Full exchange */
62#define SOL_ENOANO 53 /* ano does not exist */
63#define SOL_EBADRQC 54 /* Req code was invalid */
64#define SOL_EBADSLT 55 /* Bad slot number */
65#define SOL_EDEADLOCK 56 /* Deadlock in fs error */
66#define SOL_EBFONT 57 /* Font file format invalid */
67/* YOW, I LOVE SYSV STREAMS!!!! */
68#define SOL_ENOSTR 60 /* Stream-op on non-stream dev */
69#define SOL_ENODATA 61 /* No data avail at this time */
70#define SOL_ETIME 62 /* Expiration of time occurred */
71#define SOL_ENOSR 63 /* Streams resources exhausted */
72#define SOL_ENONET 64 /* No network connected */
73#define SOL_ENOPKG 65 /* Non-installed package */
74#define SOL_EREMOTE 66 /* Object was on remote machine */
75#define SOL_ENOLINK 67 /* Cut link */
76#define SOL_EADV 68 /* Error in advertise */
77#define SOL_ESRMNT 69 /* Some magic srmount problem */
78#define SOL_ECOMM 70 /* During send, comm error occurred */
79#define SOL_EPROTO 71 /* Protocol botch */
80#define SOL_EMULTIHOP 74 /* Multihop attempted */
81#define SOL_EBADMSG 77 /* Message was unreadable */
82#define SOL_ENAMETOOLONG 78 /* Too long of a path name */
83#define SOL_EOVERFLOW 79 /* Data type too small for datum */
84#define SOL_ENOTUNIQ 80 /* Logical name was not unique */
85#define SOL_EBADFD 81 /* Op cannot be performed on fd */
86#define SOL_EREMCHG 82 /* Remote address is now different */
87#define SOL_ELIBACC 83 /* Shared lib could not be accessed */
88#define SOL_ELIBBAD 84 /* ShLib is corrupted in some way */
89#define SOL_ELIBSCN 85 /* A.out ShLib problems */
90#define SOL_ELIBMAX 86 /* Exceeded ShLib linkage limit */
91#define SOL_ELIBEXEC 87 /* Execution of ShLib attempted */
92#define SOL_EILSEQ 88 /* Bad byte sequence found */
93#define SOL_ENOSYS 89 /* Invalid filesystem operation */
94#define SOL_ELOOP 90 /* Detected loop in symbolic links */
95#define SOL_ERESTART 91 /* System call is restartable */
96#define SOL_ESTRPIPE 92 /* Do not sleep in head of stream */
97#define SOL_ENOTEMPTY 93 /* Rmdir of non-empty directory */
98#define SOL_EUSERS 94 /* Over abundance of users for ufs */
99#define SOL_ENOTSOCK 95 /* Sock-op on non-sock */
100#define SOL_EDESTADDRREQ 96 /* No dest addr given, but needed */
101#define SOL_EMSGSIZE 97 /* Msg too big */
102#define SOL_EPROTOTYPE 98 /* Bad socket protocol */
103#define SOL_ENOPROTOOPT 99 /* Unavailable protocol */
104#define SOL_EPROTONOSUPPORT 120 /* Unsupported protocol */
105#define SOL_ESOCKTNOSUPPORT 121 /* Unsupported socket type */
106#define SOL_EOPNOTSUPP 122 /* Unsupported sock-op */
107#define SOL_EPFNOSUPPORT 123 /* Unsupported protocol family */
108#define SOL_EAFNOSUPPORT 124 /* Unsup addr family for protocol */
109#define SOL_EADDRINUSE 125 /* Req addr is already in use */
110#define SOL_EADDRNOTAVAIL 126 /* Req addr not available right now */
111#define SOL_ENETDOWN 127 /* Your subnet is on fire */
112#define SOL_ENETUNREACH 128 /* Someone playing with gateway and */
113 /* did not tell you he was going to */
114#define SOL_ENETRESET 129 /* Buy less-buggy ethernet cards */
115#define SOL_ECONNABORTED 130 /* Aborted connection due to sw */
116#define SOL_ECONNRESET 131 /* Your peers reset your connection */
117#define SOL_ENOBUFS 132 /* No buffer space available */
118#define SOL_EISCONN 133 /* Connect on already connected */
119 /* socket attempted */
120#define SOL_ENOTCONN 134 /* Comm on non-connected socket */
121#define SOL_ESHUTDOWN 143 /* Op attempted after sock-shutdown */
122#define SOL_ETOOMANYREFS 144 /* Reference limit exceeded */
123#define SOL_ETIMEDOUT 145 /* Timed out connection */
124#define SOL_ECONNREFUSED 146 /* Connection refused by remote host*/
125#define SOL_EHOSTDOWN 147 /* Remote host is up in flames */
126#define SOL_EHOSTUNREACH 148 /* Make a left at Easton Ave..... */
127#define SOL_EWOULDBLOCK EAGAIN /* Just an alias */
128#define SOL_EALREADY 149 /* Operation is already occurring */
129#define SOL_EINPROGRESS 150 /* Operation is happening now */
130#define SOL_ESTALE 151 /* Fungus growth on NFS file handle */
131
132#endif /* !(_SPARC64_SOLERRNO_H) */
diff --git a/include/asm-sparc64/svr4.h b/include/asm-sparc64/svr4.h
deleted file mode 100644
index c96d5f116e1c..000000000000
--- a/include/asm-sparc64/svr4.h
+++ /dev/null
@@ -1,120 +0,0 @@
1/* Solaris/SPARC constants and definitions --
2 * (C) 1996 Miguel de Icaza
3 *
4 * This file is not meant to be included by user level applications
5 * but the solaris syscall emulator
6 */
7
8#ifndef _SPARC64_SVR4_H
9#define _SPARC64_SVR4_H
10
11/* Signals as used by svr4 */
12typedef struct { /* signal set type */
13 uint sigbits[4];
14} svr4_sigset_t;
15
16/* Values for siginfo.code */
17#define SVR4_SINOINFO 32767
18/* Siginfo, sucker expects bunch of information on those parameters */
19typedef union {
20 char total_size [128];
21 struct {
22 int signo;
23 int code;
24 int error;
25 union {
26 } data;
27 } siginfo;
28} svr4_siginfo_t;
29
30/* Context definition */
31
32/* Location of the user stored registers into a greg_t */
33enum {
34 SVR4_PSR, SVR4_PC, SVR4_NPC, SVR4_Y,
35 SVR4_G1, SVR4_G2, SVR4_G3, SVR4_G4,
36 SVR4_G5, SVR4_G6, SVR4_G7, SVR4_O0,
37 SVR4_O1, SVR4_O2, SVR4_O3, SVR4_O4,
38 SVR4_O5, SVR4_O6, SVR4_O7
39};
40
41/* sizeof (regs) / sizeof (greg_t), defined in the ABI */
42#define SVR4_NREGS 19
43#define SVR4_MAXWIN 31
44
45typedef struct {
46 u32 rwin_lo[8];
47 u32 rwin_in[8];
48} svr4_rwindow_t;
49
50typedef struct {
51 int count;
52 u32 winptr [SVR4_MAXWIN]; /* pointer to the windows */
53
54 svr4_rwindow_t win[SVR4_MAXWIN]; /* the windows */
55} svr4_gwindows_t;
56
57typedef int svr4_gregset_t[SVR4_NREGS];
58
59typedef struct {
60 u64 fpu_regs[32];
61 u32 fp_q;
62 u32 fp_fsr;
63 u_char fp_nqel;
64 u_char fp_nqsize;
65 u_char inuse; /* if fpu is in use */
66} svr4_fregset_t;
67
68typedef struct {
69 u32 id; /* if this holds "xrs" string => ptr is valid */
70 u32 ptr;
71} svr4_xrs_t;
72
73/* Machine dependent context */
74typedef struct {
75 svr4_gregset_t greg; /* registers 0..19 (see top) */
76 u32 gwin; /* may point to register windows */
77 svr4_fregset_t freg; /* floating point registers */
78 svr4_xrs_t xrs; /* mhm? */
79 int pad[19];
80} svr4_mcontext_t;
81
82/* flags for stack_t.flags */
83enum svr4_stack_flags {
84 SVR4_SS_ONSTACK,
85 SVR4_SS_DISABLE,
86};
87
88/* signal stack execution place, unsupported */
89typedef struct svr4_stack_t {
90 u32 sp;
91 int size;
92 int flags;
93} svr4_stack_t;
94
95/* Context used by getcontext and setcontext */
96typedef struct svr4_ucontext_t {
97 u32 flags; /* context flags, indicate what is loaded */
98 u32 link;
99 svr4_sigset_t sigmask;
100 svr4_stack_t stack;
101 svr4_mcontext_t mcontext;
102 int pad[23];
103} svr4_ucontext_t;
104
105/* windows hold the windows as they were at signal time,
106 * ucontext->mcontext holds a pointer to them.
107 * addresses for uc and si are passed as parameters to svr4 signal
108 * handler
109 */
110
111/* This is the signal frame that is passed to the signal handler */
112typedef struct {
113 svr4_gwindows_t gw; /* windows */
114 svr4_ucontext_t uc; /* machine context */
115 svr4_siginfo_t si; /* siginfo */
116} svr4_signal_frame_t;
117
118#define SVR4_SF_ALIGNED (((sizeof (svr4_signal_frame_t) + 7) & (~7)))
119
120#endif /* include control */
diff --git a/include/asm-sparc64/termios.h b/include/asm-sparc64/termios.h
index ef527211f8a8..cacbea171ad7 100644
--- a/include/asm-sparc64/termios.h
+++ b/include/asm-sparc64/termios.h
@@ -33,11 +33,6 @@ struct ltchars {
33}; 33};
34#endif /* __KERNEL__ */ 34#endif /* __KERNEL__ */
35 35
36struct sunos_ttysize {
37 int st_lines; /* Lines on the terminal */
38 int st_columns; /* Columns on the terminal */
39};
40
41struct winsize { 36struct winsize {
42 unsigned short ws_row; 37 unsigned short ws_row;
43 unsigned short ws_col; 38 unsigned short ws_col;
diff --git a/include/asm-sparc64/ttable.h b/include/asm-sparc64/ttable.h
index bbb9c8f13d61..7208a777750e 100644
--- a/include/asm-sparc64/ttable.h
+++ b/include/asm-sparc64/ttable.h
@@ -99,14 +99,6 @@
99 or %l7, %lo(systbl), %l7; \ 99 or %l7, %lo(systbl), %l7; \
100 nop; nop; 100 nop; nop;
101 101
102#define INDIRECT_SOLARIS_SYSCALL(num) \
103 sethi %hi(109f), %g7; \
104 ba,pt %xcc, etrap; \
105109: or %g7, %lo(109b), %g7; \
106 ba,pt %xcc, tl0_solaris + 0xc; \
107 mov num, %g1; \
108 nop;nop;nop;
109
110#define TRAP_UTRAP(handler,lvl) \ 102#define TRAP_UTRAP(handler,lvl) \
111 mov handler, %g3; \ 103 mov handler, %g3; \
112 ba,pt %xcc, utrap_trap; \ 104 ba,pt %xcc, utrap_trap; \
@@ -117,11 +109,6 @@
117 nop; \ 109 nop; \
118 nop; 110 nop;
119 111
120#ifdef CONFIG_SUNOS_EMUL
121#define SUNOS_SYSCALL_TRAP SYSCALL_TRAP(linux_sparc_syscall32, sunos_sys_table)
122#else
123#define SUNOS_SYSCALL_TRAP TRAP(sunos_syscall)
124#endif
125#ifdef CONFIG_COMPAT 112#ifdef CONFIG_COMPAT
126#define LINUX_32BIT_SYSCALL_TRAP SYSCALL_TRAP(linux_sparc_syscall32, sys_call_table32) 113#define LINUX_32BIT_SYSCALL_TRAP SYSCALL_TRAP(linux_sparc_syscall32, sys_call_table32)
127#else 114#else
@@ -130,11 +117,6 @@
130#define LINUX_64BIT_SYSCALL_TRAP SYSCALL_TRAP(linux_sparc_syscall, sys_call_table64) 117#define LINUX_64BIT_SYSCALL_TRAP SYSCALL_TRAP(linux_sparc_syscall, sys_call_table64)
131#define GETCC_TRAP TRAP(getcc) 118#define GETCC_TRAP TRAP(getcc)
132#define SETCC_TRAP TRAP(setcc) 119#define SETCC_TRAP TRAP(setcc)
133#ifdef CONFIG_SOLARIS_EMUL
134#define SOLARIS_SYSCALL_TRAP TRAP(solaris_sparc_syscall)
135#else
136#define SOLARIS_SYSCALL_TRAP TRAP(solaris_syscall)
137#endif
138#define BREAKPOINT_TRAP TRAP(breakpoint_trap) 120#define BREAKPOINT_TRAP TRAP(breakpoint_trap)
139 121
140#ifdef CONFIG_TRACE_IRQFLAGS 122#ifdef CONFIG_TRACE_IRQFLAGS
diff --git a/include/asm-sparc64/unistd.h b/include/asm-sparc64/unistd.h
index 77559da0ea3f..13be4453a1f0 100644
--- a/include/asm-sparc64/unistd.h
+++ b/include/asm-sparc64/unistd.h
@@ -338,16 +338,6 @@
338#define NR_SYSCALLS 317 338#define NR_SYSCALLS 317
339 339
340#ifdef __KERNEL__ 340#ifdef __KERNEL__
341/* sysconf options, for SunOS compatibility */
342#define _SC_ARG_MAX 1
343#define _SC_CHILD_MAX 2
344#define _SC_CLK_TCK 3
345#define _SC_NGROUPS_MAX 4
346#define _SC_OPEN_MAX 5
347#define _SC_JOB_CONTROL 6
348#define _SC_SAVED_IDS 7
349#define _SC_VERSION 8
350
351#define __ARCH_WANT_IPC_PARSE_VERSION 341#define __ARCH_WANT_IPC_PARSE_VERSION
352#define __ARCH_WANT_OLD_READDIR 342#define __ARCH_WANT_OLD_READDIR
353#define __ARCH_WANT_STAT64 343#define __ARCH_WANT_STAT64
diff --git a/include/asm-sparc64/user.h b/include/asm-sparc64/user.h
index 02b138943837..29fc6e906c29 100644
--- a/include/asm-sparc64/user.h
+++ b/include/asm-sparc64/user.h
@@ -1,60 +1 @@
1/* $Id: user.h,v 1.1 1996/12/26 14:22:44 davem Exp $ #include <asm-sparc/user.h>
2 * asm-sparc64/user.h: Core file definitions for the Sparc.
3 *
4 * Keep in sync with reg.h. Actually, we could get rid of this
5 * one, since we won't a.out core dump that much anyways - miguel.
6 * Copyright (C) 1995 (davem@caip.rutgers.edu)
7 */
8#ifndef _SPARC64_USER_H
9#define _SPARC64_USER_H
10
11#include <linux/a.out.h>
12struct sunos_regs {
13 unsigned int psr, pc, npc, y;
14 unsigned int regs[15];
15};
16
17struct sunos_fpqueue {
18 unsigned int *addr;
19 unsigned int inst;
20};
21
22struct sunos_fp {
23 union {
24 unsigned int regs[32];
25 double reg_dbls[16];
26 } fregs;
27 unsigned int fsr;
28 unsigned int flags;
29 unsigned int extra;
30 unsigned int fpq_count;
31 struct sunos_fpqueue fpq[16];
32};
33
34struct sunos_fpu {
35 struct sunos_fp fpstatus;
36};
37
38/* The SunOS core file header layout. */
39struct user {
40 unsigned int magic;
41 unsigned int len;
42 struct sunos_regs regs;
43 struct exec uexec;
44 int signal;
45 size_t u_tsize; /* all of these in bytes! */
46 size_t u_dsize;
47 size_t u_ssize;
48 char u_comm[17];
49 struct sunos_fpu fpu;
50 unsigned int sigcode; /* Special sigcontext subcode, if any */
51};
52
53#define NBPG PAGE_SIZE /* XXX 4096 maybe? */
54#define UPAGES 1
55#define HOST_TEXT_START_ADDR (u.start_code)
56#define HOST_DATA_START_ADDR (u.start_data)
57#define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * NBPG)
58#define SUNOS_CORE_MAGIC 0x080456
59
60#endif /* !(_SPARC64_USER_H) */
diff --git a/include/asm-x86/boot.h b/include/asm-x86/boot.h
index ed8affbf96cb..2faed7ecb092 100644
--- a/include/asm-x86/boot.h
+++ b/include/asm-x86/boot.h
@@ -17,4 +17,12 @@
17 + (CONFIG_PHYSICAL_ALIGN - 1)) \ 17 + (CONFIG_PHYSICAL_ALIGN - 1)) \
18 & ~(CONFIG_PHYSICAL_ALIGN - 1)) 18 & ~(CONFIG_PHYSICAL_ALIGN - 1))
19 19
20#ifdef CONFIG_X86_64
21#define BOOT_HEAP_SIZE 0x7000
22#define BOOT_STACK_SIZE 0x4000
23#else
24#define BOOT_HEAP_SIZE 0x4000
25#define BOOT_STACK_SIZE 0x1000
26#endif
27
20#endif /* _ASM_BOOT_H */ 28#endif /* _ASM_BOOT_H */
diff --git a/include/asm-x86/dma-mapping.h b/include/asm-x86/dma-mapping.h
index 58f790f4df52..a1a4dc7fe6ec 100644
--- a/include/asm-x86/dma-mapping.h
+++ b/include/asm-x86/dma-mapping.h
@@ -1,5 +1,237 @@
1#ifndef _ASM_DMA_MAPPING_H_
2#define _ASM_DMA_MAPPING_H_
3
4/*
5 * IOMMU interface. See Documentation/DMA-mapping.txt and DMA-API.txt for
6 * documentation.
7 */
8
9#include <linux/scatterlist.h>
10#include <asm/io.h>
11#include <asm/swiotlb.h>
12
13extern dma_addr_t bad_dma_address;
14extern int iommu_merge;
15extern struct device fallback_dev;
16extern int panic_on_overflow;
17extern int forbid_dac;
18extern int force_iommu;
19
20struct dma_mapping_ops {
21 int (*mapping_error)(dma_addr_t dma_addr);
22 void* (*alloc_coherent)(struct device *dev, size_t size,
23 dma_addr_t *dma_handle, gfp_t gfp);
24 void (*free_coherent)(struct device *dev, size_t size,
25 void *vaddr, dma_addr_t dma_handle);
26 dma_addr_t (*map_single)(struct device *hwdev, phys_addr_t ptr,
27 size_t size, int direction);
28 /* like map_single, but doesn't check the device mask */
29 dma_addr_t (*map_simple)(struct device *hwdev, phys_addr_t ptr,
30 size_t size, int direction);
31 void (*unmap_single)(struct device *dev, dma_addr_t addr,
32 size_t size, int direction);
33 void (*sync_single_for_cpu)(struct device *hwdev,
34 dma_addr_t dma_handle, size_t size,
35 int direction);
36 void (*sync_single_for_device)(struct device *hwdev,
37 dma_addr_t dma_handle, size_t size,
38 int direction);
39 void (*sync_single_range_for_cpu)(struct device *hwdev,
40 dma_addr_t dma_handle, unsigned long offset,
41 size_t size, int direction);
42 void (*sync_single_range_for_device)(struct device *hwdev,
43 dma_addr_t dma_handle, unsigned long offset,
44 size_t size, int direction);
45 void (*sync_sg_for_cpu)(struct device *hwdev,
46 struct scatterlist *sg, int nelems,
47 int direction);
48 void (*sync_sg_for_device)(struct device *hwdev,
49 struct scatterlist *sg, int nelems,
50 int direction);
51 int (*map_sg)(struct device *hwdev, struct scatterlist *sg,
52 int nents, int direction);
53 void (*unmap_sg)(struct device *hwdev,
54 struct scatterlist *sg, int nents,
55 int direction);
56 int (*dma_supported)(struct device *hwdev, u64 mask);
57 int is_phys;
58};
59
60extern const struct dma_mapping_ops *dma_ops;
61
62static inline int dma_mapping_error(dma_addr_t dma_addr)
63{
64 if (dma_ops->mapping_error)
65 return dma_ops->mapping_error(dma_addr);
66
67 return (dma_addr == bad_dma_address);
68}
69
70#define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f)
71#define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h)
72
73void *dma_alloc_coherent(struct device *dev, size_t size,
74 dma_addr_t *dma_handle, gfp_t flag);
75
76void dma_free_coherent(struct device *dev, size_t size,
77 void *vaddr, dma_addr_t dma_handle);
78
79
80extern int dma_supported(struct device *hwdev, u64 mask);
81extern int dma_set_mask(struct device *dev, u64 mask);
82
83static inline dma_addr_t
84dma_map_single(struct device *hwdev, void *ptr, size_t size,
85 int direction)
86{
87 BUG_ON(!valid_dma_direction(direction));
88 return dma_ops->map_single(hwdev, virt_to_phys(ptr), size, direction);
89}
90
91static inline void
92dma_unmap_single(struct device *dev, dma_addr_t addr, size_t size,
93 int direction)
94{
95 BUG_ON(!valid_dma_direction(direction));
96 if (dma_ops->unmap_single)
97 dma_ops->unmap_single(dev, addr, size, direction);
98}
99
100static inline int
101dma_map_sg(struct device *hwdev, struct scatterlist *sg,
102 int nents, int direction)
103{
104 BUG_ON(!valid_dma_direction(direction));
105 return dma_ops->map_sg(hwdev, sg, nents, direction);
106}
107
108static inline void
109dma_unmap_sg(struct device *hwdev, struct scatterlist *sg, int nents,
110 int direction)
111{
112 BUG_ON(!valid_dma_direction(direction));
113 if (dma_ops->unmap_sg)
114 dma_ops->unmap_sg(hwdev, sg, nents, direction);
115}
116
117static inline void
118dma_sync_single_for_cpu(struct device *hwdev, dma_addr_t dma_handle,
119 size_t size, int direction)
120{
121 BUG_ON(!valid_dma_direction(direction));
122 if (dma_ops->sync_single_for_cpu)
123 dma_ops->sync_single_for_cpu(hwdev, dma_handle, size,
124 direction);
125 flush_write_buffers();
126}
127
128static inline void
129dma_sync_single_for_device(struct device *hwdev, dma_addr_t dma_handle,
130 size_t size, int direction)
131{
132 BUG_ON(!valid_dma_direction(direction));
133 if (dma_ops->sync_single_for_device)
134 dma_ops->sync_single_for_device(hwdev, dma_handle, size,
135 direction);
136 flush_write_buffers();
137}
138
139static inline void
140dma_sync_single_range_for_cpu(struct device *hwdev, dma_addr_t dma_handle,
141 unsigned long offset, size_t size, int direction)
142{
143 BUG_ON(!valid_dma_direction(direction));
144 if (dma_ops->sync_single_range_for_cpu)
145 dma_ops->sync_single_range_for_cpu(hwdev, dma_handle, offset,
146 size, direction);
147
148 flush_write_buffers();
149}
150
151static inline void
152dma_sync_single_range_for_device(struct device *hwdev, dma_addr_t dma_handle,
153 unsigned long offset, size_t size,
154 int direction)
155{
156 BUG_ON(!valid_dma_direction(direction));
157 if (dma_ops->sync_single_range_for_device)
158 dma_ops->sync_single_range_for_device(hwdev, dma_handle,
159 offset, size, direction);
160
161 flush_write_buffers();
162}
163
164static inline void
165dma_sync_sg_for_cpu(struct device *hwdev, struct scatterlist *sg,
166 int nelems, int direction)
167{
168 BUG_ON(!valid_dma_direction(direction));
169 if (dma_ops->sync_sg_for_cpu)
170 dma_ops->sync_sg_for_cpu(hwdev, sg, nelems, direction);
171 flush_write_buffers();
172}
173
174static inline void
175dma_sync_sg_for_device(struct device *hwdev, struct scatterlist *sg,
176 int nelems, int direction)
177{
178 BUG_ON(!valid_dma_direction(direction));
179 if (dma_ops->sync_sg_for_device)
180 dma_ops->sync_sg_for_device(hwdev, sg, nelems, direction);
181
182 flush_write_buffers();
183}
184
185static inline dma_addr_t dma_map_page(struct device *dev, struct page *page,
186 size_t offset, size_t size,
187 int direction)
188{
189 BUG_ON(!valid_dma_direction(direction));
190 return dma_ops->map_single(dev, page_to_phys(page)+offset,
191 size, direction);
192}
193
194static inline void dma_unmap_page(struct device *dev, dma_addr_t addr,
195 size_t size, int direction)
196{
197 dma_unmap_single(dev, addr, size, direction);
198}
199
200static inline void
201dma_cache_sync(struct device *dev, void *vaddr, size_t size,
202 enum dma_data_direction dir)
203{
204 flush_write_buffers();
205}
206
207static inline int dma_get_cache_alignment(void)
208{
209 /* no easy way to get cache size on all x86, so return the
210 * maximum possible, to be safe */
211 return boot_cpu_data.x86_clflush_size;
212}
213
214#define dma_is_consistent(d, h) (1)
215
1#ifdef CONFIG_X86_32 216#ifdef CONFIG_X86_32
2# include "dma-mapping_32.h" 217# define ARCH_HAS_DMA_DECLARE_COHERENT_MEMORY
3#else 218struct dma_coherent_mem {
4# include "dma-mapping_64.h" 219 void *virt_base;
220 u32 device_base;
221 int size;
222 int flags;
223 unsigned long *bitmap;
224};
225
226extern int
227dma_declare_coherent_memory(struct device *dev, dma_addr_t bus_addr,
228 dma_addr_t device_addr, size_t size, int flags);
229
230extern void
231dma_release_declared_memory(struct device *dev);
232
233extern void *
234dma_mark_declared_memory_occupied(struct device *dev,
235 dma_addr_t device_addr, size_t size);
236#endif /* CONFIG_X86_32 */
5#endif 237#endif
diff --git a/include/asm-x86/dma-mapping_32.h b/include/asm-x86/dma-mapping_32.h
deleted file mode 100644
index 55f01bd9e556..000000000000
--- a/include/asm-x86/dma-mapping_32.h
+++ /dev/null
@@ -1,187 +0,0 @@
1#ifndef _ASM_I386_DMA_MAPPING_H
2#define _ASM_I386_DMA_MAPPING_H
3
4#include <linux/mm.h>
5#include <linux/scatterlist.h>
6
7#include <asm/cache.h>
8#include <asm/io.h>
9#include <asm/bug.h>
10
11#define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f)
12#define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h)
13
14void *dma_alloc_coherent(struct device *dev, size_t size,
15 dma_addr_t *dma_handle, gfp_t flag);
16
17void dma_free_coherent(struct device *dev, size_t size,
18 void *vaddr, dma_addr_t dma_handle);
19
20static inline dma_addr_t
21dma_map_single(struct device *dev, void *ptr, size_t size,
22 enum dma_data_direction direction)
23{
24 BUG_ON(!valid_dma_direction(direction));
25 WARN_ON(size == 0);
26 flush_write_buffers();
27 return virt_to_phys(ptr);
28}
29
30static inline void
31dma_unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size,
32 enum dma_data_direction direction)
33{
34 BUG_ON(!valid_dma_direction(direction));
35}
36
37static inline int
38dma_map_sg(struct device *dev, struct scatterlist *sglist, int nents,
39 enum dma_data_direction direction)
40{
41 struct scatterlist *sg;
42 int i;
43
44 BUG_ON(!valid_dma_direction(direction));
45 WARN_ON(nents == 0 || sglist[0].length == 0);
46
47 for_each_sg(sglist, sg, nents, i) {
48 BUG_ON(!sg_page(sg));
49
50 sg->dma_address = sg_phys(sg);
51 }
52
53 flush_write_buffers();
54 return nents;
55}
56
57static inline dma_addr_t
58dma_map_page(struct device *dev, struct page *page, unsigned long offset,
59 size_t size, enum dma_data_direction direction)
60{
61 BUG_ON(!valid_dma_direction(direction));
62 return page_to_phys(page) + offset;
63}
64
65static inline void
66dma_unmap_page(struct device *dev, dma_addr_t dma_address, size_t size,
67 enum dma_data_direction direction)
68{
69 BUG_ON(!valid_dma_direction(direction));
70}
71
72
73static inline void
74dma_unmap_sg(struct device *dev, struct scatterlist *sg, int nhwentries,
75 enum dma_data_direction direction)
76{
77 BUG_ON(!valid_dma_direction(direction));
78}
79
80static inline void
81dma_sync_single_for_cpu(struct device *dev, dma_addr_t dma_handle, size_t size,
82 enum dma_data_direction direction)
83{
84}
85
86static inline void
87dma_sync_single_for_device(struct device *dev, dma_addr_t dma_handle, size_t size,
88 enum dma_data_direction direction)
89{
90 flush_write_buffers();
91}
92
93static inline void
94dma_sync_single_range_for_cpu(struct device *dev, dma_addr_t dma_handle,
95 unsigned long offset, size_t size,
96 enum dma_data_direction direction)
97{
98}
99
100static inline void
101dma_sync_single_range_for_device(struct device *dev, dma_addr_t dma_handle,
102 unsigned long offset, size_t size,
103 enum dma_data_direction direction)
104{
105 flush_write_buffers();
106}
107
108static inline void
109dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg, int nelems,
110 enum dma_data_direction direction)
111{
112}
113
114static inline void
115dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg, int nelems,
116 enum dma_data_direction direction)
117{
118 flush_write_buffers();
119}
120
121static inline int
122dma_mapping_error(dma_addr_t dma_addr)
123{
124 return 0;
125}
126
127extern int forbid_dac;
128
129static inline int
130dma_supported(struct device *dev, u64 mask)
131{
132 /*
133 * we fall back to GFP_DMA when the mask isn't all 1s,
134 * so we can't guarantee allocations that must be
135 * within a tighter range than GFP_DMA..
136 */
137 if(mask < 0x00ffffff)
138 return 0;
139
140 /* Work around chipset bugs */
141 if (forbid_dac > 0 && mask > 0xffffffffULL)
142 return 0;
143
144 return 1;
145}
146
147static inline int
148dma_set_mask(struct device *dev, u64 mask)
149{
150 if(!dev->dma_mask || !dma_supported(dev, mask))
151 return -EIO;
152
153 *dev->dma_mask = mask;
154
155 return 0;
156}
157
158static inline int
159dma_get_cache_alignment(void)
160{
161 /* no easy way to get cache size on all x86, so return the
162 * maximum possible, to be safe */
163 return (1 << INTERNODE_CACHE_SHIFT);
164}
165
166#define dma_is_consistent(d, h) (1)
167
168static inline void
169dma_cache_sync(struct device *dev, void *vaddr, size_t size,
170 enum dma_data_direction direction)
171{
172 flush_write_buffers();
173}
174
175#define ARCH_HAS_DMA_DECLARE_COHERENT_MEMORY
176extern int
177dma_declare_coherent_memory(struct device *dev, dma_addr_t bus_addr,
178 dma_addr_t device_addr, size_t size, int flags);
179
180extern void
181dma_release_declared_memory(struct device *dev);
182
183extern void *
184dma_mark_declared_memory_occupied(struct device *dev,
185 dma_addr_t device_addr, size_t size);
186
187#endif
diff --git a/include/asm-x86/dma-mapping_64.h b/include/asm-x86/dma-mapping_64.h
deleted file mode 100644
index ecd0f6125ba3..000000000000
--- a/include/asm-x86/dma-mapping_64.h
+++ /dev/null
@@ -1,202 +0,0 @@
1#ifndef _X8664_DMA_MAPPING_H
2#define _X8664_DMA_MAPPING_H 1
3
4/*
5 * IOMMU interface. See Documentation/DMA-mapping.txt and DMA-API.txt for
6 * documentation.
7 */
8
9#include <linux/scatterlist.h>
10#include <asm/io.h>
11#include <asm/swiotlb.h>
12
13struct dma_mapping_ops {
14 int (*mapping_error)(dma_addr_t dma_addr);
15 void* (*alloc_coherent)(struct device *dev, size_t size,
16 dma_addr_t *dma_handle, gfp_t gfp);
17 void (*free_coherent)(struct device *dev, size_t size,
18 void *vaddr, dma_addr_t dma_handle);
19 dma_addr_t (*map_single)(struct device *hwdev, void *ptr,
20 size_t size, int direction);
21 /* like map_single, but doesn't check the device mask */
22 dma_addr_t (*map_simple)(struct device *hwdev, char *ptr,
23 size_t size, int direction);
24 void (*unmap_single)(struct device *dev, dma_addr_t addr,
25 size_t size, int direction);
26 void (*sync_single_for_cpu)(struct device *hwdev,
27 dma_addr_t dma_handle, size_t size,
28 int direction);
29 void (*sync_single_for_device)(struct device *hwdev,
30 dma_addr_t dma_handle, size_t size,
31 int direction);
32 void (*sync_single_range_for_cpu)(struct device *hwdev,
33 dma_addr_t dma_handle, unsigned long offset,
34 size_t size, int direction);
35 void (*sync_single_range_for_device)(struct device *hwdev,
36 dma_addr_t dma_handle, unsigned long offset,
37 size_t size, int direction);
38 void (*sync_sg_for_cpu)(struct device *hwdev,
39 struct scatterlist *sg, int nelems,
40 int direction);
41 void (*sync_sg_for_device)(struct device *hwdev,
42 struct scatterlist *sg, int nelems,
43 int direction);
44 int (*map_sg)(struct device *hwdev, struct scatterlist *sg,
45 int nents, int direction);
46 void (*unmap_sg)(struct device *hwdev,
47 struct scatterlist *sg, int nents,
48 int direction);
49 int (*dma_supported)(struct device *hwdev, u64 mask);
50 int is_phys;
51};
52
53extern dma_addr_t bad_dma_address;
54extern const struct dma_mapping_ops* dma_ops;
55extern int iommu_merge;
56
57static inline int dma_mapping_error(dma_addr_t dma_addr)
58{
59 if (dma_ops->mapping_error)
60 return dma_ops->mapping_error(dma_addr);
61
62 return (dma_addr == bad_dma_address);
63}
64
65#define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f)
66#define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h)
67
68#define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f)
69#define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h)
70
71extern void *dma_alloc_coherent(struct device *dev, size_t size,
72 dma_addr_t *dma_handle, gfp_t gfp);
73extern void dma_free_coherent(struct device *dev, size_t size, void *vaddr,
74 dma_addr_t dma_handle);
75
76static inline dma_addr_t
77dma_map_single(struct device *hwdev, void *ptr, size_t size,
78 int direction)
79{
80 BUG_ON(!valid_dma_direction(direction));
81 return dma_ops->map_single(hwdev, ptr, size, direction);
82}
83
84static inline void
85dma_unmap_single(struct device *dev, dma_addr_t addr,size_t size,
86 int direction)
87{
88 BUG_ON(!valid_dma_direction(direction));
89 dma_ops->unmap_single(dev, addr, size, direction);
90}
91
92#define dma_map_page(dev,page,offset,size,dir) \
93 dma_map_single((dev), page_address(page)+(offset), (size), (dir))
94
95#define dma_unmap_page dma_unmap_single
96
97static inline void
98dma_sync_single_for_cpu(struct device *hwdev, dma_addr_t dma_handle,
99 size_t size, int direction)
100{
101 BUG_ON(!valid_dma_direction(direction));
102 if (dma_ops->sync_single_for_cpu)
103 dma_ops->sync_single_for_cpu(hwdev, dma_handle, size,
104 direction);
105 flush_write_buffers();
106}
107
108static inline void
109dma_sync_single_for_device(struct device *hwdev, dma_addr_t dma_handle,
110 size_t size, int direction)
111{
112 BUG_ON(!valid_dma_direction(direction));
113 if (dma_ops->sync_single_for_device)
114 dma_ops->sync_single_for_device(hwdev, dma_handle, size,
115 direction);
116 flush_write_buffers();
117}
118
119static inline void
120dma_sync_single_range_for_cpu(struct device *hwdev, dma_addr_t dma_handle,
121 unsigned long offset, size_t size, int direction)
122{
123 BUG_ON(!valid_dma_direction(direction));
124 if (dma_ops->sync_single_range_for_cpu) {
125 dma_ops->sync_single_range_for_cpu(hwdev, dma_handle, offset, size, direction);
126 }
127
128 flush_write_buffers();
129}
130
131static inline void
132dma_sync_single_range_for_device(struct device *hwdev, dma_addr_t dma_handle,
133 unsigned long offset, size_t size, int direction)
134{
135 BUG_ON(!valid_dma_direction(direction));
136 if (dma_ops->sync_single_range_for_device)
137 dma_ops->sync_single_range_for_device(hwdev, dma_handle,
138 offset, size, direction);
139
140 flush_write_buffers();
141}
142
143static inline void
144dma_sync_sg_for_cpu(struct device *hwdev, struct scatterlist *sg,
145 int nelems, int direction)
146{
147 BUG_ON(!valid_dma_direction(direction));
148 if (dma_ops->sync_sg_for_cpu)
149 dma_ops->sync_sg_for_cpu(hwdev, sg, nelems, direction);
150 flush_write_buffers();
151}
152
153static inline void
154dma_sync_sg_for_device(struct device *hwdev, struct scatterlist *sg,
155 int nelems, int direction)
156{
157 BUG_ON(!valid_dma_direction(direction));
158 if (dma_ops->sync_sg_for_device) {
159 dma_ops->sync_sg_for_device(hwdev, sg, nelems, direction);
160 }
161
162 flush_write_buffers();
163}
164
165static inline int
166dma_map_sg(struct device *hwdev, struct scatterlist *sg, int nents, int direction)
167{
168 BUG_ON(!valid_dma_direction(direction));
169 return dma_ops->map_sg(hwdev, sg, nents, direction);
170}
171
172static inline void
173dma_unmap_sg(struct device *hwdev, struct scatterlist *sg, int nents,
174 int direction)
175{
176 BUG_ON(!valid_dma_direction(direction));
177 dma_ops->unmap_sg(hwdev, sg, nents, direction);
178}
179
180extern int dma_supported(struct device *hwdev, u64 mask);
181
182/* same for gart, swiotlb, and nommu */
183static inline int dma_get_cache_alignment(void)
184{
185 return boot_cpu_data.x86_clflush_size;
186}
187
188#define dma_is_consistent(d, h) 1
189
190extern int dma_set_mask(struct device *dev, u64 mask);
191
192static inline void
193dma_cache_sync(struct device *dev, void *vaddr, size_t size,
194 enum dma_data_direction dir)
195{
196 flush_write_buffers();
197}
198
199extern struct device fallback_dev;
200extern int panic_on_overflow;
201
202#endif /* _X8664_DMA_MAPPING_H */
diff --git a/include/asm-x86/e820_32.h b/include/asm-x86/e820_32.h
index 43b1a8bd4b34..a9f7c6ec32bf 100644
--- a/include/asm-x86/e820_32.h
+++ b/include/asm-x86/e820_32.h
@@ -24,7 +24,7 @@ extern void update_e820(void);
24extern int e820_all_mapped(unsigned long start, unsigned long end, 24extern int e820_all_mapped(unsigned long start, unsigned long end,
25 unsigned type); 25 unsigned type);
26extern int e820_any_mapped(u64 start, u64 end, unsigned type); 26extern int e820_any_mapped(u64 start, u64 end, unsigned type);
27extern void find_max_pfn(void); 27extern void propagate_e820_map(void);
28extern void register_bootmem_low_pages(unsigned long max_low_pfn); 28extern void register_bootmem_low_pages(unsigned long max_low_pfn);
29extern void add_memory_region(unsigned long long start, 29extern void add_memory_region(unsigned long long start,
30 unsigned long long size, int type); 30 unsigned long long size, int type);
diff --git a/include/asm-x86/genapic_32.h b/include/asm-x86/genapic_32.h
index f1b96932746b..b02ea6e17de8 100644
--- a/include/asm-x86/genapic_32.h
+++ b/include/asm-x86/genapic_32.h
@@ -117,6 +117,7 @@ extern struct genapic *genapic;
117enum uv_system_type {UV_NONE, UV_LEGACY_APIC, UV_X2APIC, UV_NON_UNIQUE_APIC}; 117enum uv_system_type {UV_NONE, UV_LEGACY_APIC, UV_X2APIC, UV_NON_UNIQUE_APIC};
118#define get_uv_system_type() UV_NONE 118#define get_uv_system_type() UV_NONE
119#define is_uv_system() 0 119#define is_uv_system() 0
120#define uv_wakeup_secondary(a, b) 1
120 121
121 122
122#endif 123#endif
diff --git a/include/asm-x86/i387.h b/include/asm-x86/i387.h
index 54522b814f1c..da2adb45f6e3 100644
--- a/include/asm-x86/i387.h
+++ b/include/asm-x86/i387.h
@@ -21,8 +21,9 @@
21 21
22extern void fpu_init(void); 22extern void fpu_init(void);
23extern void mxcsr_feature_mask_init(void); 23extern void mxcsr_feature_mask_init(void);
24extern void init_fpu(struct task_struct *child); 24extern int init_fpu(struct task_struct *child);
25extern asmlinkage void math_state_restore(void); 25extern asmlinkage void math_state_restore(void);
26extern void init_thread_xstate(void);
26 27
27extern user_regset_active_fn fpregs_active, xfpregs_active; 28extern user_regset_active_fn fpregs_active, xfpregs_active;
28extern user_regset_get_fn fpregs_get, xfpregs_get, fpregs_soft_get; 29extern user_regset_get_fn fpregs_get, xfpregs_get, fpregs_soft_get;
@@ -117,24 +118,22 @@ static inline void __save_init_fpu(struct task_struct *tsk)
117 /* Using "fxsaveq %0" would be the ideal choice, but is only supported 118 /* Using "fxsaveq %0" would be the ideal choice, but is only supported
118 starting with gas 2.16. */ 119 starting with gas 2.16. */
119 __asm__ __volatile__("fxsaveq %0" 120 __asm__ __volatile__("fxsaveq %0"
120 : "=m" (tsk->thread.i387.fxsave)); 121 : "=m" (tsk->thread.xstate->fxsave));
121#elif 0 122#elif 0
122 /* Using, as a workaround, the properly prefixed form below isn't 123 /* Using, as a workaround, the properly prefixed form below isn't
123 accepted by any binutils version so far released, complaining that 124 accepted by any binutils version so far released, complaining that
124 the same type of prefix is used twice if an extended register is 125 the same type of prefix is used twice if an extended register is
125 needed for addressing (fix submitted to mainline 2005-11-21). */ 126 needed for addressing (fix submitted to mainline 2005-11-21). */
126 __asm__ __volatile__("rex64/fxsave %0" 127 __asm__ __volatile__("rex64/fxsave %0"
127 : "=m" (tsk->thread.i387.fxsave)); 128 : "=m" (tsk->thread.xstate->fxsave));
128#else 129#else
129 /* This, however, we can work around by forcing the compiler to select 130 /* This, however, we can work around by forcing the compiler to select
130 an addressing mode that doesn't require extended registers. */ 131 an addressing mode that doesn't require extended registers. */
131 __asm__ __volatile__("rex64/fxsave %P2(%1)" 132 __asm__ __volatile__("rex64/fxsave (%1)"
132 : "=m" (tsk->thread.i387.fxsave) 133 : "=m" (tsk->thread.xstate->fxsave)
133 : "cdaSDb" (tsk), 134 : "cdaSDb" (&tsk->thread.xstate->fxsave));
134 "i" (offsetof(__typeof__(*tsk),
135 thread.i387.fxsave)));
136#endif 135#endif
137 clear_fpu_state(&tsk->thread.i387.fxsave); 136 clear_fpu_state(&tsk->thread.xstate->fxsave);
138 task_thread_info(tsk)->status &= ~TS_USEDFPU; 137 task_thread_info(tsk)->status &= ~TS_USEDFPU;
139} 138}
140 139
@@ -148,7 +147,7 @@ static inline int save_i387(struct _fpstate __user *buf)
148 int err = 0; 147 int err = 0;
149 148
150 BUILD_BUG_ON(sizeof(struct user_i387_struct) != 149 BUILD_BUG_ON(sizeof(struct user_i387_struct) !=
151 sizeof(tsk->thread.i387.fxsave)); 150 sizeof(tsk->thread.xstate->fxsave));
152 151
153 if ((unsigned long)buf % 16) 152 if ((unsigned long)buf % 16)
154 printk("save_i387: bad fpstate %p\n", buf); 153 printk("save_i387: bad fpstate %p\n", buf);
@@ -164,7 +163,7 @@ static inline int save_i387(struct _fpstate __user *buf)
164 task_thread_info(tsk)->status &= ~TS_USEDFPU; 163 task_thread_info(tsk)->status &= ~TS_USEDFPU;
165 stts(); 164 stts();
166 } else { 165 } else {
167 if (__copy_to_user(buf, &tsk->thread.i387.fxsave, 166 if (__copy_to_user(buf, &tsk->thread.xstate->fxsave,
168 sizeof(struct i387_fxsave_struct))) 167 sizeof(struct i387_fxsave_struct)))
169 return -1; 168 return -1;
170 } 169 }
@@ -201,7 +200,7 @@ static inline void restore_fpu(struct task_struct *tsk)
201 "nop ; frstor %1", 200 "nop ; frstor %1",
202 "fxrstor %1", 201 "fxrstor %1",
203 X86_FEATURE_FXSR, 202 X86_FEATURE_FXSR,
204 "m" ((tsk)->thread.i387.fxsave)); 203 "m" (tsk->thread.xstate->fxsave));
205} 204}
206 205
207/* We need a safe address that is cheap to find and that is already 206/* We need a safe address that is cheap to find and that is already
@@ -225,8 +224,8 @@ static inline void __save_init_fpu(struct task_struct *tsk)
225 "fxsave %[fx]\n" 224 "fxsave %[fx]\n"
226 "bt $7,%[fsw] ; jnc 1f ; fnclex\n1:", 225 "bt $7,%[fsw] ; jnc 1f ; fnclex\n1:",
227 X86_FEATURE_FXSR, 226 X86_FEATURE_FXSR,
228 [fx] "m" (tsk->thread.i387.fxsave), 227 [fx] "m" (tsk->thread.xstate->fxsave),
229 [fsw] "m" (tsk->thread.i387.fxsave.swd) : "memory"); 228 [fsw] "m" (tsk->thread.xstate->fxsave.swd) : "memory");
230 /* AMD K7/K8 CPUs don't save/restore FDP/FIP/FOP unless an exception 229 /* AMD K7/K8 CPUs don't save/restore FDP/FIP/FOP unless an exception
231 is pending. Clear the x87 state here by setting it to fixed 230 is pending. Clear the x87 state here by setting it to fixed
232 values. safe_address is a random variable that should be in L1 */ 231 values. safe_address is a random variable that should be in L1 */
@@ -327,25 +326,25 @@ static inline void clear_fpu(struct task_struct *tsk)
327static inline unsigned short get_fpu_cwd(struct task_struct *tsk) 326static inline unsigned short get_fpu_cwd(struct task_struct *tsk)
328{ 327{
329 if (cpu_has_fxsr) { 328 if (cpu_has_fxsr) {
330 return tsk->thread.i387.fxsave.cwd; 329 return tsk->thread.xstate->fxsave.cwd;
331 } else { 330 } else {
332 return (unsigned short)tsk->thread.i387.fsave.cwd; 331 return (unsigned short)tsk->thread.xstate->fsave.cwd;
333 } 332 }
334} 333}
335 334
336static inline unsigned short get_fpu_swd(struct task_struct *tsk) 335static inline unsigned short get_fpu_swd(struct task_struct *tsk)
337{ 336{
338 if (cpu_has_fxsr) { 337 if (cpu_has_fxsr) {
339 return tsk->thread.i387.fxsave.swd; 338 return tsk->thread.xstate->fxsave.swd;
340 } else { 339 } else {
341 return (unsigned short)tsk->thread.i387.fsave.swd; 340 return (unsigned short)tsk->thread.xstate->fsave.swd;
342 } 341 }
343} 342}
344 343
345static inline unsigned short get_fpu_mxcsr(struct task_struct *tsk) 344static inline unsigned short get_fpu_mxcsr(struct task_struct *tsk)
346{ 345{
347 if (cpu_has_xmm) { 346 if (cpu_has_xmm) {
348 return tsk->thread.i387.fxsave.mxcsr; 347 return tsk->thread.xstate->fxsave.mxcsr;
349 } else { 348 } else {
350 return MXCSR_DEFAULT; 349 return MXCSR_DEFAULT;
351 } 350 }
diff --git a/include/asm-x86/numa_64.h b/include/asm-x86/numa_64.h
index 32c22ae0709f..22e87c9f6a80 100644
--- a/include/asm-x86/numa_64.h
+++ b/include/asm-x86/numa_64.h
@@ -9,7 +9,8 @@ struct bootnode {
9 u64 end; 9 u64 end;
10}; 10};
11 11
12extern int compute_hash_shift(struct bootnode *nodes, int numnodes); 12extern int compute_hash_shift(struct bootnode *nodes, int numblks,
13 int *nodeids);
13 14
14#define ZONE_ALIGN (1UL << (MAX_ORDER+PAGE_SHIFT)) 15#define ZONE_ALIGN (1UL << (MAX_ORDER+PAGE_SHIFT))
15 16
diff --git a/include/asm-x86/pci_64.h b/include/asm-x86/pci_64.h
index df867e5d80b1..f330234ffa5c 100644
--- a/include/asm-x86/pci_64.h
+++ b/include/asm-x86/pci_64.h
@@ -22,6 +22,7 @@ extern int (*pci_config_read)(int seg, int bus, int dev, int fn,
22extern int (*pci_config_write)(int seg, int bus, int dev, int fn, 22extern int (*pci_config_write)(int seg, int bus, int dev, int fn,
23 int reg, int len, u32 value); 23 int reg, int len, u32 value);
24 24
25extern void dma32_reserve_bootmem(void);
25extern void pci_iommu_alloc(void); 26extern void pci_iommu_alloc(void);
26 27
27/* The PCI address space does equal the physical memory 28/* The PCI address space does equal the physical memory
diff --git a/include/asm-x86/processor.h b/include/asm-x86/processor.h
index 6e26c7c717a2..e6bf92ddeb21 100644
--- a/include/asm-x86/processor.h
+++ b/include/asm-x86/processor.h
@@ -354,7 +354,7 @@ struct i387_soft_struct {
354 u32 entry_eip; 354 u32 entry_eip;
355}; 355};
356 356
357union i387_union { 357union thread_xstate {
358 struct i387_fsave_struct fsave; 358 struct i387_fsave_struct fsave;
359 struct i387_fxsave_struct fxsave; 359 struct i387_fxsave_struct fxsave;
360 struct i387_soft_struct soft; 360 struct i387_soft_struct soft;
@@ -365,6 +365,9 @@ DECLARE_PER_CPU(struct orig_ist, orig_ist);
365#endif 365#endif
366 366
367extern void print_cpu_info(struct cpuinfo_x86 *); 367extern void print_cpu_info(struct cpuinfo_x86 *);
368extern unsigned int xstate_size;
369extern void free_thread_xstate(struct task_struct *);
370extern struct kmem_cache *task_xstate_cachep;
368extern void init_scattered_cpuid_features(struct cpuinfo_x86 *c); 371extern void init_scattered_cpuid_features(struct cpuinfo_x86 *c);
369extern unsigned int init_intel_cacheinfo(struct cpuinfo_x86 *c); 372extern unsigned int init_intel_cacheinfo(struct cpuinfo_x86 *c);
370extern unsigned short num_cache_leaves; 373extern unsigned short num_cache_leaves;
@@ -397,8 +400,8 @@ struct thread_struct {
397 unsigned long cr2; 400 unsigned long cr2;
398 unsigned long trap_no; 401 unsigned long trap_no;
399 unsigned long error_code; 402 unsigned long error_code;
400 /* Floating point info: */ 403 /* floating point and extended processor state */
401 union i387_union i387 __attribute__((aligned(16)));; 404 union thread_xstate *xstate;
402#ifdef CONFIG_X86_32 405#ifdef CONFIG_X86_32
403 /* Virtual 86 mode info */ 406 /* Virtual 86 mode info */
404 struct vm86_struct __user *vm86_info; 407 struct vm86_struct __user *vm86_info;
@@ -918,4 +921,11 @@ extern void start_thread(struct pt_regs *regs, unsigned long new_ip,
918 921
919#define KSTK_EIP(task) (task_pt_regs(task)->ip) 922#define KSTK_EIP(task) (task_pt_regs(task)->ip)
920 923
924/* Get/set a process' ability to use the timestamp counter instruction */
925#define GET_TSC_CTL(adr) get_tsc_mode((adr))
926#define SET_TSC_CTL(val) set_tsc_mode((val))
927
928extern int get_tsc_mode(unsigned long adr);
929extern int set_tsc_mode(unsigned int val);
930
921#endif 931#endif
diff --git a/include/asm-x86/scatterlist.h b/include/asm-x86/scatterlist.h
index d13c197866d6..c0432061f81a 100644
--- a/include/asm-x86/scatterlist.h
+++ b/include/asm-x86/scatterlist.h
@@ -11,9 +11,7 @@ struct scatterlist {
11 unsigned int offset; 11 unsigned int offset;
12 unsigned int length; 12 unsigned int length;
13 dma_addr_t dma_address; 13 dma_addr_t dma_address;
14#ifdef CONFIG_X86_64
15 unsigned int dma_length; 14 unsigned int dma_length;
16#endif
17}; 15};
18 16
19#define ARCH_HAS_SG_CHAIN 17#define ARCH_HAS_SG_CHAIN
diff --git a/include/asm-x86/thread_info.h b/include/asm-x86/thread_info.h
index d5fd12f2abdb..77244f17993f 100644
--- a/include/asm-x86/thread_info.h
+++ b/include/asm-x86/thread_info.h
@@ -1,5 +1,14 @@
1#ifndef _ASM_X86_THREAD_INFO_H
1#ifdef CONFIG_X86_32 2#ifdef CONFIG_X86_32
2# include "thread_info_32.h" 3# include "thread_info_32.h"
3#else 4#else
4# include "thread_info_64.h" 5# include "thread_info_64.h"
5#endif 6#endif
7
8#ifndef __ASSEMBLY__
9extern void arch_task_cache_init(void);
10extern void free_thread_info(struct thread_info *ti);
11extern int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src);
12#define arch_task_cache_init arch_task_cache_init
13#endif
14#endif /* _ASM_X86_THREAD_INFO_H */
diff --git a/include/asm-x86/thread_info_32.h b/include/asm-x86/thread_info_32.h
index 4e053fa561a9..531859962096 100644
--- a/include/asm-x86/thread_info_32.h
+++ b/include/asm-x86/thread_info_32.h
@@ -102,8 +102,6 @@ static inline struct thread_info *current_thread_info(void)
102 __get_free_pages(GFP_KERNEL, get_order(THREAD_SIZE))) 102 __get_free_pages(GFP_KERNEL, get_order(THREAD_SIZE)))
103#endif 103#endif
104 104
105#define free_thread_info(info) free_pages((unsigned long)(info), get_order(THREAD_SIZE))
106
107#else /* !__ASSEMBLY__ */ 105#else /* !__ASSEMBLY__ */
108 106
109/* how to get the thread information struct from ASM */ 107/* how to get the thread information struct from ASM */
diff --git a/include/asm-x86/thread_info_64.h b/include/asm-x86/thread_info_64.h
index 1e5c6f6152cd..ed664e874dec 100644
--- a/include/asm-x86/thread_info_64.h
+++ b/include/asm-x86/thread_info_64.h
@@ -85,8 +85,6 @@ static inline struct thread_info *stack_thread_info(void)
85#define alloc_thread_info(tsk) \ 85#define alloc_thread_info(tsk) \
86 ((struct thread_info *)__get_free_pages(THREAD_FLAGS, THREAD_ORDER)) 86 ((struct thread_info *)__get_free_pages(THREAD_FLAGS, THREAD_ORDER))
87 87
88#define free_thread_info(ti) free_pages((unsigned long) (ti), THREAD_ORDER)
89
90#else /* !__ASSEMBLY__ */ 88#else /* !__ASSEMBLY__ */
91 89
92/* how to get the thread information struct from ASM */ 90/* how to get the thread information struct from ASM */
@@ -126,6 +124,7 @@ static inline struct thread_info *stack_thread_info(void)
126#define TIF_DEBUGCTLMSR 25 /* uses thread_struct.debugctlmsr */ 124#define TIF_DEBUGCTLMSR 25 /* uses thread_struct.debugctlmsr */
127#define TIF_DS_AREA_MSR 26 /* uses thread_struct.ds_area_msr */ 125#define TIF_DS_AREA_MSR 26 /* uses thread_struct.ds_area_msr */
128#define TIF_BTS_TRACE_TS 27 /* record scheduling event timestamps */ 126#define TIF_BTS_TRACE_TS 27 /* record scheduling event timestamps */
127#define TIF_NOTSC 28 /* TSC is not accessible in userland */
129 128
130#define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE) 129#define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE)
131#define _TIF_SIGPENDING (1 << TIF_SIGPENDING) 130#define _TIF_SIGPENDING (1 << TIF_SIGPENDING)
@@ -147,6 +146,7 @@ static inline struct thread_info *stack_thread_info(void)
147#define _TIF_DEBUGCTLMSR (1 << TIF_DEBUGCTLMSR) 146#define _TIF_DEBUGCTLMSR (1 << TIF_DEBUGCTLMSR)
148#define _TIF_DS_AREA_MSR (1 << TIF_DS_AREA_MSR) 147#define _TIF_DS_AREA_MSR (1 << TIF_DS_AREA_MSR)
149#define _TIF_BTS_TRACE_TS (1 << TIF_BTS_TRACE_TS) 148#define _TIF_BTS_TRACE_TS (1 << TIF_BTS_TRACE_TS)
149#define _TIF_NOTSC (1 << TIF_NOTSC)
150 150
151/* work to do on interrupt/exception return */ 151/* work to do on interrupt/exception return */
152#define _TIF_WORK_MASK \ 152#define _TIF_WORK_MASK \
@@ -160,7 +160,7 @@ static inline struct thread_info *stack_thread_info(void)
160 160
161/* flags to check in __switch_to() */ 161/* flags to check in __switch_to() */
162#define _TIF_WORK_CTXSW \ 162#define _TIF_WORK_CTXSW \
163 (_TIF_IO_BITMAP|_TIF_DEBUGCTLMSR|_TIF_DS_AREA_MSR|_TIF_BTS_TRACE_TS) 163 (_TIF_IO_BITMAP|_TIF_DEBUGCTLMSR|_TIF_DS_AREA_MSR|_TIF_BTS_TRACE_TS|_TIF_NOTSC)
164#define _TIF_WORK_CTXSW_PREV _TIF_WORK_CTXSW 164#define _TIF_WORK_CTXSW_PREV _TIF_WORK_CTXSW
165#define _TIF_WORK_CTXSW_NEXT (_TIF_WORK_CTXSW|_TIF_DEBUG) 165#define _TIF_WORK_CTXSW_NEXT (_TIF_WORK_CTXSW|_TIF_DEBUG)
166 166
diff --git a/include/asm-x86/topology.h b/include/asm-x86/topology.h
index 81a29eb08ac4..22073268b481 100644
--- a/include/asm-x86/topology.h
+++ b/include/asm-x86/topology.h
@@ -88,6 +88,17 @@ static inline int cpu_to_node(int cpu)
88#endif 88#endif
89 return per_cpu(x86_cpu_to_node_map, cpu); 89 return per_cpu(x86_cpu_to_node_map, cpu);
90} 90}
91
92#ifdef CONFIG_NUMA
93
94/* Returns a pointer to the cpumask of CPUs on Node 'node'. */
95#define node_to_cpumask_ptr(v, node) \
96 cpumask_t *v = &(node_to_cpumask_map[node])
97
98#define node_to_cpumask_ptr_next(v, node) \
99 v = &(node_to_cpumask_map[node])
100#endif
101
91#endif /* CONFIG_X86_64 */ 102#endif /* CONFIG_X86_64 */
92 103
93/* 104/*
@@ -136,17 +147,13 @@ extern unsigned long node_remap_size[];
136 147
137# define SD_CACHE_NICE_TRIES 2 148# define SD_CACHE_NICE_TRIES 2
138# define SD_IDLE_IDX 2 149# define SD_IDLE_IDX 2
139# define SD_NEWIDLE_IDX 0 150# define SD_NEWIDLE_IDX 2
140# define SD_FORKEXEC_IDX 1 151# define SD_FORKEXEC_IDX 1
141 152
142#endif 153#endif
143 154
144/* sched_domains SD_NODE_INIT for NUMAQ machines */ 155/* sched_domains SD_NODE_INIT for NUMAQ machines */
145#define SD_NODE_INIT (struct sched_domain) { \ 156#define SD_NODE_INIT (struct sched_domain) { \
146 .span = CPU_MASK_NONE, \
147 .parent = NULL, \
148 .child = NULL, \
149 .groups = NULL, \
150 .min_interval = 8, \ 157 .min_interval = 8, \
151 .max_interval = 32, \ 158 .max_interval = 32, \
152 .busy_factor = 32, \ 159 .busy_factor = 32, \
@@ -164,7 +171,6 @@ extern unsigned long node_remap_size[];
164 | SD_WAKE_BALANCE, \ 171 | SD_WAKE_BALANCE, \
165 .last_balance = jiffies, \ 172 .last_balance = jiffies, \
166 .balance_interval = 1, \ 173 .balance_interval = 1, \
167 .nr_balance_failed = 0, \
168} 174}
169 175
170#ifdef CONFIG_X86_64_ACPI_NUMA 176#ifdef CONFIG_X86_64_ACPI_NUMA
@@ -174,10 +180,10 @@ extern int __node_distance(int, int);
174 180
175#else /* CONFIG_NUMA */ 181#else /* CONFIG_NUMA */
176 182
177#include <asm-generic/topology.h>
178
179#endif 183#endif
180 184
185#include <asm-generic/topology.h>
186
181extern cpumask_t cpu_coregroup_map(int cpu); 187extern cpumask_t cpu_coregroup_map(int cpu);
182 188
183#ifdef ENABLE_TOPO_DEFINES 189#ifdef ENABLE_TOPO_DEFINES
diff --git a/include/asm-x86/tsc.h b/include/asm-x86/tsc.h
index d2d8eb5b55f5..0434bd8349a7 100644
--- a/include/asm-x86/tsc.h
+++ b/include/asm-x86/tsc.h
@@ -18,6 +18,7 @@ extern unsigned int cpu_khz;
18extern unsigned int tsc_khz; 18extern unsigned int tsc_khz;
19 19
20extern void disable_TSC(void); 20extern void disable_TSC(void);
21extern void enable_TSC(void);
21 22
22static inline cycles_t get_cycles(void) 23static inline cycles_t get_cycles(void)
23{ 24{
diff --git a/include/crypto/aes.h b/include/crypto/aes.h
index d480b76715a8..40008d67ee3d 100644
--- a/include/crypto/aes.h
+++ b/include/crypto/aes.h
@@ -14,11 +14,13 @@
14#define AES_KEYSIZE_192 24 14#define AES_KEYSIZE_192 24
15#define AES_KEYSIZE_256 32 15#define AES_KEYSIZE_256 32
16#define AES_BLOCK_SIZE 16 16#define AES_BLOCK_SIZE 16
17#define AES_MAX_KEYLENGTH (15 * 16)
18#define AES_MAX_KEYLENGTH_U32 (AES_MAX_KEYLENGTH / sizeof(u32))
17 19
18struct crypto_aes_ctx { 20struct crypto_aes_ctx {
19 u32 key_length; 21 u32 key_length;
20 u32 key_enc[60]; 22 u32 key_enc[AES_MAX_KEYLENGTH_U32];
21 u32 key_dec[60]; 23 u32 key_dec[AES_MAX_KEYLENGTH_U32];
22}; 24};
23 25
24extern u32 crypto_ft_tab[4][256]; 26extern u32 crypto_ft_tab[4][256];
@@ -28,4 +30,6 @@ extern u32 crypto_il_tab[4][256];
28 30
29int crypto_aes_set_key(struct crypto_tfm *tfm, const u8 *in_key, 31int crypto_aes_set_key(struct crypto_tfm *tfm, const u8 *in_key,
30 unsigned int key_len); 32 unsigned int key_len);
33int crypto_aes_expand_key(struct crypto_aes_ctx *ctx, const u8 *in_key,
34 unsigned int key_len);
31#endif 35#endif
diff --git a/include/keys/rxrpc-type.h b/include/keys/rxrpc-type.h
index 4ea429b18750..7609365577f1 100644
--- a/include/keys/rxrpc-type.h
+++ b/include/keys/rxrpc-type.h
@@ -21,4 +21,4 @@ extern struct key_type key_type_rxrpc;
21 21
22extern struct key *rxrpc_get_null_key(const char *); 22extern struct key *rxrpc_get_null_key(const char *);
23 23
24#endif /* _KEYS_USER_TYPE_H */ 24#endif /* _KEYS_RXRPC_TYPE_H */
diff --git a/include/linux/Kbuild b/include/linux/Kbuild
index cedbbd806bf6..b3d9ccde0c27 100644
--- a/include/linux/Kbuild
+++ b/include/linux/Kbuild
@@ -231,7 +231,6 @@ unifdef-y += if_pppol2tp.h
231unifdef-y += if_pppox.h 231unifdef-y += if_pppox.h
232unifdef-y += if_tr.h 232unifdef-y += if_tr.h
233unifdef-y += if_vlan.h 233unifdef-y += if_vlan.h
234unifdef-y += if_wanpipe.h
235unifdef-y += igmp.h 234unifdef-y += igmp.h
236unifdef-y += inet_diag.h 235unifdef-y += inet_diag.h
237unifdef-y += in.h 236unifdef-y += in.h
@@ -261,6 +260,7 @@ unifdef-y += mempolicy.h
261unifdef-y += mii.h 260unifdef-y += mii.h
262unifdef-y += mman.h 261unifdef-y += mman.h
263unifdef-y += mroute.h 262unifdef-y += mroute.h
263unifdef-y += mroute6.h
264unifdef-y += msdos_fs.h 264unifdef-y += msdos_fs.h
265unifdef-y += msg.h 265unifdef-y += msg.h
266unifdef-y += nbd.h 266unifdef-y += nbd.h
@@ -289,6 +289,7 @@ unifdef-y += parport.h
289unifdef-y += patchkey.h 289unifdef-y += patchkey.h
290unifdef-y += pci.h 290unifdef-y += pci.h
291unifdef-y += personality.h 291unifdef-y += personality.h
292unifdef-y += pim.h
292unifdef-y += pktcdvd.h 293unifdef-y += pktcdvd.h
293unifdef-y += pmu.h 294unifdef-y += pmu.h
294unifdef-y += poll.h 295unifdef-y += poll.h
diff --git a/include/linux/aer.h b/include/linux/aer.h
index bcf236d825e8..f2518141de88 100644
--- a/include/linux/aer.h
+++ b/include/linux/aer.h
@@ -13,7 +13,6 @@ extern int pci_enable_pcie_error_reporting(struct pci_dev *dev);
13extern int pci_find_aer_capability(struct pci_dev *dev); 13extern int pci_find_aer_capability(struct pci_dev *dev);
14extern int pci_disable_pcie_error_reporting(struct pci_dev *dev); 14extern int pci_disable_pcie_error_reporting(struct pci_dev *dev);
15extern int pci_cleanup_aer_uncorrect_error_status(struct pci_dev *dev); 15extern int pci_cleanup_aer_uncorrect_error_status(struct pci_dev *dev);
16extern int pci_cleanup_aer_correct_error_status(struct pci_dev *dev);
17#else 16#else
18static inline int pci_enable_pcie_error_reporting(struct pci_dev *dev) 17static inline int pci_enable_pcie_error_reporting(struct pci_dev *dev)
19{ 18{
@@ -31,10 +30,6 @@ static inline int pci_cleanup_aer_uncorrect_error_status(struct pci_dev *dev)
31{ 30{
32 return -EINVAL; 31 return -EINVAL;
33} 32}
34static inline int pci_cleanup_aer_correct_error_status(struct pci_dev *dev)
35{
36 return -EINVAL;
37}
38#endif 33#endif
39 34
40#endif //_AER_H_ 35#endif //_AER_H_
diff --git a/include/linux/arcdevice.h b/include/linux/arcdevice.h
index fde675872c56..a1916078fd08 100644
--- a/include/linux/arcdevice.h
+++ b/include/linux/arcdevice.h
@@ -283,8 +283,8 @@ struct arcnet_local {
283 int next_buf, first_free_buf; 283 int next_buf, first_free_buf;
284 284
285 /* network "reconfiguration" handling */ 285 /* network "reconfiguration" handling */
286 time_t first_recon, /* time of "first" RECON message to count */ 286 unsigned long first_recon; /* time of "first" RECON message to count */
287 last_recon; /* time of most recent RECON */ 287 unsigned long last_recon; /* time of most recent RECON */
288 int num_recons; /* number of RECONs between first and last. */ 288 int num_recons; /* number of RECONs between first and last. */
289 bool network_down; /* do we think the network is down? */ 289 bool network_down; /* do we think the network is down? */
290 290
diff --git a/include/linux/ata_platform.h b/include/linux/ata_platform.h
index b856a2a590d9..9a26c83a2c9e 100644
--- a/include/linux/ata_platform.h
+++ b/include/linux/ata_platform.h
@@ -27,7 +27,10 @@ extern int __devexit __pata_platform_remove(struct device *dev);
27/* 27/*
28 * Marvell SATA private data 28 * Marvell SATA private data
29 */ 29 */
30struct mbus_dram_target_info;
31
30struct mv_sata_platform_data { 32struct mv_sata_platform_data {
33 struct mbus_dram_target_info *dram;
31 int n_ports; /* number of sata ports */ 34 int n_ports; /* number of sata ports */
32}; 35};
33 36
diff --git a/include/linux/atalk.h b/include/linux/atalk.h
index ced8a1ed080c..e9ebac2e2ecc 100644
--- a/include/linux/atalk.h
+++ b/include/linux/atalk.h
@@ -85,8 +85,6 @@ static inline struct atalk_sock *at_sk(struct sock *sk)
85 return (struct atalk_sock *)sk; 85 return (struct atalk_sock *)sk;
86} 86}
87 87
88#include <asm/byteorder.h>
89
90struct ddpehdr { 88struct ddpehdr {
91 __be16 deh_len_hops; /* lower 10 bits are length, next 4 - hops */ 89 __be16 deh_len_hops; /* lower 10 bits are length, next 4 - hops */
92 __be16 deh_sum; 90 __be16 deh_sum;
diff --git a/include/linux/atmel_tc.h b/include/linux/atmel_tc.h
new file mode 100644
index 000000000000..53ba65e30caa
--- /dev/null
+++ b/include/linux/atmel_tc.h
@@ -0,0 +1,252 @@
1/*
2 * Timer/Counter Unit (TC) registers.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 */
9
10#ifndef ATMEL_TC_H
11#define ATMEL_TC_H
12
13#include <linux/compiler.h>
14#include <linux/list.h>
15
16/*
17 * Many 32-bit Atmel SOCs include one or more TC blocks, each of which holds
18 * three general-purpose 16-bit timers. These timers share one register bank.
19 * Depending on the SOC, each timer may have its own clock and IRQ, or those
20 * may be shared by the whole TC block.
21 *
22 * These TC blocks may have up to nine external pins: TCLK0..2 signals for
23 * clocks or clock gates, and per-timer TIOA and TIOB signals used for PWM
24 * or triggering. Those pins need to be set up for use with the TC block,
25 * else they will be used as GPIOs or for a different controller.
26 *
27 * Although we expect each TC block to have a platform_device node, those
28 * nodes are not what drivers bind to. Instead, they ask for a specific
29 * TC block, by number ... which is a common approach on systems with many
30 * timers. Then they use clk_get() and platform_get_irq() to get clock and
31 * IRQ resources.
32 */
33
34struct clk;
35
36/**
37 * struct atmel_tc - information about a Timer/Counter Block
38 * @pdev: physical device
39 * @iomem: resource associated with the I/O register
40 * @regs: mapping through which the I/O registers can be accessed
41 * @irq: irq for each of the three channels
42 * @clk: internal clock source for each of the three channels
43 * @node: list node, for tclib internal use
44 *
45 * On some platforms, each TC channel has its own clocks and IRQs,
46 * while on others, all TC channels share the same clock and IRQ.
47 * Drivers should clk_enable() all the clocks they need even though
48 * all the entries in @clk may point to the same physical clock.
49 * Likewise, drivers should request irqs independently for each
50 * channel, but they must use IRQF_SHARED in case some of the entries
51 * in @irq are actually the same IRQ.
52 */
53struct atmel_tc {
54 struct platform_device *pdev;
55 struct resource *iomem;
56 void __iomem *regs;
57 int irq[3];
58 struct clk *clk[3];
59 struct list_head node;
60};
61
62extern struct atmel_tc *atmel_tc_alloc(unsigned block, const char *name);
63extern void atmel_tc_free(struct atmel_tc *tc);
64
65/* platform-specific ATMEL_TC_TIMER_CLOCKx divisors (0 means 32KiHz) */
66extern const u8 atmel_tc_divisors[5];
67
68
69/*
70 * Two registers have block-wide controls. These are: configuring the three
71 * "external" clocks (or event sources) used by the timer channels; and
72 * synchronizing the timers by resetting them all at once.
73 *
74 * "External" can mean "external to chip" using the TCLK0, TCLK1, or TCLK2
75 * signals. Or, it can mean "external to timer", using the TIOA output from
76 * one of the other two timers that's being run in waveform mode.
77 */
78
79#define ATMEL_TC_BCR 0xc0 /* TC Block Control Register */
80#define ATMEL_TC_SYNC (1 << 0) /* synchronize timers */
81
82#define ATMEL_TC_BMR 0xc4 /* TC Block Mode Register */
83#define ATMEL_TC_TC0XC0S (3 << 0) /* external clock 0 source */
84#define ATMEL_TC_TC0XC0S_TCLK0 (0 << 0)
85#define ATMEL_TC_TC0XC0S_NONE (1 << 0)
86#define ATMEL_TC_TC0XC0S_TIOA1 (2 << 0)
87#define ATMEL_TC_TC0XC0S_TIOA2 (3 << 0)
88#define ATMEL_TC_TC1XC1S (3 << 2) /* external clock 1 source */
89#define ATMEL_TC_TC1XC1S_TCLK1 (0 << 2)
90#define ATMEL_TC_TC1XC1S_NONE (1 << 2)
91#define ATMEL_TC_TC1XC1S_TIOA0 (2 << 2)
92#define ATMEL_TC_TC1XC1S_TIOA2 (3 << 2)
93#define ATMEL_TC_TC2XC2S (3 << 4) /* external clock 2 source */
94#define ATMEL_TC_TC2XC2S_TCLK2 (0 << 4)
95#define ATMEL_TC_TC2XC2S_NONE (1 << 4)
96#define ATMEL_TC_TC2XC2S_TIOA0 (2 << 4)
97#define ATMEL_TC_TC2XC2S_TIOA1 (3 << 4)
98
99
100/*
101 * Each TC block has three "channels", each with one counter and controls.
102 *
103 * Note that the semantics of ATMEL_TC_TIMER_CLOCKx (input clock selection
104 * when it's not "external") is silicon-specific. AT91 platforms use one
105 * set of definitions; AVR32 platforms use a different set. Don't hard-wire
106 * such knowledge into your code, use the global "atmel_tc_divisors" ...
107 * where index N is the divisor for clock N+1, else zero to indicate it uses
108 * the 32 KiHz clock.
109 *
110 * The timers can be chained in various ways, and operated in "waveform"
111 * generation mode (including PWM) or "capture" mode (to time events). In
112 * both modes, behavior can be configured in many ways.
113 *
114 * Each timer has two I/O pins, TIOA and TIOB. Waveform mode uses TIOA as a
115 * PWM output, and TIOB as either another PWM or as a trigger. Capture mode
116 * uses them only as inputs.
117 */
118#define ATMEL_TC_CHAN(idx) ((idx)*0x40)
119#define ATMEL_TC_REG(idx, reg) (ATMEL_TC_CHAN(idx) + ATMEL_TC_ ## reg)
120
121#define ATMEL_TC_CCR 0x00 /* Channel Control Register */
122#define ATMEL_TC_CLKEN (1 << 0) /* clock enable */
123#define ATMEL_TC_CLKDIS (1 << 1) /* clock disable */
124#define ATMEL_TC_SWTRG (1 << 2) /* software trigger */
125
126#define ATMEL_TC_CMR 0x04 /* Channel Mode Register */
127
128/* Both modes share some CMR bits */
129#define ATMEL_TC_TCCLKS (7 << 0) /* clock source */
130#define ATMEL_TC_TIMER_CLOCK1 (0 << 0)
131#define ATMEL_TC_TIMER_CLOCK2 (1 << 0)
132#define ATMEL_TC_TIMER_CLOCK3 (2 << 0)
133#define ATMEL_TC_TIMER_CLOCK4 (3 << 0)
134#define ATMEL_TC_TIMER_CLOCK5 (4 << 0)
135#define ATMEL_TC_XC0 (5 << 0)
136#define ATMEL_TC_XC1 (6 << 0)
137#define ATMEL_TC_XC2 (7 << 0)
138#define ATMEL_TC_CLKI (1 << 3) /* clock invert */
139#define ATMEL_TC_BURST (3 << 4) /* clock gating */
140#define ATMEL_TC_GATE_NONE (0 << 4)
141#define ATMEL_TC_GATE_XC0 (1 << 4)
142#define ATMEL_TC_GATE_XC1 (2 << 4)
143#define ATMEL_TC_GATE_XC2 (3 << 4)
144#define ATMEL_TC_WAVE (1 << 15) /* true = Waveform mode */
145
146/* CAPTURE mode CMR bits */
147#define ATMEL_TC_LDBSTOP (1 << 6) /* counter stops on RB load */
148#define ATMEL_TC_LDBDIS (1 << 7) /* counter disable on RB load */
149#define ATMEL_TC_ETRGEDG (3 << 8) /* external trigger edge */
150#define ATMEL_TC_ETRGEDG_NONE (0 << 8)
151#define ATMEL_TC_ETRGEDG_RISING (1 << 8)
152#define ATMEL_TC_ETRGEDG_FALLING (2 << 8)
153#define ATMEL_TC_ETRGEDG_BOTH (3 << 8)
154#define ATMEL_TC_ABETRG (1 << 10) /* external trigger is TIOA? */
155#define ATMEL_TC_CPCTRG (1 << 14) /* RC compare trigger enable */
156#define ATMEL_TC_LDRA (3 << 16) /* RA loading edge (of TIOA) */
157#define ATMEL_TC_LDRA_NONE (0 << 16)
158#define ATMEL_TC_LDRA_RISING (1 << 16)
159#define ATMEL_TC_LDRA_FALLING (2 << 16)
160#define ATMEL_TC_LDRA_BOTH (3 << 16)
161#define ATMEL_TC_LDRB (3 << 18) /* RB loading edge (of TIOA) */
162#define ATMEL_TC_LDRB_NONE (0 << 18)
163#define ATMEL_TC_LDRB_RISING (1 << 18)
164#define ATMEL_TC_LDRB_FALLING (2 << 18)
165#define ATMEL_TC_LDRB_BOTH (3 << 18)
166
167/* WAVEFORM mode CMR bits */
168#define ATMEL_TC_CPCSTOP (1 << 6) /* RC compare stops counter */
169#define ATMEL_TC_CPCDIS (1 << 7) /* RC compare disables counter */
170#define ATMEL_TC_EEVTEDG (3 << 8) /* external event edge */
171#define ATMEL_TC_EEVTEDG_NONE (0 << 8)
172#define ATMEL_TC_EEVTEDG_RISING (1 << 8)
173#define ATMEL_TC_EEVTEDG_FALLING (2 << 8)
174#define ATMEL_TC_EEVTEDG_BOTH (3 << 8)
175#define ATMEL_TC_EEVT (3 << 10) /* external event source */
176#define ATMEL_TC_EEVT_TIOB (0 << 10)
177#define ATMEL_TC_EEVT_XC0 (1 << 10)
178#define ATMEL_TC_EEVT_XC1 (2 << 10)
179#define ATMEL_TC_EEVT_XC2 (3 << 10)
180#define ATMEL_TC_ENETRG (1 << 12) /* external event is trigger */
181#define ATMEL_TC_WAVESEL (3 << 13) /* waveform type */
182#define ATMEL_TC_WAVESEL_UP (0 << 13)
183#define ATMEL_TC_WAVESEL_UPDOWN (1 << 13)
184#define ATMEL_TC_WAVESEL_UP_AUTO (2 << 13)
185#define ATMEL_TC_WAVESEL_UPDOWN_AUTO (3 << 13)
186#define ATMEL_TC_ACPA (3 << 16) /* RA compare changes TIOA */
187#define ATMEL_TC_ACPA_NONE (0 << 16)
188#define ATMEL_TC_ACPA_SET (1 << 16)
189#define ATMEL_TC_ACPA_CLEAR (2 << 16)
190#define ATMEL_TC_ACPA_TOGGLE (3 << 16)
191#define ATMEL_TC_ACPC (3 << 18) /* RC compare changes TIOA */
192#define ATMEL_TC_ACPC_NONE (0 << 18)
193#define ATMEL_TC_ACPC_SET (1 << 18)
194#define ATMEL_TC_ACPC_CLEAR (2 << 18)
195#define ATMEL_TC_ACPC_TOGGLE (3 << 18)
196#define ATMEL_TC_AEEVT (3 << 20) /* external event changes TIOA */
197#define ATMEL_TC_AEEVT_NONE (0 << 20)
198#define ATMEL_TC_AEEVT_SET (1 << 20)
199#define ATMEL_TC_AEEVT_CLEAR (2 << 20)
200#define ATMEL_TC_AEEVT_TOGGLE (3 << 20)
201#define ATMEL_TC_ASWTRG (3 << 22) /* software trigger changes TIOA */
202#define ATMEL_TC_ASWTRG_NONE (0 << 22)
203#define ATMEL_TC_ASWTRG_SET (1 << 22)
204#define ATMEL_TC_ASWTRG_CLEAR (2 << 22)
205#define ATMEL_TC_ASWTRG_TOGGLE (3 << 22)
206#define ATMEL_TC_BCPB (3 << 24) /* RB compare changes TIOB */
207#define ATMEL_TC_BCPB_NONE (0 << 24)
208#define ATMEL_TC_BCPB_SET (1 << 24)
209#define ATMEL_TC_BCPB_CLEAR (2 << 24)
210#define ATMEL_TC_BCPB_TOGGLE (3 << 24)
211#define ATMEL_TC_BCPC (3 << 26) /* RC compare changes TIOB */
212#define ATMEL_TC_BCPC_NONE (0 << 26)
213#define ATMEL_TC_BCPC_SET (1 << 26)
214#define ATMEL_TC_BCPC_CLEAR (2 << 26)
215#define ATMEL_TC_BCPC_TOGGLE (3 << 26)
216#define ATMEL_TC_BEEVT (3 << 28) /* external event changes TIOB */
217#define ATMEL_TC_BEEVT_NONE (0 << 28)
218#define ATMEL_TC_BEEVT_SET (1 << 28)
219#define ATMEL_TC_BEEVT_CLEAR (2 << 28)
220#define ATMEL_TC_BEEVT_TOGGLE (3 << 28)
221#define ATMEL_TC_BSWTRG (3 << 30) /* software trigger changes TIOB */
222#define ATMEL_TC_BSWTRG_NONE (0 << 30)
223#define ATMEL_TC_BSWTRG_SET (1 << 30)
224#define ATMEL_TC_BSWTRG_CLEAR (2 << 30)
225#define ATMEL_TC_BSWTRG_TOGGLE (3 << 30)
226
227#define ATMEL_TC_CV 0x10 /* counter Value */
228#define ATMEL_TC_RA 0x14 /* register A */
229#define ATMEL_TC_RB 0x18 /* register B */
230#define ATMEL_TC_RC 0x1c /* register C */
231
232#define ATMEL_TC_SR 0x20 /* status (read-only) */
233/* Status-only flags */
234#define ATMEL_TC_CLKSTA (1 << 16) /* clock enabled */
235#define ATMEL_TC_MTIOA (1 << 17) /* TIOA mirror */
236#define ATMEL_TC_MTIOB (1 << 18) /* TIOB mirror */
237
238#define ATMEL_TC_IER 0x24 /* interrupt enable (write-only) */
239#define ATMEL_TC_IDR 0x28 /* interrupt disable (write-only) */
240#define ATMEL_TC_IMR 0x2c /* interrupt mask (read-only) */
241
242/* Status and IRQ flags */
243#define ATMEL_TC_COVFS (1 << 0) /* counter overflow */
244#define ATMEL_TC_LOVRS (1 << 1) /* load overrun */
245#define ATMEL_TC_CPAS (1 << 2) /* RA compare */
246#define ATMEL_TC_CPBS (1 << 3) /* RB compare */
247#define ATMEL_TC_CPCS (1 << 4) /* RC compare */
248#define ATMEL_TC_LDRAS (1 << 5) /* RA loading */
249#define ATMEL_TC_LDRBS (1 << 6) /* RB loading */
250#define ATMEL_TC_ETRGS (1 << 7) /* external trigger */
251
252#endif
diff --git a/include/linux/attribute_container.h b/include/linux/attribute_container.h
index f5582332af04..794ad74b1d61 100644
--- a/include/linux/attribute_container.h
+++ b/include/linux/attribute_container.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * class_container.h - a generic container for all classes 2 * attribute_container.h - a generic container for all classes
3 * 3 *
4 * Copyright (c) 2005 - James Bottomley <James.Bottomley@steeleye.com> 4 * Copyright (c) 2005 - James Bottomley <James.Bottomley@steeleye.com>
5 * 5 *
@@ -18,7 +18,7 @@ struct attribute_container {
18 struct klist containers; 18 struct klist containers;
19 struct class *class; 19 struct class *class;
20 struct attribute_group *grp; 20 struct attribute_group *grp;
21 struct class_device_attribute **attrs; 21 struct device_attribute **attrs;
22 int (*match)(struct attribute_container *, struct device *); 22 int (*match)(struct attribute_container *, struct device *);
23#define ATTRIBUTE_CONTAINER_NO_CLASSDEVS 0x01 23#define ATTRIBUTE_CONTAINER_NO_CLASSDEVS 0x01
24 unsigned long flags; 24 unsigned long flags;
@@ -37,35 +37,35 @@ attribute_container_set_no_classdevs(struct attribute_container *atc)
37} 37}
38 38
39int attribute_container_register(struct attribute_container *cont); 39int attribute_container_register(struct attribute_container *cont);
40int attribute_container_unregister(struct attribute_container *cont); 40int __must_check attribute_container_unregister(struct attribute_container *cont);
41void attribute_container_create_device(struct device *dev, 41void attribute_container_create_device(struct device *dev,
42 int (*fn)(struct attribute_container *, 42 int (*fn)(struct attribute_container *,
43 struct device *, 43 struct device *,
44 struct class_device *)); 44 struct device *));
45void attribute_container_add_device(struct device *dev, 45void attribute_container_add_device(struct device *dev,
46 int (*fn)(struct attribute_container *, 46 int (*fn)(struct attribute_container *,
47 struct device *, 47 struct device *,
48 struct class_device *)); 48 struct device *));
49void attribute_container_remove_device(struct device *dev, 49void attribute_container_remove_device(struct device *dev,
50 void (*fn)(struct attribute_container *, 50 void (*fn)(struct attribute_container *,
51 struct device *, 51 struct device *,
52 struct class_device *)); 52 struct device *));
53void attribute_container_device_trigger(struct device *dev, 53void attribute_container_device_trigger(struct device *dev,
54 int (*fn)(struct attribute_container *, 54 int (*fn)(struct attribute_container *,
55 struct device *, 55 struct device *,
56 struct class_device *)); 56 struct device *));
57void attribute_container_trigger(struct device *dev, 57void attribute_container_trigger(struct device *dev,
58 int (*fn)(struct attribute_container *, 58 int (*fn)(struct attribute_container *,
59 struct device *)); 59 struct device *));
60int attribute_container_add_attrs(struct class_device *classdev); 60int attribute_container_add_attrs(struct device *classdev);
61int attribute_container_add_class_device(struct class_device *classdev); 61int attribute_container_add_class_device(struct device *classdev);
62int attribute_container_add_class_device_adapter(struct attribute_container *cont, 62int attribute_container_add_class_device_adapter(struct attribute_container *cont,
63 struct device *dev, 63 struct device *dev,
64 struct class_device *classdev); 64 struct device *classdev);
65void attribute_container_remove_attrs(struct class_device *classdev); 65void attribute_container_remove_attrs(struct device *classdev);
66void attribute_container_class_device_del(struct class_device *classdev); 66void attribute_container_class_device_del(struct device *classdev);
67struct attribute_container *attribute_container_classdev_to_container(struct class_device *); 67struct attribute_container *attribute_container_classdev_to_container(struct device *);
68struct class_device *attribute_container_find_class_device(struct attribute_container *, struct device *); 68struct device *attribute_container_find_class_device(struct attribute_container *, struct device *);
69struct class_device_attribute **attribute_container_classdev_to_attrs(const struct class_device *classdev); 69struct device_attribute **attribute_container_classdev_to_attrs(const struct device *classdev);
70 70
71#endif 71#endif
diff --git a/include/linux/audit.h b/include/linux/audit.h
index 2af9ec025015..4ccb048cae1d 100644
--- a/include/linux/audit.h
+++ b/include/linux/audit.h
@@ -353,6 +353,33 @@ struct netlink_skb_parms;
353struct linux_binprm; 353struct linux_binprm;
354struct mq_attr; 354struct mq_attr;
355struct mqstat; 355struct mqstat;
356struct audit_watch;
357struct audit_tree;
358
359struct audit_krule {
360 int vers_ops;
361 u32 flags;
362 u32 listnr;
363 u32 action;
364 u32 mask[AUDIT_BITMASK_SIZE];
365 u32 buflen; /* for data alloc on list rules */
366 u32 field_count;
367 char *filterkey; /* ties events to rules */
368 struct audit_field *fields;
369 struct audit_field *arch_f; /* quick access to arch field */
370 struct audit_field *inode_f; /* quick access to an inode field */
371 struct audit_watch *watch; /* associated watch */
372 struct audit_tree *tree; /* associated watched tree */
373 struct list_head rlist; /* entry in audit_{watch,tree}.rules list */
374};
375
376struct audit_field {
377 u32 type;
378 u32 val;
379 u32 op;
380 char *lsm_str;
381 void *lsm_rule;
382};
356 383
357#define AUDITSC_INVALID 0 384#define AUDITSC_INVALID 0
358#define AUDITSC_SUCCESS 1 385#define AUDITSC_SUCCESS 1
@@ -536,6 +563,8 @@ extern void audit_log_d_path(struct audit_buffer *ab,
536 const char *prefix, 563 const char *prefix,
537 struct path *path); 564 struct path *path);
538extern void audit_log_lost(const char *message); 565extern void audit_log_lost(const char *message);
566extern int audit_update_lsm_rules(void);
567
539 /* Private API (for audit.c only) */ 568 /* Private API (for audit.c only) */
540extern int audit_filter_user(struct netlink_skb_parms *cb, int type); 569extern int audit_filter_user(struct netlink_skb_parms *cb, int type);
541extern int audit_filter_type(int type); 570extern int audit_filter_type(int type);
diff --git a/include/linux/bio.h b/include/linux/bio.h
index 4c59bdccd3ee..d259690863fb 100644
--- a/include/linux/bio.h
+++ b/include/linux/bio.h
@@ -327,6 +327,8 @@ extern struct bio *bio_map_kern(struct request_queue *, void *, unsigned int,
327extern void bio_set_pages_dirty(struct bio *bio); 327extern void bio_set_pages_dirty(struct bio *bio);
328extern void bio_check_pages_dirty(struct bio *bio); 328extern void bio_check_pages_dirty(struct bio *bio);
329extern struct bio *bio_copy_user(struct request_queue *, unsigned long, unsigned int, int); 329extern struct bio *bio_copy_user(struct request_queue *, unsigned long, unsigned int, int);
330extern struct bio *bio_copy_user_iov(struct request_queue *, struct sg_iovec *,
331 int, int);
330extern int bio_uncopy_user(struct bio *); 332extern int bio_uncopy_user(struct bio *);
331void zero_fill_bio(struct bio *bio); 333void zero_fill_bio(struct bio *bio);
332 334
diff --git a/include/linux/bitmap.h b/include/linux/bitmap.h
index acad1105d942..1dbe074f1c64 100644
--- a/include/linux/bitmap.h
+++ b/include/linux/bitmap.h
@@ -108,6 +108,7 @@ extern int __bitmap_weight(const unsigned long *bitmap, int bits);
108 108
109extern int bitmap_scnprintf(char *buf, unsigned int len, 109extern int bitmap_scnprintf(char *buf, unsigned int len,
110 const unsigned long *src, int nbits); 110 const unsigned long *src, int nbits);
111extern int bitmap_scnprintf_len(unsigned int len);
111extern int __bitmap_parse(const char *buf, unsigned int buflen, int is_user, 112extern int __bitmap_parse(const char *buf, unsigned int buflen, int is_user,
112 unsigned long *dst, int nbits); 113 unsigned long *dst, int nbits);
113extern int bitmap_parse_user(const char __user *ubuf, unsigned int ulen, 114extern int bitmap_parse_user(const char __user *ubuf, unsigned int ulen,
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 6f79d40dd3c0..c5065e3d2ca9 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -112,6 +112,7 @@ enum rq_flag_bits {
112 __REQ_RW_SYNC, /* request is sync (O_DIRECT) */ 112 __REQ_RW_SYNC, /* request is sync (O_DIRECT) */
113 __REQ_ALLOCED, /* request came from our alloc pool */ 113 __REQ_ALLOCED, /* request came from our alloc pool */
114 __REQ_RW_META, /* metadata io request */ 114 __REQ_RW_META, /* metadata io request */
115 __REQ_COPY_USER, /* contains copies of user pages */
115 __REQ_NR_BITS, /* stops here */ 116 __REQ_NR_BITS, /* stops here */
116}; 117};
117 118
@@ -133,6 +134,7 @@ enum rq_flag_bits {
133#define REQ_RW_SYNC (1 << __REQ_RW_SYNC) 134#define REQ_RW_SYNC (1 << __REQ_RW_SYNC)
134#define REQ_ALLOCED (1 << __REQ_ALLOCED) 135#define REQ_ALLOCED (1 << __REQ_ALLOCED)
135#define REQ_RW_META (1 << __REQ_RW_META) 136#define REQ_RW_META (1 << __REQ_RW_META)
137#define REQ_COPY_USER (1 << __REQ_COPY_USER)
136 138
137#define BLK_MAX_CDB 16 139#define BLK_MAX_CDB 16
138 140
@@ -533,8 +535,13 @@ extern unsigned long blk_max_low_pfn, blk_max_pfn;
533 * BLK_BOUNCE_ANY : don't bounce anything 535 * BLK_BOUNCE_ANY : don't bounce anything
534 * BLK_BOUNCE_ISA : bounce pages above ISA DMA boundary 536 * BLK_BOUNCE_ISA : bounce pages above ISA DMA boundary
535 */ 537 */
538
539#if BITS_PER_LONG == 32
536#define BLK_BOUNCE_HIGH ((u64)blk_max_low_pfn << PAGE_SHIFT) 540#define BLK_BOUNCE_HIGH ((u64)blk_max_low_pfn << PAGE_SHIFT)
537#define BLK_BOUNCE_ANY ((u64)blk_max_pfn << PAGE_SHIFT) 541#else
542#define BLK_BOUNCE_HIGH -1ULL
543#endif
544#define BLK_BOUNCE_ANY (-1ULL)
538#define BLK_BOUNCE_ISA (ISA_DMA_THRESHOLD) 545#define BLK_BOUNCE_ISA (ISA_DMA_THRESHOLD)
539 546
540/* 547/*
diff --git a/include/linux/bsg.h b/include/linux/bsg.h
index 60e377b520f8..e8406c55c6d3 100644
--- a/include/linux/bsg.h
+++ b/include/linux/bsg.h
@@ -55,7 +55,7 @@ struct sg_io_v4 {
55 55
56#if defined(CONFIG_BLK_DEV_BSG) 56#if defined(CONFIG_BLK_DEV_BSG)
57struct bsg_class_device { 57struct bsg_class_device {
58 struct class_device *class_dev; 58 struct device *class_dev;
59 struct device *dev; 59 struct device *dev;
60 int minor; 60 int minor;
61 struct request_queue *queue; 61 struct request_queue *queue;
diff --git a/include/linux/cdrom.h b/include/linux/cdrom.h
index a5cd2047624e..5db265ea60f6 100644
--- a/include/linux/cdrom.h
+++ b/include/linux/cdrom.h
@@ -910,6 +910,7 @@ struct mode_page_header {
910#ifdef __KERNEL__ 910#ifdef __KERNEL__
911#include <linux/fs.h> /* not really needed, later.. */ 911#include <linux/fs.h> /* not really needed, later.. */
912#include <linux/device.h> 912#include <linux/device.h>
913#include <linux/list.h>
913 914
914struct packet_command 915struct packet_command
915{ 916{
@@ -934,7 +935,7 @@ struct packet_command
934/* Uniform cdrom data structures for cdrom.c */ 935/* Uniform cdrom data structures for cdrom.c */
935struct cdrom_device_info { 936struct cdrom_device_info {
936 struct cdrom_device_ops *ops; /* link to device_ops */ 937 struct cdrom_device_ops *ops; /* link to device_ops */
937 struct cdrom_device_info *next; /* next device_info for this major */ 938 struct list_head list; /* linked list of all device_info */
938 struct gendisk *disk; /* matching block layer disk */ 939 struct gendisk *disk; /* matching block layer disk */
939 void *handle; /* driver-dependent data */ 940 void *handle; /* driver-dependent data */
940/* specifications */ 941/* specifications */
@@ -994,7 +995,7 @@ extern int cdrom_ioctl(struct file *file, struct cdrom_device_info *cdi,
994extern int cdrom_media_changed(struct cdrom_device_info *); 995extern int cdrom_media_changed(struct cdrom_device_info *);
995 996
996extern int register_cdrom(struct cdrom_device_info *cdi); 997extern int register_cdrom(struct cdrom_device_info *cdi);
997extern int unregister_cdrom(struct cdrom_device_info *cdi); 998extern void unregister_cdrom(struct cdrom_device_info *cdi);
998 999
999typedef struct { 1000typedef struct {
1000 int data; 1001 int data;
diff --git a/include/linux/cpu.h b/include/linux/cpu.h
index 0be8d65bc3c8..f212fa98283e 100644
--- a/include/linux/cpu.h
+++ b/include/linux/cpu.h
@@ -23,7 +23,6 @@
23#include <linux/node.h> 23#include <linux/node.h>
24#include <linux/compiler.h> 24#include <linux/compiler.h>
25#include <linux/cpumask.h> 25#include <linux/cpumask.h>
26#include <asm/semaphore.h>
27#include <linux/mutex.h> 26#include <linux/mutex.h>
28 27
29struct cpu { 28struct cpu {
diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h
index 7047f58306a7..259c8051155d 100644
--- a/include/linux/cpumask.h
+++ b/include/linux/cpumask.h
@@ -222,8 +222,13 @@ int __next_cpu(int n, const cpumask_t *srcp);
222#define next_cpu(n, src) ({ (void)(src); 1; }) 222#define next_cpu(n, src) ({ (void)(src); 1; })
223#endif 223#endif
224 224
225#ifdef CONFIG_HAVE_CPUMASK_OF_CPU_MAP
226extern cpumask_t *cpumask_of_cpu_map;
227#define cpumask_of_cpu(cpu) (cpumask_of_cpu_map[cpu])
228
229#else
225#define cpumask_of_cpu(cpu) \ 230#define cpumask_of_cpu(cpu) \
226({ \ 231(*({ \
227 typeof(_unused_cpumask_arg_) m; \ 232 typeof(_unused_cpumask_arg_) m; \
228 if (sizeof(m) == sizeof(unsigned long)) { \ 233 if (sizeof(m) == sizeof(unsigned long)) { \
229 m.bits[0] = 1UL<<(cpu); \ 234 m.bits[0] = 1UL<<(cpu); \
@@ -231,8 +236,9 @@ int __next_cpu(int n, const cpumask_t *srcp);
231 cpus_clear(m); \ 236 cpus_clear(m); \
232 cpu_set((cpu), m); \ 237 cpu_set((cpu), m); \
233 } \ 238 } \
234 m; \ 239 &m; \
235}) 240}))
241#endif
236 242
237#define CPU_MASK_LAST_WORD BITMAP_LAST_WORD_MASK(NR_CPUS) 243#define CPU_MASK_LAST_WORD BITMAP_LAST_WORD_MASK(NR_CPUS)
238 244
@@ -243,6 +249,8 @@ int __next_cpu(int n, const cpumask_t *srcp);
243 [BITS_TO_LONGS(NR_CPUS)-1] = CPU_MASK_LAST_WORD \ 249 [BITS_TO_LONGS(NR_CPUS)-1] = CPU_MASK_LAST_WORD \
244} } 250} }
245 251
252#define CPU_MASK_ALL_PTR (&CPU_MASK_ALL)
253
246#else 254#else
247 255
248#define CPU_MASK_ALL \ 256#define CPU_MASK_ALL \
@@ -251,6 +259,10 @@ int __next_cpu(int n, const cpumask_t *srcp);
251 [BITS_TO_LONGS(NR_CPUS)-1] = CPU_MASK_LAST_WORD \ 259 [BITS_TO_LONGS(NR_CPUS)-1] = CPU_MASK_LAST_WORD \
252} } 260} }
253 261
262/* cpu_mask_all is in init/main.c */
263extern cpumask_t cpu_mask_all;
264#define CPU_MASK_ALL_PTR (&cpu_mask_all)
265
254#endif 266#endif
255 267
256#define CPU_MASK_NONE \ 268#define CPU_MASK_NONE \
@@ -273,6 +285,13 @@ static inline int __cpumask_scnprintf(char *buf, int len,
273 return bitmap_scnprintf(buf, len, srcp->bits, nbits); 285 return bitmap_scnprintf(buf, len, srcp->bits, nbits);
274} 286}
275 287
288#define cpumask_scnprintf_len(len) \
289 __cpumask_scnprintf_len((len))
290static inline int __cpumask_scnprintf_len(int len)
291{
292 return bitmap_scnprintf_len(len);
293}
294
276#define cpumask_parse_user(ubuf, ulen, dst) \ 295#define cpumask_parse_user(ubuf, ulen, dst) \
277 __cpumask_parse_user((ubuf), (ulen), &(dst), NR_CPUS) 296 __cpumask_parse_user((ubuf), (ulen), &(dst), NR_CPUS)
278static inline int __cpumask_parse_user(const char __user *buf, int len, 297static inline int __cpumask_parse_user(const char __user *buf, int len,
diff --git a/include/linux/cpuset.h b/include/linux/cpuset.h
index 0a26be353cb3..726761e24003 100644
--- a/include/linux/cpuset.h
+++ b/include/linux/cpuset.h
@@ -20,8 +20,8 @@ extern int number_of_cpusets; /* How many cpusets are defined in system? */
20extern int cpuset_init_early(void); 20extern int cpuset_init_early(void);
21extern int cpuset_init(void); 21extern int cpuset_init(void);
22extern void cpuset_init_smp(void); 22extern void cpuset_init_smp(void);
23extern cpumask_t cpuset_cpus_allowed(struct task_struct *p); 23extern void cpuset_cpus_allowed(struct task_struct *p, cpumask_t *mask);
24extern cpumask_t cpuset_cpus_allowed_locked(struct task_struct *p); 24extern void cpuset_cpus_allowed_locked(struct task_struct *p, cpumask_t *mask);
25extern nodemask_t cpuset_mems_allowed(struct task_struct *p); 25extern nodemask_t cpuset_mems_allowed(struct task_struct *p);
26#define cpuset_current_mems_allowed (current->mems_allowed) 26#define cpuset_current_mems_allowed (current->mems_allowed)
27void cpuset_init_current_mems_allowed(void); 27void cpuset_init_current_mems_allowed(void);
@@ -84,13 +84,14 @@ static inline int cpuset_init_early(void) { return 0; }
84static inline int cpuset_init(void) { return 0; } 84static inline int cpuset_init(void) { return 0; }
85static inline void cpuset_init_smp(void) {} 85static inline void cpuset_init_smp(void) {}
86 86
87static inline cpumask_t cpuset_cpus_allowed(struct task_struct *p) 87static inline void cpuset_cpus_allowed(struct task_struct *p, cpumask_t *mask)
88{ 88{
89 return cpu_possible_map; 89 *mask = cpu_possible_map;
90} 90}
91static inline cpumask_t cpuset_cpus_allowed_locked(struct task_struct *p) 91static inline void cpuset_cpus_allowed_locked(struct task_struct *p,
92 cpumask_t *mask)
92{ 93{
93 return cpu_possible_map; 94 *mask = cpu_possible_map;
94} 95}
95 96
96static inline nodemask_t cpuset_mems_allowed(struct task_struct *p) 97static inline nodemask_t cpuset_mems_allowed(struct task_struct *p)
diff --git a/include/linux/crypto.h b/include/linux/crypto.h
index 5e02d1b46370..425824bd49f3 100644
--- a/include/linux/crypto.h
+++ b/include/linux/crypto.h
@@ -317,14 +317,7 @@ int crypto_unregister_alg(struct crypto_alg *alg);
317/* 317/*
318 * Algorithm query interface. 318 * Algorithm query interface.
319 */ 319 */
320#ifdef CONFIG_CRYPTO
321int crypto_has_alg(const char *name, u32 type, u32 mask); 320int crypto_has_alg(const char *name, u32 type, u32 mask);
322#else
323static inline int crypto_has_alg(const char *name, u32 type, u32 mask)
324{
325 return 0;
326}
327#endif
328 321
329/* 322/*
330 * Transforms: user-instantiated objects which encapsulate algorithms 323 * Transforms: user-instantiated objects which encapsulate algorithms
diff --git a/include/linux/device.h b/include/linux/device.h
index 2258d89bf523..1a060265acea 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -20,7 +20,7 @@
20#include <linux/types.h> 20#include <linux/types.h>
21#include <linux/module.h> 21#include <linux/module.h>
22#include <linux/pm.h> 22#include <linux/pm.h>
23#include <asm/semaphore.h> 23#include <linux/semaphore.h>
24#include <asm/atomic.h> 24#include <asm/atomic.h>
25#include <asm/device.h> 25#include <asm/device.h>
26 26
@@ -429,7 +429,6 @@ struct device {
429 struct kobject kobj; 429 struct kobject kobj;
430 char bus_id[BUS_ID_SIZE]; /* position on parent bus */ 430 char bus_id[BUS_ID_SIZE]; /* position on parent bus */
431 struct device_type *type; 431 struct device_type *type;
432 unsigned is_registered:1;
433 unsigned uevent_suppress:1; 432 unsigned uevent_suppress:1;
434 433
435 struct semaphore sem; /* semaphore to synchronize calls to 434 struct semaphore sem; /* semaphore to synchronize calls to
@@ -475,6 +474,9 @@ struct device {
475 void (*release)(struct device *dev); 474 void (*release)(struct device *dev);
476}; 475};
477 476
477/* Get the wakeup routines, which depend on struct device */
478#include <linux/pm_wakeup.h>
479
478#ifdef CONFIG_NUMA 480#ifdef CONFIG_NUMA
479static inline int dev_to_node(struct device *dev) 481static inline int dev_to_node(struct device *dev)
480{ 482{
@@ -506,7 +508,7 @@ static inline void dev_set_drvdata(struct device *dev, void *data)
506 508
507static inline int device_is_registered(struct device *dev) 509static inline int device_is_registered(struct device *dev)
508{ 510{
509 return dev->is_registered; 511 return dev->kobj.state_in_sysfs;
510} 512}
511 513
512void driver_init(void); 514void driver_init(void);
@@ -543,20 +545,6 @@ extern struct device *device_create(struct class *cls, struct device *parent,
543 dev_t devt, const char *fmt, ...) 545 dev_t devt, const char *fmt, ...)
544 __attribute__((format(printf, 4, 5))); 546 __attribute__((format(printf, 4, 5)));
545extern void device_destroy(struct class *cls, dev_t devt); 547extern void device_destroy(struct class *cls, dev_t devt);
546#ifdef CONFIG_PM_SLEEP
547extern void destroy_suspended_device(struct class *cls, dev_t devt);
548extern void device_pm_schedule_removal(struct device *);
549#else /* !CONFIG_PM_SLEEP */
550static inline void destroy_suspended_device(struct class *cls, dev_t devt)
551{
552 device_destroy(cls, devt);
553}
554
555static inline void device_pm_schedule_removal(struct device *dev)
556{
557 device_unregister(dev);
558}
559#endif /* !CONFIG_PM_SLEEP */
560 548
561/* 549/*
562 * Platform "fixup" functions - allow the platform to have their say 550 * Platform "fixup" functions - allow the platform to have their say
@@ -608,21 +596,16 @@ extern const char *dev_driver_string(struct device *dev);
608#define dev_dbg(dev, format, arg...) \ 596#define dev_dbg(dev, format, arg...) \
609 dev_printk(KERN_DEBUG , dev , format , ## arg) 597 dev_printk(KERN_DEBUG , dev , format , ## arg)
610#else 598#else
611static inline int __attribute__ ((format (printf, 2, 3))) 599#define dev_dbg(dev, format, arg...) \
612dev_dbg(struct device *dev, const char *fmt, ...) 600 ({ if (0) dev_printk(KERN_DEBUG, dev, format, ##arg); 0; })
613{
614 return 0;
615}
616#endif 601#endif
617 602
618#ifdef VERBOSE_DEBUG 603#ifdef VERBOSE_DEBUG
619#define dev_vdbg dev_dbg 604#define dev_vdbg dev_dbg
620#else 605#else
621static inline int __attribute__ ((format (printf, 2, 3))) 606
622dev_vdbg(struct device *dev, const char *fmt, ...) 607#define dev_vdbg(dev, format, arg...) \
623{ 608 ({ if (0) dev_printk(KERN_DEBUG, dev, format, ##arg); 0; })
624 return 0;
625}
626#endif 609#endif
627 610
628/* Create alias, so I can be autoloaded. */ 611/* Create alias, so I can be autoloaded. */
diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
index b4d84ed6187d..d08a5c5eb928 100644
--- a/include/linux/dmaengine.h
+++ b/include/linux/dmaengine.h
@@ -404,7 +404,7 @@ static inline enum dma_status dma_async_is_tx_complete(struct dma_chan *chan,
404 * @last_used: last cookie value handed out 404 * @last_used: last cookie value handed out
405 * 405 *
406 * dma_async_is_complete() is used in dma_async_memcpy_complete() 406 * dma_async_is_complete() is used in dma_async_memcpy_complete()
407 * the test logic is seperated for lightweight testing of multiple cookies 407 * the test logic is separated for lightweight testing of multiple cookies
408 */ 408 */
409static inline enum dma_status dma_async_is_complete(dma_cookie_t cookie, 409static inline enum dma_status dma_async_is_complete(dma_cookie_t cookie,
410 dma_cookie_t last_complete, dma_cookie_t last_used) 410 dma_cookie_t last_complete, dma_cookie_t last_used)
diff --git a/include/linux/efi.h b/include/linux/efi.h
index 14813b595802..a5f359a7ad0e 100644
--- a/include/linux/efi.h
+++ b/include/linux/efi.h
@@ -18,6 +18,7 @@
18#include <linux/proc_fs.h> 18#include <linux/proc_fs.h>
19#include <linux/rtc.h> 19#include <linux/rtc.h>
20#include <linux/ioport.h> 20#include <linux/ioport.h>
21#include <linux/pfn.h>
21 22
22#include <asm/page.h> 23#include <asm/page.h>
23#include <asm/system.h> 24#include <asm/system.h>
@@ -394,4 +395,10 @@ struct efi_generic_dev_path {
394 u16 length; 395 u16 length;
395} __attribute ((packed)); 396} __attribute ((packed));
396 397
398static inline void memrange_efi_to_native(u64 *addr, u64 *npages)
399{
400 *npages = PFN_UP(*addr + (*npages<<EFI_PAGE_SHIFT)) - PFN_DOWN(*addr);
401 *addr &= PAGE_MASK;
402}
403
397#endif /* _LINUX_EFI_H */ 404#endif /* _LINUX_EFI_H */
diff --git a/include/linux/enclosure.h b/include/linux/enclosure.h
index a5978f18ca40..4332442b1b57 100644
--- a/include/linux/enclosure.h
+++ b/include/linux/enclosure.h
@@ -82,7 +82,8 @@ struct enclosure_component_callbacks {
82 82
83struct enclosure_component { 83struct enclosure_component {
84 void *scratch; 84 void *scratch;
85 struct class_device cdev; 85 struct device cdev;
86 struct device *dev;
86 enum enclosure_component_type type; 87 enum enclosure_component_type type;
87 int number; 88 int number;
88 int fault; 89 int fault;
@@ -94,20 +95,20 @@ struct enclosure_component {
94struct enclosure_device { 95struct enclosure_device {
95 void *scratch; 96 void *scratch;
96 struct list_head node; 97 struct list_head node;
97 struct class_device cdev; 98 struct device edev;
98 struct enclosure_component_callbacks *cb; 99 struct enclosure_component_callbacks *cb;
99 int components; 100 int components;
100 struct enclosure_component component[0]; 101 struct enclosure_component component[0];
101}; 102};
102 103
103static inline struct enclosure_device * 104static inline struct enclosure_device *
104to_enclosure_device(struct class_device *dev) 105to_enclosure_device(struct device *dev)
105{ 106{
106 return container_of(dev, struct enclosure_device, cdev); 107 return container_of(dev, struct enclosure_device, edev);
107} 108}
108 109
109static inline struct enclosure_component * 110static inline struct enclosure_component *
110to_enclosure_component(struct class_device *dev) 111to_enclosure_component(struct device *dev)
111{ 112{
112 return container_of(dev, struct enclosure_component, cdev); 113 return container_of(dev, struct enclosure_component, cdev);
113} 114}
diff --git a/include/linux/file.h b/include/linux/file.h
index 7239baac81a9..653477021e4c 100644
--- a/include/linux/file.h
+++ b/include/linux/file.h
@@ -61,6 +61,7 @@ extern struct kmem_cache *filp_cachep;
61 61
62extern void __fput(struct file *); 62extern void __fput(struct file *);
63extern void fput(struct file *); 63extern void fput(struct file *);
64extern void drop_file_write_access(struct file *file);
64 65
65struct file_operations; 66struct file_operations;
66struct vfsmount; 67struct vfsmount;
diff --git a/include/linux/filter.h b/include/linux/filter.h
index ddfa0372a3b7..b6ea9aa9e853 100644
--- a/include/linux/filter.h
+++ b/include/linux/filter.h
@@ -37,21 +37,6 @@ struct sock_fprog /* Required for SO_ATTACH_FILTER. */
37 struct sock_filter __user *filter; 37 struct sock_filter __user *filter;
38}; 38};
39 39
40#ifdef __KERNEL__
41struct sk_filter
42{
43 atomic_t refcnt;
44 unsigned int len; /* Number of filter blocks */
45 struct rcu_head rcu;
46 struct sock_filter insns[0];
47};
48
49static inline unsigned int sk_filter_len(struct sk_filter *fp)
50{
51 return fp->len*sizeof(struct sock_filter) + sizeof(*fp);
52}
53#endif
54
55/* 40/*
56 * Instruction classes 41 * Instruction classes
57 */ 42 */
@@ -136,15 +121,31 @@ static inline unsigned int sk_filter_len(struct sk_filter *fp)
136#define SKF_AD_PROTOCOL 0 121#define SKF_AD_PROTOCOL 0
137#define SKF_AD_PKTTYPE 4 122#define SKF_AD_PKTTYPE 4
138#define SKF_AD_IFINDEX 8 123#define SKF_AD_IFINDEX 8
139#define SKF_AD_MAX 12 124#define SKF_AD_NLATTR 12
125#define SKF_AD_MAX 16
140#define SKF_NET_OFF (-0x100000) 126#define SKF_NET_OFF (-0x100000)
141#define SKF_LL_OFF (-0x200000) 127#define SKF_LL_OFF (-0x200000)
142 128
143#ifdef __KERNEL__ 129#ifdef __KERNEL__
130struct sk_filter
131{
132 atomic_t refcnt;
133 unsigned int len; /* Number of filter blocks */
134 struct rcu_head rcu;
135 struct sock_filter insns[0];
136};
137
138static inline unsigned int sk_filter_len(const struct sk_filter *fp)
139{
140 return fp->len * sizeof(struct sock_filter) + sizeof(*fp);
141}
142
144struct sk_buff; 143struct sk_buff;
145struct sock; 144struct sock;
146 145
147extern unsigned int sk_run_filter(struct sk_buff *skb, struct sock_filter *filter, int flen); 146extern int sk_filter(struct sock *sk, struct sk_buff *skb);
147extern unsigned int sk_run_filter(struct sk_buff *skb,
148 struct sock_filter *filter, int flen);
148extern int sk_attach_filter(struct sock_fprog *fprog, struct sock *sk); 149extern int sk_attach_filter(struct sock_fprog *fprog, struct sock *sk);
149extern int sk_detach_filter(struct sock *sk); 150extern int sk_detach_filter(struct sock *sk);
150extern int sk_chk_filter(struct sock_filter *filter, int flen); 151extern int sk_chk_filter(struct sock_filter *filter, int flen);
diff --git a/include/linux/fs.h b/include/linux/fs.h
index b84b848431f2..0c609e71c379 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -287,9 +287,9 @@ extern int dir_notify_enable;
287#include <linux/pid.h> 287#include <linux/pid.h>
288#include <linux/mutex.h> 288#include <linux/mutex.h>
289#include <linux/capability.h> 289#include <linux/capability.h>
290#include <linux/semaphore.h>
290 291
291#include <asm/atomic.h> 292#include <asm/atomic.h>
292#include <asm/semaphore.h>
293#include <asm/byteorder.h> 293#include <asm/byteorder.h>
294 294
295struct export_operations; 295struct export_operations;
@@ -776,6 +776,9 @@ static inline int ra_has_index(struct file_ra_state *ra, pgoff_t index)
776 index < ra->start + ra->size); 776 index < ra->start + ra->size);
777} 777}
778 778
779#define FILE_MNT_WRITE_TAKEN 1
780#define FILE_MNT_WRITE_RELEASED 2
781
779struct file { 782struct file {
780 /* 783 /*
781 * fu_list becomes invalid after file_free is called and queued via 784 * fu_list becomes invalid after file_free is called and queued via
@@ -810,6 +813,9 @@ struct file {
810 spinlock_t f_ep_lock; 813 spinlock_t f_ep_lock;
811#endif /* #ifdef CONFIG_EPOLL */ 814#endif /* #ifdef CONFIG_EPOLL */
812 struct address_space *f_mapping; 815 struct address_space *f_mapping;
816#ifdef CONFIG_DEBUG_WRITECOUNT
817 unsigned long f_mnt_write_state;
818#endif
813}; 819};
814extern spinlock_t files_lock; 820extern spinlock_t files_lock;
815#define file_list_lock() spin_lock(&files_lock); 821#define file_list_lock() spin_lock(&files_lock);
@@ -818,6 +824,49 @@ extern spinlock_t files_lock;
818#define get_file(x) atomic_inc(&(x)->f_count) 824#define get_file(x) atomic_inc(&(x)->f_count)
819#define file_count(x) atomic_read(&(x)->f_count) 825#define file_count(x) atomic_read(&(x)->f_count)
820 826
827#ifdef CONFIG_DEBUG_WRITECOUNT
828static inline void file_take_write(struct file *f)
829{
830 WARN_ON(f->f_mnt_write_state != 0);
831 f->f_mnt_write_state = FILE_MNT_WRITE_TAKEN;
832}
833static inline void file_release_write(struct file *f)
834{
835 f->f_mnt_write_state |= FILE_MNT_WRITE_RELEASED;
836}
837static inline void file_reset_write(struct file *f)
838{
839 f->f_mnt_write_state = 0;
840}
841static inline void file_check_state(struct file *f)
842{
843 /*
844 * At this point, either both or neither of these bits
845 * should be set.
846 */
847 WARN_ON(f->f_mnt_write_state == FILE_MNT_WRITE_TAKEN);
848 WARN_ON(f->f_mnt_write_state == FILE_MNT_WRITE_RELEASED);
849}
850static inline int file_check_writeable(struct file *f)
851{
852 if (f->f_mnt_write_state == FILE_MNT_WRITE_TAKEN)
853 return 0;
854 printk(KERN_WARNING "writeable file with no "
855 "mnt_want_write()\n");
856 WARN_ON(1);
857 return -EINVAL;
858}
859#else /* !CONFIG_DEBUG_WRITECOUNT */
860static inline void file_take_write(struct file *filp) {}
861static inline void file_release_write(struct file *filp) {}
862static inline void file_reset_write(struct file *filp) {}
863static inline void file_check_state(struct file *filp) {}
864static inline int file_check_writeable(struct file *filp)
865{
866 return 0;
867}
868#endif /* CONFIG_DEBUG_WRITECOUNT */
869
821#define MAX_NON_LFS ((1UL<<31) - 1) 870#define MAX_NON_LFS ((1UL<<31) - 1)
822 871
823/* Page cache limit. The filesystems should put that into their s_maxbytes 872/* Page cache limit. The filesystems should put that into their s_maxbytes
@@ -1735,7 +1784,8 @@ extern struct file *create_read_pipe(struct file *f);
1735extern struct file *create_write_pipe(void); 1784extern struct file *create_write_pipe(void);
1736extern void free_write_pipe(struct file *); 1785extern void free_write_pipe(struct file *);
1737 1786
1738extern int open_namei(int dfd, const char *, int, int, struct nameidata *); 1787extern struct file *do_filp_open(int dfd, const char *pathname,
1788 int open_flag, int mode);
1739extern int may_open(struct nameidata *, int, int); 1789extern int may_open(struct nameidata *, int, int);
1740 1790
1741extern int kernel_read(struct file *, unsigned long, char *, unsigned long); 1791extern int kernel_read(struct file *, unsigned long, char *, unsigned long);
diff --git a/include/linux/fsl_devices.h b/include/linux/fsl_devices.h
index 1831b196c70a..2cad5c67397e 100644
--- a/include/linux/fsl_devices.h
+++ b/include/linux/fsl_devices.h
@@ -50,7 +50,7 @@ struct gianfar_platform_data {
50 u32 device_flags; 50 u32 device_flags;
51 /* board specific information */ 51 /* board specific information */
52 u32 board_flags; 52 u32 board_flags;
53 u32 bus_id; 53 char bus_id[MII_BUS_ID_SIZE];
54 u32 phy_id; 54 u32 phy_id;
55 u8 mac_addr[6]; 55 u8 mac_addr[6];
56 phy_interface_t interface; 56 phy_interface_t interface;
diff --git a/include/linux/hil_mlc.h b/include/linux/hil_mlc.h
index 8df29ca48a13..394a8405dd74 100644
--- a/include/linux/hil_mlc.h
+++ b/include/linux/hil_mlc.h
@@ -34,7 +34,7 @@
34#include <linux/hil.h> 34#include <linux/hil.h>
35#include <linux/time.h> 35#include <linux/time.h>
36#include <linux/interrupt.h> 36#include <linux/interrupt.h>
37#include <asm/semaphore.h> 37#include <linux/semaphore.h>
38#include <linux/serio.h> 38#include <linux/serio.h>
39#include <linux/list.h> 39#include <linux/list.h>
40 40
diff --git a/include/linux/hw_random.h b/include/linux/hw_random.h
index 42131820bb89..85d11916e9ea 100644
--- a/include/linux/hw_random.h
+++ b/include/linux/hw_random.h
@@ -44,15 +44,7 @@ struct hwrng {
44/** Register a new Hardware Random Number Generator driver. */ 44/** Register a new Hardware Random Number Generator driver. */
45extern int hwrng_register(struct hwrng *rng); 45extern int hwrng_register(struct hwrng *rng);
46/** Unregister a Hardware Random Number Generator driver. */ 46/** Unregister a Hardware Random Number Generator driver. */
47extern void __hwrng_unregister(struct hwrng *rng, bool suspended); 47extern void hwrng_unregister(struct hwrng *rng);
48static inline void hwrng_unregister(struct hwrng *rng)
49{
50 __hwrng_unregister(rng, false);
51}
52static inline void hwrng_unregister_suspended(struct hwrng *rng)
53{
54 __hwrng_unregister(rng, true);
55}
56 48
57#endif /* __KERNEL__ */ 49#endif /* __KERNEL__ */
58#endif /* LINUX_HWRANDOM_H_ */ 50#endif /* LINUX_HWRANDOM_H_ */
diff --git a/include/linux/i2c/tps65010.h b/include/linux/i2c/tps65010.h
index 7021635ed6a0..918c5354d9b8 100644
--- a/include/linux/i2c/tps65010.h
+++ b/include/linux/i2c/tps65010.h
@@ -152,5 +152,35 @@ extern int tps65010_config_vregs1(unsigned value);
152 */ 152 */
153extern int tps65013_set_low_pwr(unsigned mode); 153extern int tps65013_set_low_pwr(unsigned mode);
154 154
155
156struct i2c_client;
157
158/**
159 * struct tps65010_board - packages GPIO and LED lines
160 * @base: the GPIO number to assign to GPIO-1
161 * @outmask: bit (N-1) is set to allow GPIO-N to be used as an
162 * (open drain) output
163 * @setup: optional callback issued once the GPIOs are valid
164 * @teardown: optional callback issued before the GPIOs are invalidated
165 * @context: optional parameter passed to setup() and teardown()
166 *
167 * Board data may be used to package the GPIO (and LED) lines for use
168 * in by the generic GPIO and LED frameworks. The first four GPIOs
169 * starting at gpio_base are GPIO1..GPIO4. The next two are LED1/nPG
170 * and LED2 (with hardware blinking capability, not currently exposed).
171 *
172 * The @setup callback may be used with the kind of board-specific glue
173 * which hands the (now-valid) GPIOs to other drivers, or which puts
174 * devices in their initial states using these GPIOs.
175 */
176struct tps65010_board {
177 int base;
178 unsigned outmask;
179
180 int (*setup)(struct i2c_client *client, void *context);
181 int (*teardown)(struct i2c_client *client, void *context);
182 void *context;
183};
184
155#endif /* __LINUX_I2C_TPS65010_H */ 185#endif /* __LINUX_I2C_TPS65010_H */
156 186
diff --git a/include/linux/i2o.h b/include/linux/i2o.h
index 7da5b98d90e6..e92170dda245 100644
--- a/include/linux/i2o.h
+++ b/include/linux/i2o.h
@@ -33,9 +33,9 @@
33#include <linux/mempool.h> 33#include <linux/mempool.h>
34#include <linux/mutex.h> 34#include <linux/mutex.h>
35#include <linux/scatterlist.h> 35#include <linux/scatterlist.h>
36#include <linux/semaphore.h> /* Needed for MUTEX init macros */
36 37
37#include <asm/io.h> 38#include <asm/io.h>
38#include <asm/semaphore.h> /* Needed for MUTEX init macros */
39 39
40/* message queue empty */ 40/* message queue empty */
41#define I2O_QUEUE_EMPTY 0xffffffff 41#define I2O_QUEUE_EMPTY 0xffffffff
diff --git a/include/linux/icmpv6.h b/include/linux/icmpv6.h
index 7c5e9817e998..03067443198a 100644
--- a/include/linux/icmpv6.h
+++ b/include/linux/icmpv6.h
@@ -176,12 +176,21 @@ extern void icmpv6_send(struct sk_buff *skb,
176 __u32 info, 176 __u32 info,
177 struct net_device *dev); 177 struct net_device *dev);
178 178
179extern int icmpv6_init(struct net_proto_family *ops); 179extern int icmpv6_init(void);
180extern int icmpv6_err_convert(int type, int code, 180extern int icmpv6_err_convert(int type, int code,
181 int *err); 181 int *err);
182extern void icmpv6_cleanup(void); 182extern void icmpv6_cleanup(void);
183extern void icmpv6_param_prob(struct sk_buff *skb, 183extern void icmpv6_param_prob(struct sk_buff *skb,
184 int code, int pos); 184 int code, int pos);
185
186struct flowi;
187struct in6_addr;
188extern void icmpv6_flow_init(struct sock *sk,
189 struct flowi *fl,
190 u8 type,
191 const struct in6_addr *saddr,
192 const struct in6_addr *daddr,
193 int oif);
185#endif 194#endif
186 195
187#endif 196#endif
diff --git a/include/linux/ide.h b/include/linux/ide.h
index 6c39482fd1a1..5f3e82ae901a 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -23,7 +23,6 @@
23#include <asm/byteorder.h> 23#include <asm/byteorder.h>
24#include <asm/system.h> 24#include <asm/system.h>
25#include <asm/io.h> 25#include <asm/io.h>
26#include <asm/semaphore.h>
27#include <asm/mutex.h> 26#include <asm/mutex.h>
28 27
29#if defined(CONFIG_CRIS) || defined(CONFIG_FRV) 28#if defined(CONFIG_CRIS) || defined(CONFIG_FRV)
diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h
index f577c8f1c66d..f27d11ab418b 100644
--- a/include/linux/ieee80211.h
+++ b/include/linux/ieee80211.h
@@ -97,6 +97,7 @@
97#define IEEE80211_MAX_FRAME_LEN 2352 97#define IEEE80211_MAX_FRAME_LEN 2352
98 98
99#define IEEE80211_MAX_SSID_LEN 32 99#define IEEE80211_MAX_SSID_LEN 32
100#define IEEE80211_MAX_MESH_ID_LEN 32
100 101
101struct ieee80211_hdr { 102struct ieee80211_hdr {
102 __le16 frame_control; 103 __le16 frame_control;
@@ -109,6 +110,16 @@ struct ieee80211_hdr {
109} __attribute__ ((packed)); 110} __attribute__ ((packed));
110 111
111 112
113struct ieee80211s_hdr {
114 u8 flags;
115 u8 ttl;
116 u8 seqnum[3];
117 u8 eaddr1[6];
118 u8 eaddr2[6];
119 u8 eaddr3[6];
120} __attribute__ ((packed));
121
122
112struct ieee80211_mgmt { 123struct ieee80211_mgmt {
113 __le16 frame_control; 124 __le16 frame_control;
114 __le16 duration; 125 __le16 duration;
@@ -206,6 +217,23 @@ struct ieee80211_mgmt {
206 __le16 params; 217 __le16 params;
207 __le16 reason_code; 218 __le16 reason_code;
208 } __attribute__((packed)) delba; 219 } __attribute__((packed)) delba;
220 struct{
221 u8 action_code;
222 /* capab_info for open and confirm,
223 * reason for close
224 */
225 __le16 aux;
226 /* Followed in plink_confirm by status
227 * code, AID and supported rates,
228 * and directly by supported rates in
229 * plink_open and plink_close
230 */
231 u8 variable[0];
232 } __attribute__((packed)) plink_action;
233 struct{
234 u8 action_code;
235 u8 variable[0];
236 } __attribute__((packed)) mesh_action;
209 } u; 237 } u;
210 } __attribute__ ((packed)) action; 238 } __attribute__ ((packed)) action;
211 } u; 239 } u;
@@ -437,6 +465,13 @@ enum ieee80211_eid {
437 WLAN_EID_TS_DELAY = 43, 465 WLAN_EID_TS_DELAY = 43,
438 WLAN_EID_TCLAS_PROCESSING = 44, 466 WLAN_EID_TCLAS_PROCESSING = 44,
439 WLAN_EID_QOS_CAPA = 46, 467 WLAN_EID_QOS_CAPA = 46,
468 /* 802.11s */
469 WLAN_EID_MESH_CONFIG = 36, /* Pending IEEE 802.11 ANA approval */
470 WLAN_EID_MESH_ID = 37, /* Pending IEEE 802.11 ANA approval */
471 WLAN_EID_PEER_LINK = 40, /* Pending IEEE 802.11 ANA approval */
472 WLAN_EID_PREQ = 53, /* Pending IEEE 802.11 ANA approval */
473 WLAN_EID_PREP = 54, /* Pending IEEE 802.11 ANA approval */
474 WLAN_EID_PERR = 55, /* Pending IEEE 802.11 ANA approval */
440 /* 802.11h */ 475 /* 802.11h */
441 WLAN_EID_PWR_CONSTRAINT = 32, 476 WLAN_EID_PWR_CONSTRAINT = 32,
442 WLAN_EID_PWR_CAPABILITY = 33, 477 WLAN_EID_PWR_CAPABILITY = 33,
diff --git a/include/linux/if_arp.h b/include/linux/if_arp.h
index 296e8e86e91d..4d3401812e6c 100644
--- a/include/linux/if_arp.h
+++ b/include/linux/if_arp.h
@@ -156,6 +156,12 @@ static inline struct arphdr *arp_hdr(const struct sk_buff *skb)
156{ 156{
157 return (struct arphdr *)skb_network_header(skb); 157 return (struct arphdr *)skb_network_header(skb);
158} 158}
159
160static inline int arp_hdr_len(struct net_device *dev)
161{
162 /* ARP header, plus 2 device addresses, plus 2 IP addresses. */
163 return sizeof(struct arphdr) + (dev->addr_len + sizeof(u32)) * 2;
164}
159#endif 165#endif
160 166
161#endif /* _LINUX_IF_ARP_H */ 167#endif /* _LINUX_IF_ARP_H */
diff --git a/include/linux/if_pppox.h b/include/linux/if_pppox.h
index 40743e032845..6fb7f1788570 100644
--- a/include/linux/if_pppox.h
+++ b/include/linux/if_pppox.h
@@ -24,7 +24,6 @@
24#include <linux/if_ether.h> 24#include <linux/if_ether.h>
25#include <linux/if.h> 25#include <linux/if.h>
26#include <linux/netdevice.h> 26#include <linux/netdevice.h>
27#include <asm/semaphore.h>
28#include <linux/ppp_channel.h> 27#include <linux/ppp_channel.h>
29#endif /* __KERNEL__ */ 28#endif /* __KERNEL__ */
30#include <linux/if_pppol2tp.h> 29#include <linux/if_pppol2tp.h>
diff --git a/include/linux/if_tunnel.h b/include/linux/if_tunnel.h
index 228eb4eb3129..f1fbe9c930d7 100644
--- a/include/linux/if_tunnel.h
+++ b/include/linux/if_tunnel.h
@@ -7,6 +7,10 @@
7#define SIOCADDTUNNEL (SIOCDEVPRIVATE + 1) 7#define SIOCADDTUNNEL (SIOCDEVPRIVATE + 1)
8#define SIOCDELTUNNEL (SIOCDEVPRIVATE + 2) 8#define SIOCDELTUNNEL (SIOCDEVPRIVATE + 2)
9#define SIOCCHGTUNNEL (SIOCDEVPRIVATE + 3) 9#define SIOCCHGTUNNEL (SIOCDEVPRIVATE + 3)
10#define SIOCGETPRL (SIOCDEVPRIVATE + 4)
11#define SIOCADDPRL (SIOCDEVPRIVATE + 5)
12#define SIOCDELPRL (SIOCDEVPRIVATE + 6)
13#define SIOCCHGPRL (SIOCDEVPRIVATE + 7)
10 14
11#define GRE_CSUM __constant_htons(0x8000) 15#define GRE_CSUM __constant_htons(0x8000)
12#define GRE_ROUTING __constant_htons(0x4000) 16#define GRE_ROUTING __constant_htons(0x4000)
@@ -17,9 +21,6 @@
17#define GRE_FLAGS __constant_htons(0x00F8) 21#define GRE_FLAGS __constant_htons(0x00F8)
18#define GRE_VERSION __constant_htons(0x0007) 22#define GRE_VERSION __constant_htons(0x0007)
19 23
20/* i_flags values for SIT mode */
21#define SIT_ISATAP 0x0001
22
23struct ip_tunnel_parm 24struct ip_tunnel_parm
24{ 25{
25 char name[IFNAMSIZ]; 26 char name[IFNAMSIZ];
@@ -31,4 +32,19 @@ struct ip_tunnel_parm
31 struct iphdr iph; 32 struct iphdr iph;
32}; 33};
33 34
35/* SIT-mode i_flags */
36#define SIT_ISATAP 0x0001
37
38struct ip_tunnel_prl {
39 __be32 addr;
40 __u16 flags;
41 __u16 __reserved;
42 __u32 datalen;
43 __u32 __reserved2;
44 void __user *data;
45};
46
47/* PRL flags */
48#define PRL_DEFAULT 0x0001
49
34#endif /* _IF_TUNNEL_H_ */ 50#endif /* _IF_TUNNEL_H_ */
diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h
index 79504b22a932..15ace02b7b24 100644
--- a/include/linux/if_vlan.h
+++ b/include/linux/if_vlan.h
@@ -81,7 +81,9 @@ extern void vlan_ioctl_set(int (*hook)(struct net *, void __user *));
81#define VLAN_GROUP_ARRAY_PART_LEN (VLAN_GROUP_ARRAY_LEN/VLAN_GROUP_ARRAY_SPLIT_PARTS) 81#define VLAN_GROUP_ARRAY_PART_LEN (VLAN_GROUP_ARRAY_LEN/VLAN_GROUP_ARRAY_SPLIT_PARTS)
82 82
83struct vlan_group { 83struct vlan_group {
84 int real_dev_ifindex; /* The ifindex of the ethernet(like) device the vlan is attached to. */ 84 struct net_device *real_dev; /* The ethernet(like) device
85 * the vlan is attached to.
86 */
85 unsigned int nr_vlans; 87 unsigned int nr_vlans;
86 struct hlist_node hlist; /* linked list */ 88 struct hlist_node hlist; /* linked list */
87 struct net_device **vlan_devices_arrays[VLAN_GROUP_ARRAY_SPLIT_PARTS]; 89 struct net_device **vlan_devices_arrays[VLAN_GROUP_ARRAY_SPLIT_PARTS];
@@ -93,7 +95,7 @@ static inline struct net_device *vlan_group_get_device(struct vlan_group *vg,
93{ 95{
94 struct net_device **array; 96 struct net_device **array;
95 array = vg->vlan_devices_arrays[vlan_id / VLAN_GROUP_ARRAY_PART_LEN]; 97 array = vg->vlan_devices_arrays[vlan_id / VLAN_GROUP_ARRAY_PART_LEN];
96 return array[vlan_id % VLAN_GROUP_ARRAY_PART_LEN]; 98 return array ? array[vlan_id % VLAN_GROUP_ARRAY_PART_LEN] : NULL;
97} 99}
98 100
99static inline void vlan_group_set_device(struct vlan_group *vg, 101static inline void vlan_group_set_device(struct vlan_group *vg,
diff --git a/include/linux/if_wanpipe.h b/include/linux/if_wanpipe.h
deleted file mode 100644
index e594ca6069e5..000000000000
--- a/include/linux/if_wanpipe.h
+++ /dev/null
@@ -1,124 +0,0 @@
1/*****************************************************************************
2* if_wanpipe.h Header file for the Sangoma AF_WANPIPE Socket
3*
4* Author: Nenad Corbic
5*
6* Copyright: (c) 2000 Sangoma Technologies Inc.
7*
8* This program is free software; you can redistribute it and/or
9* modify it under the terms of the GNU General Public License
10* as published by the Free Software Foundation; either version
11* 2 of the License, or (at your option) any later version.
12* ============================================================================
13*
14* Jan 28, 2000 Nenad Corbic Initial Version
15*
16*****************************************************************************/
17
18#ifndef __LINUX_IF_WAN_PACKET_H
19#define __LINUX_IF_WAN_PACKET_H
20
21struct wan_sockaddr_ll
22{
23 unsigned short sll_family;
24 unsigned short sll_protocol;
25 int sll_ifindex;
26 unsigned short sll_hatype;
27 unsigned char sll_pkttype;
28 unsigned char sll_halen;
29 unsigned char sll_addr[8];
30 unsigned char sll_device[14];
31 unsigned char sll_card[14];
32};
33
34typedef struct
35{
36 unsigned char free;
37 unsigned char state_sk;
38 int rcvbuf;
39 int sndbuf;
40 int rmem;
41 int wmem;
42 int sk_count;
43 unsigned char bound;
44 char name[14];
45 unsigned char d_state;
46 unsigned char svc;
47 unsigned short lcn;
48 unsigned char mbox;
49 unsigned char cmd_busy;
50 unsigned char command;
51 unsigned poll;
52 unsigned poll_cnt;
53 int rblock;
54} wan_debug_hdr_t;
55
56#define MAX_NUM_DEBUG 10
57#define X25_PROT 0x16
58#define PVC_PROT 0x17
59
60typedef struct
61{
62 wan_debug_hdr_t debug[MAX_NUM_DEBUG];
63}wan_debug_t;
64
65#define SIOC_WANPIPE_GET_CALL_DATA (SIOCPROTOPRIVATE + 0)
66#define SIOC_WANPIPE_SET_CALL_DATA (SIOCPROTOPRIVATE + 1)
67#define SIOC_WANPIPE_ACCEPT_CALL (SIOCPROTOPRIVATE + 2)
68#define SIOC_WANPIPE_CLEAR_CALL (SIOCPROTOPRIVATE + 3)
69#define SIOC_WANPIPE_RESET_CALL (SIOCPROTOPRIVATE + 4)
70#define SIOC_WANPIPE_DEBUG (SIOCPROTOPRIVATE + 5)
71#define SIOC_WANPIPE_SET_NONBLOCK (SIOCPROTOPRIVATE + 6)
72#define SIOC_WANPIPE_CHECK_TX (SIOCPROTOPRIVATE + 7)
73#define SIOC_WANPIPE_SOCK_STATE (SIOCPROTOPRIVATE + 8)
74
75/* Packet types */
76
77#define WAN_PACKET_HOST 0 /* To us */
78#define WAN_PACKET_BROADCAST 1 /* To all */
79#define WAN_PACKET_MULTICAST 2 /* To group */
80#define WAN_PACKET_OTHERHOST 3 /* To someone else */
81#define WAN_PACKET_OUTGOING 4 /* Outgoing of any type */
82/* These ones are invisible by user level */
83#define WAN_PACKET_LOOPBACK 5 /* MC/BRD frame looped back */
84#define WAN_PACKET_FASTROUTE 6 /* Fastrouted frame */
85
86
87/* X25 specific */
88#define WAN_PACKET_DATA 7
89#define WAN_PACKET_CMD 8
90#define WAN_PACKET_ASYNC 9
91#define WAN_PACKET_ERR 10
92
93/* Packet socket options */
94
95#define WAN_PACKET_ADD_MEMBERSHIP 1
96#define WAN_PACKET_DROP_MEMBERSHIP 2
97
98#define WAN_PACKET_MR_MULTICAST 0
99#define WAN_PACKET_MR_PROMISC 1
100#define WAN_PACKET_MR_ALLMULTI 2
101
102#ifdef __KERNEL__
103
104/* Private wanpipe socket structures. */
105struct wanpipe_opt
106{
107 void *mbox; /* Mail box */
108 void *card; /* Card bouded to */
109 struct net_device *dev; /* Bounded device */
110 unsigned short lcn; /* Binded LCN */
111 unsigned char svc; /* 0=pvc, 1=svc */
112 unsigned char timer; /* flag for delayed transmit*/
113 struct timer_list tx_timer;
114 unsigned poll_cnt;
115 unsigned char force; /* Used to force sock release */
116 atomic_t packet_sent;
117 unsigned short num;
118};
119
120#define wp_sk(__sk) ((struct wanpipe_opt *)(__sk)->sk_protinfo)
121
122#endif
123
124#endif
diff --git a/include/linux/igmp.h b/include/linux/igmp.h
index f510e7e382a8..f5a1a0db2e8e 100644
--- a/include/linux/igmp.h
+++ b/include/linux/igmp.h
@@ -80,27 +80,6 @@ struct igmpv3_query {
80 __be32 srcs[0]; 80 __be32 srcs[0];
81}; 81};
82 82
83#ifdef __KERNEL__
84#include <linux/skbuff.h>
85
86static inline struct igmphdr *igmp_hdr(const struct sk_buff *skb)
87{
88 return (struct igmphdr *)skb_transport_header(skb);
89}
90
91static inline struct igmpv3_report *
92 igmpv3_report_hdr(const struct sk_buff *skb)
93{
94 return (struct igmpv3_report *)skb_transport_header(skb);
95}
96
97static inline struct igmpv3_query *
98 igmpv3_query_hdr(const struct sk_buff *skb)
99{
100 return (struct igmpv3_query *)skb_transport_header(skb);
101}
102#endif
103
104#define IGMP_HOST_MEMBERSHIP_QUERY 0x11 /* From RFC1112 */ 83#define IGMP_HOST_MEMBERSHIP_QUERY 0x11 /* From RFC1112 */
105#define IGMP_HOST_MEMBERSHIP_REPORT 0x12 /* Ditto */ 84#define IGMP_HOST_MEMBERSHIP_REPORT 0x12 /* Ditto */
106#define IGMP_DVMRP 0x13 /* DVMRP routing */ 85#define IGMP_DVMRP 0x13 /* DVMRP routing */
@@ -151,6 +130,23 @@ static inline struct igmpv3_query *
151#include <linux/timer.h> 130#include <linux/timer.h>
152#include <linux/in.h> 131#include <linux/in.h>
153 132
133static inline struct igmphdr *igmp_hdr(const struct sk_buff *skb)
134{
135 return (struct igmphdr *)skb_transport_header(skb);
136}
137
138static inline struct igmpv3_report *
139 igmpv3_report_hdr(const struct sk_buff *skb)
140{
141 return (struct igmpv3_report *)skb_transport_header(skb);
142}
143
144static inline struct igmpv3_query *
145 igmpv3_query_hdr(const struct sk_buff *skb)
146{
147 return (struct igmpv3_query *)skb_transport_header(skb);
148}
149
154extern int sysctl_igmp_max_memberships; 150extern int sysctl_igmp_max_memberships;
155extern int sysctl_igmp_max_msf; 151extern int sysctl_igmp_max_msf;
156 152
diff --git a/include/linux/in6.h b/include/linux/in6.h
index 2a61c82af115..bc492048c349 100644
--- a/include/linux/in6.h
+++ b/include/linux/in6.h
@@ -48,6 +48,14 @@ extern const struct in6_addr in6addr_any;
48#define IN6ADDR_ANY_INIT { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } } } 48#define IN6ADDR_ANY_INIT { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } } }
49extern const struct in6_addr in6addr_loopback; 49extern const struct in6_addr in6addr_loopback;
50#define IN6ADDR_LOOPBACK_INIT { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 } } } 50#define IN6ADDR_LOOPBACK_INIT { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 } } }
51#ifdef __KERNEL__
52extern const struct in6_addr in6addr_linklocal_allnodes;
53#define IN6ADDR_LINKLOCAL_ALLNODES_INIT \
54 { { { 0xff,2,0,0,0,0,0,0,0,0,0,0,0,0,0,1 } } }
55extern const struct in6_addr in6addr_linklocal_allrouters;
56#define IN6ADDR_LINKLOCAL_ALLROUTERS_INIT \
57 { { { 0xff,2,0,0,0,0,0,0,0,0,0,0,0,0,0,2 } } }
58#endif
51 59
52struct sockaddr_in6 { 60struct sockaddr_in6 {
53 unsigned short int sin6_family; /* AF_INET6 */ 61 unsigned short int sin6_family; /* AF_INET6 */
@@ -249,4 +257,30 @@ struct in6_flowlabel_req
249 * IP6T_SO_GET_REVISION_TARGET 69 257 * IP6T_SO_GET_REVISION_TARGET 69
250 */ 258 */
251 259
260/* RFC5014: Source address selection */
261#define IPV6_ADDR_PREFERENCES 72
262
263#define IPV6_PREFER_SRC_TMP 0x0001
264#define IPV6_PREFER_SRC_PUBLIC 0x0002
265#define IPV6_PREFER_SRC_PUBTMP_DEFAULT 0x0100
266#define IPV6_PREFER_SRC_COA 0x0004
267#define IPV6_PREFER_SRC_HOME 0x0400
268#define IPV6_PREFER_SRC_CGA 0x0008
269#define IPV6_PREFER_SRC_NONCGA 0x0800
270
271/*
272 * Multicast Routing:
273 * see include/linux/mroute6.h.
274 *
275 * MRT6_INIT 200
276 * MRT6_DONE 201
277 * MRT6_ADD_MIF 202
278 * MRT6_DEL_MIF 203
279 * MRT6_ADD_MFC 204
280 * MRT6_DEL_MFC 205
281 * MRT6_VERSION 206
282 * MRT6_ASSERT 207
283 * MRT6_PIM 208
284 * (reserved) 209
285 */
252#endif 286#endif
diff --git a/include/linux/inetdevice.h b/include/linux/inetdevice.h
index fc4e3db649e8..7009b0cdd06f 100644
--- a/include/linux/inetdevice.h
+++ b/include/linux/inetdevice.h
@@ -70,13 +70,13 @@ static inline void ipv4_devconf_setall(struct in_device *in_dev)
70 ipv4_devconf_set((in_dev), NET_IPV4_CONF_ ## attr, (val)) 70 ipv4_devconf_set((in_dev), NET_IPV4_CONF_ ## attr, (val))
71 71
72#define IN_DEV_ANDCONF(in_dev, attr) \ 72#define IN_DEV_ANDCONF(in_dev, attr) \
73 (IPV4_DEVCONF_ALL(in_dev->dev->nd_net, attr) && \ 73 (IPV4_DEVCONF_ALL(dev_net(in_dev->dev), attr) && \
74 IN_DEV_CONF_GET((in_dev), attr)) 74 IN_DEV_CONF_GET((in_dev), attr))
75#define IN_DEV_ORCONF(in_dev, attr) \ 75#define IN_DEV_ORCONF(in_dev, attr) \
76 (IPV4_DEVCONF_ALL(in_dev->dev->nd_net, attr) || \ 76 (IPV4_DEVCONF_ALL(dev_net(in_dev->dev), attr) || \
77 IN_DEV_CONF_GET((in_dev), attr)) 77 IN_DEV_CONF_GET((in_dev), attr))
78#define IN_DEV_MAXCONF(in_dev, attr) \ 78#define IN_DEV_MAXCONF(in_dev, attr) \
79 (max(IPV4_DEVCONF_ALL(in_dev->dev->nd_net, attr), \ 79 (max(IPV4_DEVCONF_ALL(dev_net(in_dev->dev), attr), \
80 IN_DEV_CONF_GET((in_dev), attr))) 80 IN_DEV_CONF_GET((in_dev), attr)))
81 81
82#define IN_DEV_FORWARD(in_dev) IN_DEV_CONF_GET((in_dev), FORWARDING) 82#define IN_DEV_FORWARD(in_dev) IN_DEV_CONF_GET((in_dev), FORWARDING)
@@ -129,7 +129,7 @@ extern int unregister_inetaddr_notifier(struct notifier_block *nb);
129 129
130extern struct net_device *ip_dev_find(struct net *net, __be32 addr); 130extern struct net_device *ip_dev_find(struct net *net, __be32 addr);
131extern int inet_addr_onlink(struct in_device *in_dev, __be32 a, __be32 b); 131extern int inet_addr_onlink(struct in_device *in_dev, __be32 a, __be32 b);
132extern int devinet_ioctl(unsigned int cmd, void __user *); 132extern int devinet_ioctl(struct net *net, unsigned int cmd, void __user *);
133extern void devinet_init(void); 133extern void devinet_init(void);
134extern struct in_device *inetdev_by_index(struct net *, int); 134extern struct in_device *inetdev_by_index(struct net *, int);
135extern __be32 inet_select_addr(const struct net_device *dev, __be32 dst, int scope); 135extern __be32 inet_select_addr(const struct net_device *dev, __be32 dst, int scope);
diff --git a/include/linux/init_task.h b/include/linux/init_task.h
index 1f74e1d7415f..37a6f5bc4a92 100644
--- a/include/linux/init_task.h
+++ b/include/linux/init_task.h
@@ -151,6 +151,9 @@ extern struct group_info init_groups;
151 .cpus_allowed = CPU_MASK_ALL, \ 151 .cpus_allowed = CPU_MASK_ALL, \
152 .mm = NULL, \ 152 .mm = NULL, \
153 .active_mm = &init_mm, \ 153 .active_mm = &init_mm, \
154 .se = { \
155 .group_node = LIST_HEAD_INIT(tsk.se.group_node), \
156 }, \
154 .rt = { \ 157 .rt = { \
155 .run_list = LIST_HEAD_INIT(tsk.rt.run_list), \ 158 .run_list = LIST_HEAD_INIT(tsk.rt.run_list), \
156 .time_slice = HZ, \ 159 .time_slice = HZ, \
diff --git a/include/linux/ioport.h b/include/linux/ioport.h
index 605d237364d2..d5d40a9f7929 100644
--- a/include/linux/ioport.h
+++ b/include/linux/ioport.h
@@ -44,7 +44,9 @@ struct resource_list {
44#define IORESOURCE_CACHEABLE 0x00004000 44#define IORESOURCE_CACHEABLE 0x00004000
45#define IORESOURCE_RANGELENGTH 0x00008000 45#define IORESOURCE_RANGELENGTH 0x00008000
46#define IORESOURCE_SHADOWABLE 0x00010000 46#define IORESOURCE_SHADOWABLE 0x00010000
47#define IORESOURCE_BUS_HAS_VGA 0x00080000 47
48#define IORESOURCE_SIZEALIGN 0x00020000 /* size indicates alignment */
49#define IORESOURCE_STARTALIGN 0x00040000 /* start field is alignment */
48 50
49#define IORESOURCE_DISABLED 0x10000000 51#define IORESOURCE_DISABLED 0x10000000
50#define IORESOURCE_UNSET 0x20000000 52#define IORESOURCE_UNSET 0x20000000
@@ -110,6 +112,7 @@ extern int allocate_resource(struct resource *root, struct resource *new,
110 void *alignf_data); 112 void *alignf_data);
111int adjust_resource(struct resource *res, resource_size_t start, 113int adjust_resource(struct resource *res, resource_size_t start,
112 resource_size_t size); 114 resource_size_t size);
115resource_size_t resource_alignment(struct resource *res);
113 116
114/* Convenience shorthand with allocation */ 117/* Convenience shorthand with allocation */
115#define request_region(start,n,name) __request_region(&ioport_resource, (start), (n), (name)) 118#define request_region(start,n,name) __request_region(&ioport_resource, (start), (n), (name))
diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h
index 134c8e5cf07c..10b666b61add 100644
--- a/include/linux/ipv6.h
+++ b/include/linux/ipv6.h
@@ -160,6 +160,9 @@ struct ipv6_devconf {
160#ifdef CONFIG_IPV6_OPTIMISTIC_DAD 160#ifdef CONFIG_IPV6_OPTIMISTIC_DAD
161 __s32 optimistic_dad; 161 __s32 optimistic_dad;
162#endif 162#endif
163#ifdef CONFIG_IPV6_MROUTE
164 __s32 mc_forwarding;
165#endif
163 void *sysctl; 166 void *sysctl;
164}; 167};
165 168
@@ -190,6 +193,7 @@ enum {
190 DEVCONF_PROXY_NDP, 193 DEVCONF_PROXY_NDP,
191 DEVCONF_OPTIMISTIC_DAD, 194 DEVCONF_OPTIMISTIC_DAD,
192 DEVCONF_ACCEPT_SOURCE_ROUTE, 195 DEVCONF_ACCEPT_SOURCE_ROUTE,
196 DEVCONF_MC_FORWARDING,
193 DEVCONF_MAX 197 DEVCONF_MAX
194}; 198};
195 199
@@ -230,6 +234,7 @@ struct inet6_skb_parm {
230#endif 234#endif
231 235
232#define IP6SKB_XFRM_TRANSFORMED 1 236#define IP6SKB_XFRM_TRANSFORMED 1
237#define IP6SKB_FORWARDED 2
233}; 238};
234 239
235#define IP6CB(skb) ((struct inet6_skb_parm*)((skb)->cb)) 240#define IP6CB(skb) ((struct inet6_skb_parm*)((skb)->cb))
@@ -274,8 +279,29 @@ struct ipv6_pinfo {
274 279
275 __be32 flow_label; 280 __be32 flow_label;
276 __u32 frag_size; 281 __u32 frag_size;
277 __s16 hop_limit; 282
278 __s16 mcast_hops; 283 /*
284 * Packed in 16bits.
285 * Omit one shift by by putting the signed field at MSB.
286 */
287#if defined(__BIG_ENDIAN_BITFIELD)
288 __s16 hop_limit:9;
289 __u16 __unused_1:7;
290#else
291 __u16 __unused_1:7;
292 __s16 hop_limit:9;
293#endif
294
295#if defined(__BIG_ENDIAN_BITFIELD)
296 /* Packed in 16bits. */
297 __s16 mcast_hops:9;
298 __u16 __unused_2:6,
299 mc_loop:1;
300#else
301 __u16 mc_loop:1,
302 __unused_2:6;
303 __s16 mcast_hops:9;
304#endif
279 int mcast_oif; 305 int mcast_oif;
280 306
281 /* pktoption flags */ 307 /* pktoption flags */
@@ -298,11 +324,14 @@ struct ipv6_pinfo {
298 } rxopt; 324 } rxopt;
299 325
300 /* sockopt flags */ 326 /* sockopt flags */
301 __u8 mc_loop:1, 327 __u8 recverr:1,
302 recverr:1,
303 sndflow:1, 328 sndflow:1,
304 pmtudisc:2, 329 pmtudisc:2,
305 ipv6only:1; 330 ipv6only:1,
331 srcprefs:3; /* 001: prefer temporary address
332 * 010: prefer public address
333 * 100: prefer care-of address
334 */
306 __u8 tclass; 335 __u8 tclass;
307 336
308 __u32 dst_cookie; 337 __u32 dst_cookie;
@@ -315,9 +344,8 @@ struct ipv6_pinfo {
315 struct sk_buff *pktoptions; 344 struct sk_buff *pktoptions;
316 struct { 345 struct {
317 struct ipv6_txoptions *opt; 346 struct ipv6_txoptions *opt;
318 struct rt6_info *rt; 347 u8 hop_limit;
319 int hop_limit; 348 u8 tclass;
320 int tclass;
321 } cork; 349 } cork;
322}; 350};
323 351
@@ -458,7 +486,7 @@ static inline struct raw6_sock *raw6_sk(const struct sock *sk)
458#endif /* defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) */ 486#endif /* defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) */
459 487
460#define INET6_MATCH(__sk, __net, __hash, __saddr, __daddr, __ports, __dif)\ 488#define INET6_MATCH(__sk, __net, __hash, __saddr, __daddr, __ports, __dif)\
461 (((__sk)->sk_hash == (__hash)) && ((__sk)->sk_net == (__net)) && \ 489 (((__sk)->sk_hash == (__hash)) && sock_net((__sk)) == (__net) && \
462 ((*((__portpair *)&(inet_sk(__sk)->dport))) == (__ports)) && \ 490 ((*((__portpair *)&(inet_sk(__sk)->dport))) == (__ports)) && \
463 ((__sk)->sk_family == AF_INET6) && \ 491 ((__sk)->sk_family == AF_INET6) && \
464 ipv6_addr_equal(&inet6_sk(__sk)->daddr, (__saddr)) && \ 492 ipv6_addr_equal(&inet6_sk(__sk)->daddr, (__saddr)) && \
@@ -466,7 +494,7 @@ static inline struct raw6_sock *raw6_sk(const struct sock *sk)
466 (!((__sk)->sk_bound_dev_if) || ((__sk)->sk_bound_dev_if == (__dif)))) 494 (!((__sk)->sk_bound_dev_if) || ((__sk)->sk_bound_dev_if == (__dif))))
467 495
468#define INET6_TW_MATCH(__sk, __net, __hash, __saddr, __daddr, __ports, __dif) \ 496#define INET6_TW_MATCH(__sk, __net, __hash, __saddr, __daddr, __ports, __dif) \
469 (((__sk)->sk_hash == (__hash)) && ((__sk)->sk_net == (__net)) && \ 497 (((__sk)->sk_hash == (__hash)) && sock_net((__sk)) == (__net) && \
470 (*((__portpair *)&(inet_twsk(__sk)->tw_dport)) == (__ports)) && \ 498 (*((__portpair *)&(inet_twsk(__sk)->tw_dport)) == (__ports)) && \
471 ((__sk)->sk_family == PF_INET6) && \ 499 ((__sk)->sk_family == PF_INET6) && \
472 (ipv6_addr_equal(&inet6_twsk(__sk)->tw_v6_daddr, (__saddr))) && \ 500 (ipv6_addr_equal(&inet6_twsk(__sk)->tw_v6_daddr, (__saddr))) && \
diff --git a/include/linux/irqflags.h b/include/linux/irqflags.h
index 412e025bc5c7..e600c4e9b8c5 100644
--- a/include/linux/irqflags.h
+++ b/include/linux/irqflags.h
@@ -84,10 +84,10 @@
84 84
85#define irqs_disabled() \ 85#define irqs_disabled() \
86({ \ 86({ \
87 unsigned long flags; \ 87 unsigned long _flags; \
88 \ 88 \
89 raw_local_save_flags(flags); \ 89 raw_local_save_flags(_flags); \
90 raw_irqs_disabled_flags(flags); \ 90 raw_irqs_disabled_flags(_flags); \
91}) 91})
92 92
93#define irqs_disabled_flags(flags) raw_irqs_disabled_flags(flags) 93#define irqs_disabled_flags(flags) raw_irqs_disabled_flags(flags)
diff --git a/include/linux/iscsi_ibft.h b/include/linux/iscsi_ibft.h
new file mode 100644
index 000000000000..6092487e2950
--- /dev/null
+++ b/include/linux/iscsi_ibft.h
@@ -0,0 +1,50 @@
1/*
2 * Copyright 2007 Red Hat, Inc.
3 * by Peter Jones <pjones@redhat.com>
4 * Copyright 2007 IBM, Inc.
5 * by Konrad Rzeszutek <konradr@linux.vnet.ibm.com>
6 * Copyright 2008
7 * by Konrad Rzeszutek <ketuzsezr@darnok.org>
8 *
9 * This code exposes the iSCSI Boot Format Table to userland via sysfs.
10 *
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License v2.0 as published by
13 * the Free Software Foundation
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 */
20
21#ifndef ISCSI_IBFT_H
22#define ISCSI_IBFT_H
23
24struct ibft_table_header {
25 char signature[4];
26 u32 length;
27 u8 revision;
28 u8 checksum;
29 char oem_id[6];
30 char oem_table_id[8];
31 char reserved[24];
32} __attribute__((__packed__));
33
34/*
35 * Logical location of iSCSI Boot Format Table.
36 * If the value is NULL there is no iBFT on the machine.
37 */
38extern struct ibft_table_header *ibft_addr;
39
40/*
41 * Routine used to find and reserve the iSCSI Boot Format Table. The
42 * mapped address is set in the ibft_addr variable.
43 */
44#ifdef CONFIG_ISCSI_IBFT_FIND
45extern void __init reserve_ibft_region(void);
46#else
47static inline void reserve_ibft_region(void) { }
48#endif
49
50#endif /* ISCSI_IBFT_H */
diff --git a/include/linux/isdn.h b/include/linux/isdn.h
index 9cb2855bb170..44cd663c53b6 100644
--- a/include/linux/isdn.h
+++ b/include/linux/isdn.h
@@ -16,14 +16,8 @@
16 16
17#include <linux/ioctl.h> 17#include <linux/ioctl.h>
18 18
19#ifdef CONFIG_COBALT_MICRO_SERVER
20/* Save memory */
21#define ISDN_MAX_DRIVERS 2
22#define ISDN_MAX_CHANNELS 8
23#else
24#define ISDN_MAX_DRIVERS 32 19#define ISDN_MAX_DRIVERS 32
25#define ISDN_MAX_CHANNELS 64 20#define ISDN_MAX_CHANNELS 64
26#endif
27 21
28/* New ioctl-codes */ 22/* New ioctl-codes */
29#define IIOCNETAIF _IO('I',1) 23#define IIOCNETAIF _IO('I',1)
diff --git a/include/linux/jbd.h b/include/linux/jbd.h
index 423f58272188..07a9b52a2654 100644
--- a/include/linux/jbd.h
+++ b/include/linux/jbd.h
@@ -32,8 +32,6 @@
32#include <linux/timer.h> 32#include <linux/timer.h>
33#include <linux/lockdep.h> 33#include <linux/lockdep.h>
34 34
35#include <asm/semaphore.h>
36
37#define journal_oom_retry 1 35#define journal_oom_retry 1
38 36
39/* 37/*
diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h
index 2cbf6fdb1799..05e2b307161a 100644
--- a/include/linux/jbd2.h
+++ b/include/linux/jbd2.h
@@ -30,8 +30,6 @@
30#include <linux/bit_spinlock.h> 30#include <linux/bit_spinlock.h>
31#include <linux/mutex.h> 31#include <linux/mutex.h>
32#include <linux/timer.h> 32#include <linux/timer.h>
33
34#include <asm/semaphore.h>
35#endif 33#endif
36 34
37#define journal_oom_retry 1 35#define journal_oom_retry 1
diff --git a/include/linux/jiffies.h b/include/linux/jiffies.h
index e0b5b684d83f..33ef710dac24 100644
--- a/include/linux/jiffies.h
+++ b/include/linux/jiffies.h
@@ -36,7 +36,7 @@
36#elif HZ >= 6144 && HZ < 12288 36#elif HZ >= 6144 && HZ < 12288
37# define SHIFT_HZ 13 37# define SHIFT_HZ 13
38#else 38#else
39# error You lose. 39# error Invalid value of HZ.
40#endif 40#endif
41 41
42/* LATCH is used in the interval timer and ftape setup. */ 42/* LATCH is used in the interval timer and ftape setup. */
@@ -135,6 +135,22 @@ static inline u64 get_jiffies_64(void)
135#define time_before_eq64(a,b) time_after_eq64(b,a) 135#define time_before_eq64(a,b) time_after_eq64(b,a)
136 136
137/* 137/*
138 * These four macros compare jiffies and 'a' for convenience.
139 */
140
141/* time_is_before_jiffies(a) return true if a is before jiffies */
142#define time_is_before_jiffies(a) time_after(jiffies, a)
143
144/* time_is_after_jiffies(a) return true if a is after jiffies */
145#define time_is_after_jiffies(a) time_before(jiffies, a)
146
147/* time_is_before_eq_jiffies(a) return true if a is before or equal to jiffies*/
148#define time_is_before_eq_jiffies(a) time_after_eq(jiffies, a)
149
150/* time_is_after_eq_jiffies(a) return true if a is after or equal to jiffies*/
151#define time_is_after_eq_jiffies(a) time_before_eq(jiffies, a)
152
153/*
138 * Have the 32 bit jiffies value wrap 5 minutes after boot 154 * Have the 32 bit jiffies value wrap 5 minutes after boot
139 * so jiffies wrap bugs show up earlier. 155 * so jiffies wrap bugs show up earlier.
140 */ 156 */
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index 2df44e773270..cd6d02cf854d 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -293,10 +293,8 @@ extern void print_hex_dump_bytes(const char *prefix_str, int prefix_type,
293#define pr_debug(fmt, arg...) \ 293#define pr_debug(fmt, arg...) \
294 printk(KERN_DEBUG fmt, ##arg) 294 printk(KERN_DEBUG fmt, ##arg)
295#else 295#else
296static inline int __attribute__ ((format (printf, 1, 2))) pr_debug(const char * fmt, ...) 296#define pr_debug(fmt, arg...) \
297{ 297 ({ if (0) printk(KERN_DEBUG fmt, ##arg); 0; })
298 return 0;
299}
300#endif 298#endif
301 299
302/* 300/*
diff --git a/include/linux/kernelcapi.h b/include/linux/kernelcapi.h
index 8c4350a9ed87..a53e932f80fb 100644
--- a/include/linux/kernelcapi.h
+++ b/include/linux/kernelcapi.h
@@ -48,7 +48,6 @@ typedef struct kcapi_carddef {
48#include <linux/list.h> 48#include <linux/list.h>
49#include <linux/skbuff.h> 49#include <linux/skbuff.h>
50#include <linux/workqueue.h> 50#include <linux/workqueue.h>
51#include <asm/semaphore.h>
52 51
53#define KCI_CONTRUP 0 /* arg: struct capi_profile */ 52#define KCI_CONTRUP 0 /* arg: struct capi_profile */
54#define KCI_CONTRDOWN 1 /* arg: NULL */ 53#define KCI_CONTRDOWN 1 /* arg: NULL */
diff --git a/include/linux/ktime.h b/include/linux/ktime.h
index 2cd7fa73d1af..ce5983225be4 100644
--- a/include/linux/ktime.h
+++ b/include/linux/ktime.h
@@ -327,4 +327,10 @@ extern void ktime_get_ts(struct timespec *ts);
327/* Get the real (wall-) time in timespec format: */ 327/* Get the real (wall-) time in timespec format: */
328#define ktime_get_real_ts(ts) getnstimeofday(ts) 328#define ktime_get_real_ts(ts) getnstimeofday(ts)
329 329
330static inline ktime_t ns_to_ktime(u64 ns)
331{
332 static const ktime_t ktime_zero = { .tv64 = 0 };
333 return ktime_add_ns(ktime_zero, ns);
334}
335
330#endif 336#endif
diff --git a/include/linux/leds.h b/include/linux/leds.h
index 0201f6f51cea..b07e3d400bd6 100644
--- a/include/linux/leds.h
+++ b/include/linux/leds.h
@@ -59,15 +59,7 @@ struct led_classdev {
59 59
60extern int led_classdev_register(struct device *parent, 60extern int led_classdev_register(struct device *parent,
61 struct led_classdev *led_cdev); 61 struct led_classdev *led_cdev);
62extern void __led_classdev_unregister(struct led_classdev *led_cdev, bool sus); 62extern void led_classdev_unregister(struct led_classdev *lcd);
63static inline void led_classdev_unregister(struct led_classdev *lcd)
64{
65 __led_classdev_unregister(lcd, false);
66}
67static inline void led_classdev_unregister_suspended(struct led_classdev *lcd)
68{
69 __led_classdev_unregister(lcd, true);
70}
71extern void led_classdev_suspend(struct led_classdev *led_cdev); 63extern void led_classdev_suspend(struct led_classdev *led_cdev);
72extern void led_classdev_resume(struct led_classdev *led_cdev); 64extern void led_classdev_resume(struct led_classdev *led_cdev);
73 65
diff --git a/include/linux/libata.h b/include/linux/libata.h
index 165734a2dd47..07ed56f7a767 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -443,7 +443,7 @@ enum link_pm {
443 MAX_PERFORMANCE, 443 MAX_PERFORMANCE,
444 MEDIUM_POWER, 444 MEDIUM_POWER,
445}; 445};
446extern struct class_device_attribute class_device_attr_link_power_management_policy; 446extern struct device_attribute dev_attr_link_power_management_policy;
447 447
448#ifdef CONFIG_ATA_SFF 448#ifdef CONFIG_ATA_SFF
449struct ata_ioports { 449struct ata_ioports {
diff --git a/include/linux/list.h b/include/linux/list.h
index 75ce2cb4ff6e..dac16f99c701 100644
--- a/include/linux/list.h
+++ b/include/linux/list.h
@@ -631,31 +631,14 @@ static inline void list_splice_init_rcu(struct list_head *list,
631 * as long as the traversal is guarded by rcu_read_lock(). 631 * as long as the traversal is guarded by rcu_read_lock().
632 */ 632 */
633#define list_for_each_rcu(pos, head) \ 633#define list_for_each_rcu(pos, head) \
634 for (pos = (head)->next; \ 634 for (pos = rcu_dereference((head)->next); \
635 prefetch(rcu_dereference(pos)->next), pos != (head); \ 635 prefetch(pos->next), pos != (head); \
636 pos = pos->next) 636 pos = rcu_dereference(pos->next))
637 637
638#define __list_for_each_rcu(pos, head) \ 638#define __list_for_each_rcu(pos, head) \
639 for (pos = (head)->next; \ 639 for (pos = rcu_dereference((head)->next); \
640 rcu_dereference(pos) != (head); \ 640 pos != (head); \
641 pos = pos->next) 641 pos = rcu_dereference(pos->next))
642
643/**
644 * list_for_each_safe_rcu
645 * @pos: the &struct list_head to use as a loop cursor.
646 * @n: another &struct list_head to use as temporary storage
647 * @head: the head for your list.
648 *
649 * Iterate over an rcu-protected list, safe against removal of list entry.
650 *
651 * This list-traversal primitive may safely run concurrently with
652 * the _rcu list-mutation primitives such as list_add_rcu()
653 * as long as the traversal is guarded by rcu_read_lock().
654 */
655#define list_for_each_safe_rcu(pos, n, head) \
656 for (pos = (head)->next; \
657 n = rcu_dereference(pos)->next, pos != (head); \
658 pos = n)
659 642
660/** 643/**
661 * list_for_each_entry_rcu - iterate over rcu list of given type 644 * list_for_each_entry_rcu - iterate over rcu list of given type
@@ -668,10 +651,9 @@ static inline void list_splice_init_rcu(struct list_head *list,
668 * as long as the traversal is guarded by rcu_read_lock(). 651 * as long as the traversal is guarded by rcu_read_lock().
669 */ 652 */
670#define list_for_each_entry_rcu(pos, head, member) \ 653#define list_for_each_entry_rcu(pos, head, member) \
671 for (pos = list_entry((head)->next, typeof(*pos), member); \ 654 for (pos = list_entry(rcu_dereference((head)->next), typeof(*pos), member); \
672 prefetch(rcu_dereference(pos)->member.next), \ 655 prefetch(pos->member.next), &pos->member != (head); \
673 &pos->member != (head); \ 656 pos = list_entry(rcu_dereference(pos->member.next), typeof(*pos), member))
674 pos = list_entry(pos->member.next, typeof(*pos), member))
675 657
676 658
677/** 659/**
@@ -686,9 +668,9 @@ static inline void list_splice_init_rcu(struct list_head *list,
686 * as long as the traversal is guarded by rcu_read_lock(). 668 * as long as the traversal is guarded by rcu_read_lock().
687 */ 669 */
688#define list_for_each_continue_rcu(pos, head) \ 670#define list_for_each_continue_rcu(pos, head) \
689 for ((pos) = (pos)->next; \ 671 for ((pos) = rcu_dereference((pos)->next); \
690 prefetch(rcu_dereference((pos))->next), (pos) != (head); \ 672 prefetch((pos)->next), (pos) != (head); \
691 (pos) = (pos)->next) 673 (pos) = rcu_dereference((pos)->next))
692 674
693/* 675/*
694 * Double linked lists with a single pointer list head. 676 * Double linked lists with a single pointer list head.
@@ -986,10 +968,10 @@ static inline void hlist_add_after_rcu(struct hlist_node *prev,
986 * as long as the traversal is guarded by rcu_read_lock(). 968 * as long as the traversal is guarded by rcu_read_lock().
987 */ 969 */
988#define hlist_for_each_entry_rcu(tpos, pos, head, member) \ 970#define hlist_for_each_entry_rcu(tpos, pos, head, member) \
989 for (pos = (head)->first; \ 971 for (pos = rcu_dereference((head)->first); \
990 rcu_dereference(pos) && ({ prefetch(pos->next); 1;}) && \ 972 pos && ({ prefetch(pos->next); 1;}) && \
991 ({ tpos = hlist_entry(pos, typeof(*tpos), member); 1;}); \ 973 ({ tpos = hlist_entry(pos, typeof(*tpos), member); 1;}); \
992 pos = pos->next) 974 pos = rcu_dereference(pos->next))
993 975
994#else 976#else
995#warning "don't include kernel headers in userspace" 977#warning "don't include kernel headers in userspace"
diff --git a/include/linux/lmb.h b/include/linux/lmb.h
new file mode 100644
index 000000000000..271153d27fba
--- /dev/null
+++ b/include/linux/lmb.h
@@ -0,0 +1,85 @@
1#ifndef _LINUX_LMB_H
2#define _LINUX_LMB_H
3#ifdef __KERNEL__
4
5/*
6 * Logical memory blocks.
7 *
8 * Copyright (C) 2001 Peter Bergner, IBM Corp.
9 *
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License
12 * as published by the Free Software Foundation; either version
13 * 2 of the License, or (at your option) any later version.
14 */
15
16#include <linux/init.h>
17#include <linux/mm.h>
18
19#define MAX_LMB_REGIONS 128
20
21struct lmb_property {
22 u64 base;
23 u64 size;
24};
25
26struct lmb_region {
27 unsigned long cnt;
28 u64 size;
29 struct lmb_property region[MAX_LMB_REGIONS+1];
30};
31
32struct lmb {
33 unsigned long debug;
34 u64 rmo_size;
35 struct lmb_region memory;
36 struct lmb_region reserved;
37};
38
39extern struct lmb lmb;
40
41extern void __init lmb_init(void);
42extern void __init lmb_analyze(void);
43extern long __init lmb_add(u64 base, u64 size);
44extern long __init lmb_reserve(u64 base, u64 size);
45extern u64 __init lmb_alloc_nid(u64 size, u64 align, int nid,
46 u64 (*nid_range)(u64, u64, int *));
47extern u64 __init lmb_alloc(u64 size, u64 align);
48extern u64 __init lmb_alloc_base(u64 size,
49 u64, u64 max_addr);
50extern u64 __init __lmb_alloc_base(u64 size,
51 u64 align, u64 max_addr);
52extern u64 __init lmb_phys_mem_size(void);
53extern u64 __init lmb_end_of_DRAM(void);
54extern void __init lmb_enforce_memory_limit(u64 memory_limit);
55extern int __init lmb_is_reserved(u64 addr);
56
57extern void lmb_dump_all(void);
58
59static inline u64
60lmb_size_bytes(struct lmb_region *type, unsigned long region_nr)
61{
62 return type->region[region_nr].size;
63}
64static inline u64
65lmb_size_pages(struct lmb_region *type, unsigned long region_nr)
66{
67 return lmb_size_bytes(type, region_nr) >> PAGE_SHIFT;
68}
69static inline u64
70lmb_start_pfn(struct lmb_region *type, unsigned long region_nr)
71{
72 return type->region[region_nr].base >> PAGE_SHIFT;
73}
74static inline u64
75lmb_end_pfn(struct lmb_region *type, unsigned long region_nr)
76{
77 return lmb_start_pfn(type, region_nr) +
78 lmb_size_pages(type, region_nr);
79}
80
81#include <asm/lmb.h>
82
83#endif /* __KERNEL__ */
84
85#endif /* _LINUX_LMB_H */
diff --git a/include/linux/mbus.h b/include/linux/mbus.h
new file mode 100644
index 000000000000..c11ff2932549
--- /dev/null
+++ b/include/linux/mbus.h
@@ -0,0 +1,36 @@
1/*
2 * Marvell MBUS common definitions.
3 *
4 * Copyright (C) 2008 Marvell Semiconductor
5 *
6 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without any
8 * warranty of any kind, whether express or implied.
9 */
10
11#ifndef __LINUX_MBUS_H
12#define __LINUX_MBUS_H
13
14struct mbus_dram_target_info
15{
16 /*
17 * The 4-bit MBUS target ID of the DRAM controller.
18 */
19 u8 mbus_dram_target_id;
20
21 /*
22 * The base address, size, and MBUS attribute ID for each
23 * of the possible DRAM chip selects. Peripherals are
24 * required to support at least 4 decode windows.
25 */
26 int num_cs;
27 struct mbus_dram_window {
28 u8 cs_index;
29 u8 mbus_attr;
30 u32 base;
31 u32 size;
32 } cs[4];
33};
34
35
36#endif
diff --git a/include/linux/memory.h b/include/linux/memory.h
index 33f0ff0cf634..f80e0e331cb7 100644
--- a/include/linux/memory.h
+++ b/include/linux/memory.h
@@ -18,8 +18,7 @@
18#include <linux/sysdev.h> 18#include <linux/sysdev.h>
19#include <linux/node.h> 19#include <linux/node.h>
20#include <linux/compiler.h> 20#include <linux/compiler.h>
21 21#include <linux/mutex.h>
22#include <asm/semaphore.h>
23 22
24struct memory_block { 23struct memory_block {
25 unsigned long phys_index; 24 unsigned long phys_index;
@@ -30,7 +29,7 @@ struct memory_block {
30 * created long after the critical areas during 29 * created long after the critical areas during
31 * initialization. 30 * initialization.
32 */ 31 */
33 struct semaphore state_sem; 32 struct mutex state_mutex;
34 int phys_device; /* to which fru does this belong? */ 33 int phys_device; /* to which fru does this belong? */
35 void *hw; /* optional pointer to fw/hw data */ 34 void *hw; /* optional pointer to fw/hw data */
36 int (*phys_callback)(struct memory_block *); 35 int (*phys_callback)(struct memory_block *);
diff --git a/include/linux/memstick.h b/include/linux/memstick.h
index 3e686ec6a967..37a5cdb03918 100644
--- a/include/linux/memstick.h
+++ b/include/linux/memstick.h
@@ -276,7 +276,7 @@ struct memstick_host {
276#define MEMSTICK_CAP_PAR8 4 276#define MEMSTICK_CAP_PAR8 4
277 277
278 struct work_struct media_checker; 278 struct work_struct media_checker;
279 struct class_device cdev; 279 struct device dev;
280 280
281 struct memstick_dev *card; 281 struct memstick_dev *card;
282 unsigned int retries; 282 unsigned int retries;
diff --git a/include/linux/mfd/htc-egpio.h b/include/linux/mfd/htc-egpio.h
new file mode 100644
index 000000000000..b4201c971367
--- /dev/null
+++ b/include/linux/mfd/htc-egpio.h
@@ -0,0 +1,57 @@
1/*
2 * HTC simple EGPIO irq and gpio extender
3 */
4
5#ifndef __HTC_EGPIO_H__
6#define __HTC_EGPIO_H__
7
8#include <linux/gpio.h>
9
10/* Descriptive values for all-in or all-out htc_egpio_chip descriptors. */
11#define HTC_EGPIO_OUTPUT (~0)
12#define HTC_EGPIO_INPUT 0
13
14/**
15 * struct htc_egpio_chip - descriptor to create gpio_chip for register range
16 * @reg_start: index of first register
17 * @gpio_base: gpio number of first pin in this register range
18 * @num_gpios: number of gpios in this register range, max BITS_PER_LONG
19 * (number of registers = DIV_ROUND_UP(num_gpios, reg_width))
20 * @direction: bitfield, '0' = input, '1' = output,
21 */
22struct htc_egpio_chip {
23 int reg_start;
24 int gpio_base;
25 int num_gpios;
26 unsigned long direction;
27 unsigned long initial_values;
28};
29
30/**
31 * struct htc_egpio_platform_data - description provided by the arch
32 * @irq_base: beginning of available IRQs (eg, IRQ_BOARD_START)
33 * @num_irqs: number of irqs
34 * @reg_width: number of bits per register, either 8 or 16 bit
35 * @bus_width: alignment of the registers, either 16 or 32 bit
36 * @invert_acks: set if chip requires writing '0' to ack an irq, instead of '1'
37 * @ack_register: location of the irq/ack register
38 * @chip: pointer to array of htc_egpio_chip descriptors
39 * @num_chips: number of egpio chip descriptors
40 */
41struct htc_egpio_platform_data {
42 int bus_width;
43 int reg_width;
44
45 int irq_base;
46 int num_irqs;
47 int invert_acks;
48 int ack_register;
49
50 struct htc_egpio_chip *chip;
51 int num_chips;
52};
53
54/* Determine the wakeup irq, to be called during early resume */
55extern int htc_egpio_get_wakeup_irq(struct device *dev);
56
57#endif
diff --git a/include/linux/mfd/htc-pasic3.h b/include/linux/mfd/htc-pasic3.h
new file mode 100644
index 000000000000..b4294f12c4f8
--- /dev/null
+++ b/include/linux/mfd/htc-pasic3.h
@@ -0,0 +1,55 @@
1/*
2 * HTC PASIC3 driver - LEDs and DS1WM
3 *
4 * Copyright (c) 2007 Philipp Zabel <philipp.zabel@gmail.com>
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file COPYING in the main directory of this archive for
8 * more details.
9 *
10 */
11
12#ifndef __PASIC3_H
13#define __PASIC3_H
14
15#include <linux/platform_device.h>
16#include <linux/leds.h>
17
18extern void pasic3_write_register(struct device *dev, u32 reg, u8 val);
19extern u8 pasic3_read_register(struct device *dev, u32 reg);
20
21/*
22 * mask for registers 0x20,0x21,0x22
23 */
24#define PASIC3_MASK_LED0 0x04
25#define PASIC3_MASK_LED1 0x08
26#define PASIC3_MASK_LED2 0x40
27
28/*
29 * bits in register 0x06
30 */
31#define PASIC3_BIT2_LED0 0x08
32#define PASIC3_BIT2_LED1 0x10
33#define PASIC3_BIT2_LED2 0x20
34
35struct pasic3_led {
36 struct led_classdev led;
37 unsigned int hw_num;
38 unsigned int bit2;
39 unsigned int mask;
40 struct pasic3_leds_machinfo *pdata;
41};
42
43struct pasic3_leds_machinfo {
44 unsigned int num_leds;
45 unsigned int power_gpio;
46 struct pasic3_led *leds;
47};
48
49struct pasic3_platform_data {
50 struct pasic3_leds_machinfo *led_pdata;
51 unsigned int bus_shift;
52 unsigned int clock_rate;
53};
54
55#endif
diff --git a/include/linux/miscdevice.h b/include/linux/miscdevice.h
index 24b30b9b4f8a..26433ec520b3 100644
--- a/include/linux/miscdevice.h
+++ b/include/linux/miscdevice.h
@@ -43,15 +43,7 @@ struct miscdevice {
43}; 43};
44 44
45extern int misc_register(struct miscdevice * misc); 45extern int misc_register(struct miscdevice * misc);
46extern int __misc_deregister(struct miscdevice *misc, bool suspended); 46extern int misc_deregister(struct miscdevice *misc);
47static inline int misc_deregister(struct miscdevice *misc)
48{
49 return __misc_deregister(misc, false);
50}
51static inline int misc_deregister_suspended(struct miscdevice *misc)
52{
53 return __misc_deregister(misc, true);
54}
55 47
56#define MODULE_ALIAS_MISCDEV(minor) \ 48#define MODULE_ALIAS_MISCDEV(minor) \
57 MODULE_ALIAS("char-major-" __stringify(MISC_MAJOR) \ 49 MODULE_ALIAS("char-major-" __stringify(MISC_MAJOR) \
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index 8d8d1977736e..9f274a687c7e 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -699,7 +699,6 @@ extern char numa_zonelist_order[];
699extern struct pglist_data contig_page_data; 699extern struct pglist_data contig_page_data;
700#define NODE_DATA(nid) (&contig_page_data) 700#define NODE_DATA(nid) (&contig_page_data)
701#define NODE_MEM_MAP(nid) mem_map 701#define NODE_MEM_MAP(nid) mem_map
702#define MAX_NODES_SHIFT 1
703 702
704#else /* CONFIG_NEED_MULTIPLE_NODES */ 703#else /* CONFIG_NEED_MULTIPLE_NODES */
705 704
diff --git a/include/linux/mount.h b/include/linux/mount.h
index 5ee2df217cdf..d6600e3f7e45 100644
--- a/include/linux/mount.h
+++ b/include/linux/mount.h
@@ -14,6 +14,7 @@
14 14
15#include <linux/types.h> 15#include <linux/types.h>
16#include <linux/list.h> 16#include <linux/list.h>
17#include <linux/nodemask.h>
17#include <linux/spinlock.h> 18#include <linux/spinlock.h>
18#include <asm/atomic.h> 19#include <asm/atomic.h>
19 20
@@ -28,8 +29,10 @@ struct mnt_namespace;
28#define MNT_NOATIME 0x08 29#define MNT_NOATIME 0x08
29#define MNT_NODIRATIME 0x10 30#define MNT_NODIRATIME 0x10
30#define MNT_RELATIME 0x20 31#define MNT_RELATIME 0x20
32#define MNT_READONLY 0x40 /* does the user want this to be r/o? */
31 33
32#define MNT_SHRINKABLE 0x100 34#define MNT_SHRINKABLE 0x100
35#define MNT_IMBALANCED_WRITE_COUNT 0x200 /* just for debugging */
33 36
34#define MNT_SHARED 0x1000 /* if the vfsmount is a shared mount */ 37#define MNT_SHARED 0x1000 /* if the vfsmount is a shared mount */
35#define MNT_UNBINDABLE 0x2000 /* if the vfsmount is a unbindable mount */ 38#define MNT_UNBINDABLE 0x2000 /* if the vfsmount is a unbindable mount */
@@ -62,6 +65,11 @@ struct vfsmount {
62 int mnt_expiry_mark; /* true if marked for expiry */ 65 int mnt_expiry_mark; /* true if marked for expiry */
63 int mnt_pinned; 66 int mnt_pinned;
64 int mnt_ghosts; 67 int mnt_ghosts;
68 /*
69 * This value is not stable unless all of the mnt_writers[] spinlocks
70 * are held, and all mnt_writer[]s on this mount have 0 as their ->count
71 */
72 atomic_t __mnt_writers;
65}; 73};
66 74
67static inline struct vfsmount *mntget(struct vfsmount *mnt) 75static inline struct vfsmount *mntget(struct vfsmount *mnt)
@@ -71,9 +79,12 @@ static inline struct vfsmount *mntget(struct vfsmount *mnt)
71 return mnt; 79 return mnt;
72} 80}
73 81
82extern int mnt_want_write(struct vfsmount *mnt);
83extern void mnt_drop_write(struct vfsmount *mnt);
74extern void mntput_no_expire(struct vfsmount *mnt); 84extern void mntput_no_expire(struct vfsmount *mnt);
75extern void mnt_pin(struct vfsmount *mnt); 85extern void mnt_pin(struct vfsmount *mnt);
76extern void mnt_unpin(struct vfsmount *mnt); 86extern void mnt_unpin(struct vfsmount *mnt);
87extern int __mnt_is_readonly(struct vfsmount *mnt);
77 88
78static inline void mntput(struct vfsmount *mnt) 89static inline void mntput(struct vfsmount *mnt)
79{ 90{
diff --git a/include/linux/mroute.h b/include/linux/mroute.h
index 35a8277ec1bd..de4decfa1bfc 100644
--- a/include/linux/mroute.h
+++ b/include/linux/mroute.h
@@ -2,7 +2,11 @@
2#define __LINUX_MROUTE_H 2#define __LINUX_MROUTE_H
3 3
4#include <linux/sockios.h> 4#include <linux/sockios.h>
5#include <linux/types.h>
6#ifdef __KERNEL__
5#include <linux/in.h> 7#include <linux/in.h>
8#endif
9#include <linux/pim.h>
6 10
7/* 11/*
8 * Based on the MROUTING 3.5 defines primarily to keep 12 * Based on the MROUTING 3.5 defines primarily to keep
@@ -210,27 +214,6 @@ struct mfc_cache
210#define IGMPMSG_WHOLEPKT 3 /* For PIM Register processing */ 214#define IGMPMSG_WHOLEPKT 3 /* For PIM Register processing */
211 215
212#ifdef __KERNEL__ 216#ifdef __KERNEL__
213
214#define PIM_V1_VERSION __constant_htonl(0x10000000)
215#define PIM_V1_REGISTER 1
216
217#define PIM_VERSION 2
218#define PIM_REGISTER 1
219
220#define PIM_NULL_REGISTER __constant_htonl(0x40000000)
221
222/* PIMv2 register message header layout (ietf-draft-idmr-pimvsm-v2-00.ps */
223
224struct pimreghdr
225{
226 __u8 type;
227 __u8 reserved;
228 __be16 csum;
229 __be32 flags;
230};
231
232extern int pim_rcv_v1(struct sk_buff *);
233
234struct rtmsg; 217struct rtmsg;
235extern int ipmr_get_route(struct sk_buff *skb, struct rtmsg *rtm, int nowait); 218extern int ipmr_get_route(struct sk_buff *skb, struct rtmsg *rtm, int nowait);
236#endif 219#endif
diff --git a/include/linux/mroute6.h b/include/linux/mroute6.h
new file mode 100644
index 000000000000..e7989593142b
--- /dev/null
+++ b/include/linux/mroute6.h
@@ -0,0 +1,228 @@
1#ifndef __LINUX_MROUTE6_H
2#define __LINUX_MROUTE6_H
3
4#include <linux/types.h>
5#include <linux/sockios.h>
6
7/*
8 * Based on the MROUTING 3.5 defines primarily to keep
9 * source compatibility with BSD.
10 *
11 * See the pim6sd code for the original history.
12 *
13 * Protocol Independent Multicast (PIM) data structures included
14 * Carlos Picoto (cap@di.fc.ul.pt)
15 *
16 */
17
18#define MRT6_BASE 200
19#define MRT6_INIT (MRT6_BASE) /* Activate the kernel mroute code */
20#define MRT6_DONE (MRT6_BASE+1) /* Shutdown the kernel mroute */
21#define MRT6_ADD_MIF (MRT6_BASE+2) /* Add a virtual interface */
22#define MRT6_DEL_MIF (MRT6_BASE+3) /* Delete a virtual interface */
23#define MRT6_ADD_MFC (MRT6_BASE+4) /* Add a multicast forwarding entry */
24#define MRT6_DEL_MFC (MRT6_BASE+5) /* Delete a multicast forwarding entry */
25#define MRT6_VERSION (MRT6_BASE+6) /* Get the kernel multicast version */
26#define MRT6_ASSERT (MRT6_BASE+7) /* Activate PIM assert mode */
27#define MRT6_PIM (MRT6_BASE+8) /* enable PIM code */
28
29#define SIOCGETMIFCNT_IN6 SIOCPROTOPRIVATE /* IP protocol privates */
30#define SIOCGETSGCNT_IN6 (SIOCPROTOPRIVATE+1)
31#define SIOCGETRPF (SIOCPROTOPRIVATE+2)
32
33#define MAXMIFS 32
34typedef unsigned long mifbitmap_t; /* User mode code depends on this lot */
35typedef unsigned short mifi_t;
36#define ALL_MIFS ((mifi_t)(-1))
37
38#ifndef IF_SETSIZE
39#define IF_SETSIZE 256
40#endif
41
42typedef __u32 if_mask;
43#define NIFBITS (sizeof(if_mask) * 8) /* bits per mask */
44
45#if !defined(__KERNEL__) && !defined(DIV_ROUND_UP)
46#define DIV_ROUND_UP(x,y) (((x) + ((y) - 1)) / (y))
47#endif
48
49typedef struct if_set {
50 if_mask ifs_bits[DIV_ROUND_UP(IF_SETSIZE, NIFBITS)];
51} if_set;
52
53#define IF_SET(n, p) ((p)->ifs_bits[(n)/NIFBITS] |= (1 << ((n) % NIFBITS)))
54#define IF_CLR(n, p) ((p)->ifs_bits[(n)/NIFBITS] &= ~(1 << ((n) % NIFBITS)))
55#define IF_ISSET(n, p) ((p)->ifs_bits[(n)/NIFBITS] & (1 << ((n) % NIFBITS)))
56#define IF_COPY(f, t) bcopy(f, t, sizeof(*(f)))
57#define IF_ZERO(p) bzero(p, sizeof(*(p)))
58
59/*
60 * Passed by mrouted for an MRT_ADD_MIF - again we use the
61 * mrouted 3.6 structures for compatibility
62 */
63
64struct mif6ctl {
65 mifi_t mif6c_mifi; /* Index of MIF */
66 unsigned char mif6c_flags; /* MIFF_ flags */
67 unsigned char vifc_threshold; /* ttl limit */
68 u_short mif6c_pifi; /* the index of the physical IF */
69 unsigned int vifc_rate_limit; /* Rate limiter values (NI) */
70};
71
72#define MIFF_REGISTER 0x1 /* register vif */
73
74/*
75 * Cache manipulation structures for mrouted and PIMd
76 */
77
78struct mf6cctl
79{
80 struct sockaddr_in6 mf6cc_origin; /* Origin of mcast */
81 struct sockaddr_in6 mf6cc_mcastgrp; /* Group in question */
82 mifi_t mf6cc_parent; /* Where it arrived */
83 struct if_set mf6cc_ifset; /* Where it is going */
84};
85
86/*
87 * Group count retrieval for pim6sd
88 */
89
90struct sioc_sg_req6
91{
92 struct sockaddr_in6 src;
93 struct sockaddr_in6 grp;
94 unsigned long pktcnt;
95 unsigned long bytecnt;
96 unsigned long wrong_if;
97};
98
99/*
100 * To get vif packet counts
101 */
102
103struct sioc_mif_req6
104{
105 mifi_t mifi; /* Which iface */
106 unsigned long icount; /* In packets */
107 unsigned long ocount; /* Out packets */
108 unsigned long ibytes; /* In bytes */
109 unsigned long obytes; /* Out bytes */
110};
111
112/*
113 * That's all usermode folks
114 */
115
116#ifdef __KERNEL__
117
118#include <linux/skbuff.h> /* for struct sk_buff_head */
119
120#ifdef CONFIG_IPV6_MROUTE
121static inline int ip6_mroute_opt(int opt)
122{
123 return (opt >= MRT6_BASE) && (opt <= MRT6_BASE + 10);
124}
125#else
126static inline int ip6_mroute_opt(int opt)
127{
128 return 0;
129}
130#endif
131
132struct sock;
133
134extern int ip6_mroute_setsockopt(struct sock *, int, char __user *, int);
135extern int ip6_mroute_getsockopt(struct sock *, int, char __user *, int __user *);
136extern int ip6_mr_input(struct sk_buff *skb);
137extern int ip6mr_ioctl(struct sock *sk, int cmd, void __user *arg);
138extern void ip6_mr_init(void);
139
140struct mif_device
141{
142 struct net_device *dev; /* Device we are using */
143 unsigned long bytes_in,bytes_out;
144 unsigned long pkt_in,pkt_out; /* Statistics */
145 unsigned long rate_limit; /* Traffic shaping (NI) */
146 unsigned char threshold; /* TTL threshold */
147 unsigned short flags; /* Control flags */
148 int link; /* Physical interface index */
149};
150
151#define VIFF_STATIC 0x8000
152
153struct mfc6_cache
154{
155 struct mfc6_cache *next; /* Next entry on cache line */
156 struct in6_addr mf6c_mcastgrp; /* Group the entry belongs to */
157 struct in6_addr mf6c_origin; /* Source of packet */
158 mifi_t mf6c_parent; /* Source interface */
159 int mfc_flags; /* Flags on line */
160
161 union {
162 struct {
163 unsigned long expires;
164 struct sk_buff_head unresolved; /* Unresolved buffers */
165 } unres;
166 struct {
167 unsigned long last_assert;
168 int minvif;
169 int maxvif;
170 unsigned long bytes;
171 unsigned long pkt;
172 unsigned long wrong_if;
173 unsigned char ttls[MAXMIFS]; /* TTL thresholds */
174 } res;
175 } mfc_un;
176};
177
178#define MFC_STATIC 1
179#define MFC_NOTIFY 2
180
181#define MFC6_LINES 64
182
183#define MFC6_HASH(a, g) (((__force u32)(a)->s6_addr32[0] ^ \
184 (__force u32)(a)->s6_addr32[1] ^ \
185 (__force u32)(a)->s6_addr32[2] ^ \
186 (__force u32)(a)->s6_addr32[3] ^ \
187 (__force u32)(g)->s6_addr32[0] ^ \
188 (__force u32)(g)->s6_addr32[1] ^ \
189 (__force u32)(g)->s6_addr32[2] ^ \
190 (__force u32)(g)->s6_addr32[3]) % MFC6_LINES)
191
192#define MFC_ASSERT_THRESH (3*HZ) /* Maximal freq. of asserts */
193
194#endif
195
196#ifdef __KERNEL__
197struct rtmsg;
198extern int ip6mr_get_route(struct sk_buff *skb, struct rtmsg *rtm, int nowait);
199
200#ifdef CONFIG_IPV6_MROUTE
201extern struct sock *mroute6_socket;
202extern int ip6mr_sk_done(struct sock *sk);
203#else
204#define mroute6_socket NULL
205static inline int ip6mr_sk_done(struct sock *sk) { return 0; }
206#endif
207#endif
208
209/*
210 * Structure used to communicate from kernel to multicast router.
211 * We'll overlay the structure onto an MLD header (not an IPv6 heder like igmpmsg{}
212 * used for IPv4 implementation). This is because this structure will be passed via an
213 * IPv6 raw socket, on wich an application will only receiver the payload i.e the data after
214 * the IPv6 header and all the extension headers. (See section 3 of RFC 3542)
215 */
216
217struct mrt6msg {
218#define MRT6MSG_NOCACHE 1
219#define MRT6MSG_WRONGMIF 2
220#define MRT6MSG_WHOLEPKT 3 /* used for use level encap */
221 __u8 im6_mbz; /* must be zero */
222 __u8 im6_msgtype; /* what type of message */
223 __u16 im6_mif; /* mif rec'd on */
224 __u32 im6_pad; /* padding for 64 bit arch */
225 struct in6_addr im6_src, im6_dst;
226};
227
228#endif
diff --git a/include/linux/mtio.h b/include/linux/mtio.h
index 6f8d2d45a8fb..ef01d6aa5934 100644
--- a/include/linux/mtio.h
+++ b/include/linux/mtio.h
@@ -192,6 +192,7 @@ struct mtpos {
192#define MT_ST_SCSI2LOGICAL 0x800 192#define MT_ST_SCSI2LOGICAL 0x800
193#define MT_ST_SYSV 0x1000 193#define MT_ST_SYSV 0x1000
194#define MT_ST_NOWAIT 0x2000 194#define MT_ST_NOWAIT 0x2000
195#define MT_ST_SILI 0x4000
195 196
196/* The mode parameters to be controlled. Parameter chosen with bits 20-28 */ 197/* The mode parameters to be controlled. Parameter chosen with bits 20-28 */
197#define MT_ST_CLEAR_DEFAULT 0xfffff 198#define MT_ST_CLEAR_DEFAULT 0xfffff
diff --git a/include/linux/net.h b/include/linux/net.h
index c414d90e647b..71f7dd559285 100644
--- a/include/linux/net.h
+++ b/include/linux/net.h
@@ -19,6 +19,7 @@
19#define _LINUX_NET_H 19#define _LINUX_NET_H
20 20
21#include <linux/wait.h> 21#include <linux/wait.h>
22#include <linux/socket.h>
22#include <asm/socket.h> 23#include <asm/socket.h>
23 24
24struct poll_table_struct; 25struct poll_table_struct;
@@ -26,7 +27,7 @@ struct pipe_inode_info;
26struct inode; 27struct inode;
27struct net; 28struct net;
28 29
29#define NPROTO 34 /* should be enough for now.. */ 30#define NPROTO AF_MAX
30 31
31#define SYS_SOCKET 1 /* sys_socket(2) */ 32#define SYS_SOCKET 1 /* sys_socket(2) */
32#define SYS_BIND 2 /* sys_bind(2) */ 33#define SYS_BIND 2 /* sys_bind(2) */
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index ee81906b5164..7c1d4466583b 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -710,8 +710,10 @@ struct net_device
710 void (*poll_controller)(struct net_device *dev); 710 void (*poll_controller)(struct net_device *dev);
711#endif 711#endif
712 712
713#ifdef CONFIG_NET_NS
713 /* Network namespace this network device is inside */ 714 /* Network namespace this network device is inside */
714 struct net *nd_net; 715 struct net *nd_net;
716#endif
715 717
716 /* bridge stuff */ 718 /* bridge stuff */
717 struct net_bridge_port *br_port; 719 struct net_bridge_port *br_port;
@@ -726,6 +728,10 @@ struct net_device
726 /* rtnetlink link ops */ 728 /* rtnetlink link ops */
727 const struct rtnl_link_ops *rtnl_link_ops; 729 const struct rtnl_link_ops *rtnl_link_ops;
728 730
731 /* for setting kernel sock attribute on TCP connection setup */
732#define GSO_MAX_SIZE 65536
733 unsigned int gso_max_size;
734
729 /* The TX queue control structures */ 735 /* The TX queue control structures */
730 unsigned int egress_subqueue_count; 736 unsigned int egress_subqueue_count;
731 struct net_device_subqueue egress_subqueue[1]; 737 struct net_device_subqueue egress_subqueue[1];
@@ -735,6 +741,28 @@ struct net_device
735#define NETDEV_ALIGN 32 741#define NETDEV_ALIGN 32
736#define NETDEV_ALIGN_CONST (NETDEV_ALIGN - 1) 742#define NETDEV_ALIGN_CONST (NETDEV_ALIGN - 1)
737 743
744/*
745 * Net namespace inlines
746 */
747static inline
748struct net *dev_net(const struct net_device *dev)
749{
750#ifdef CONFIG_NET_NS
751 return dev->nd_net;
752#else
753 return &init_net;
754#endif
755}
756
757static inline
758void dev_net_set(struct net_device *dev, struct net *net)
759{
760#ifdef CONFIG_NET_NS
761 release_net(dev->nd_net);
762 dev->nd_net = hold_net(net);
763#endif
764}
765
738/** 766/**
739 * netdev_priv - access network device private data 767 * netdev_priv - access network device private data
740 * @dev: network device 768 * @dev: network device
@@ -811,7 +839,7 @@ static inline struct net_device *next_net_device(struct net_device *dev)
811 struct list_head *lh; 839 struct list_head *lh;
812 struct net *net; 840 struct net *net;
813 841
814 net = dev->nd_net; 842 net = dev_net(dev);
815 lh = dev->dev_list.next; 843 lh = dev->dev_list.next;
816 return lh == &net->dev_base_head ? NULL : net_device_entry(lh); 844 return lh == &net->dev_base_head ? NULL : net_device_entry(lh);
817} 845}
@@ -1479,6 +1507,12 @@ static inline int netif_needs_gso(struct net_device *dev, struct sk_buff *skb)
1479 unlikely(skb->ip_summed != CHECKSUM_PARTIAL)); 1507 unlikely(skb->ip_summed != CHECKSUM_PARTIAL));
1480} 1508}
1481 1509
1510static inline void netif_set_gso_max_size(struct net_device *dev,
1511 unsigned int size)
1512{
1513 dev->gso_max_size = size;
1514}
1515
1482/* On bonding slaves other than the currently active slave, suppress 1516/* On bonding slaves other than the currently active slave, suppress
1483 * duplicates except for 802.3ad ETH_P_SLOW, alb non-mcast/bcast, and 1517 * duplicates except for 802.3ad ETH_P_SLOW, alb non-mcast/bcast, and
1484 * ARP on active-backup slaves with arp_validate enabled. 1518 * ARP on active-backup slaves with arp_validate enabled.
diff --git a/include/linux/netfilter.h b/include/linux/netfilter.h
index f0680c2bee73..e4c66593b5c6 100644
--- a/include/linux/netfilter.h
+++ b/include/linux/netfilter.h
@@ -6,11 +6,13 @@
6#include <linux/types.h> 6#include <linux/types.h>
7#include <linux/skbuff.h> 7#include <linux/skbuff.h>
8#include <linux/net.h> 8#include <linux/net.h>
9#include <linux/netdevice.h>
9#include <linux/if.h> 10#include <linux/if.h>
10#include <linux/in.h> 11#include <linux/in.h>
11#include <linux/in6.h> 12#include <linux/in6.h>
12#include <linux/wait.h> 13#include <linux/wait.h>
13#include <linux/list.h> 14#include <linux/list.h>
15#include <net/net_namespace.h>
14#endif 16#endif
15#include <linux/compiler.h> 17#include <linux/compiler.h>
16 18
@@ -61,13 +63,21 @@ union nf_inet_addr {
61#ifdef __KERNEL__ 63#ifdef __KERNEL__
62#ifdef CONFIG_NETFILTER 64#ifdef CONFIG_NETFILTER
63 65
66static inline int nf_inet_addr_cmp(const union nf_inet_addr *a1,
67 const union nf_inet_addr *a2)
68{
69 return a1->all[0] == a2->all[0] &&
70 a1->all[1] == a2->all[1] &&
71 a1->all[2] == a2->all[2] &&
72 a1->all[3] == a2->all[3];
73}
74
64extern void netfilter_init(void); 75extern void netfilter_init(void);
65 76
66/* Largest hook number + 1 */ 77/* Largest hook number + 1 */
67#define NF_MAX_HOOKS 8 78#define NF_MAX_HOOKS 8
68 79
69struct sk_buff; 80struct sk_buff;
70struct net_device;
71 81
72typedef unsigned int nf_hookfn(unsigned int hooknum, 82typedef unsigned int nf_hookfn(unsigned int hooknum,
73 struct sk_buff *skb, 83 struct sk_buff *skb,
@@ -224,6 +234,11 @@ struct nf_afinfo {
224 unsigned short family; 234 unsigned short family;
225 __sum16 (*checksum)(struct sk_buff *skb, unsigned int hook, 235 __sum16 (*checksum)(struct sk_buff *skb, unsigned int hook,
226 unsigned int dataoff, u_int8_t protocol); 236 unsigned int dataoff, u_int8_t protocol);
237 __sum16 (*checksum_partial)(struct sk_buff *skb,
238 unsigned int hook,
239 unsigned int dataoff,
240 unsigned int len,
241 u_int8_t protocol);
227 int (*route)(struct dst_entry **dst, struct flowi *fl); 242 int (*route)(struct dst_entry **dst, struct flowi *fl);
228 void (*saveroute)(const struct sk_buff *skb, 243 void (*saveroute)(const struct sk_buff *skb,
229 struct nf_queue_entry *entry); 244 struct nf_queue_entry *entry);
@@ -253,6 +268,23 @@ nf_checksum(struct sk_buff *skb, unsigned int hook, unsigned int dataoff,
253 return csum; 268 return csum;
254} 269}
255 270
271static inline __sum16
272nf_checksum_partial(struct sk_buff *skb, unsigned int hook,
273 unsigned int dataoff, unsigned int len,
274 u_int8_t protocol, unsigned short family)
275{
276 const struct nf_afinfo *afinfo;
277 __sum16 csum = 0;
278
279 rcu_read_lock();
280 afinfo = nf_get_afinfo(family);
281 if (afinfo)
282 csum = afinfo->checksum_partial(skb, hook, dataoff, len,
283 protocol);
284 rcu_read_unlock();
285 return csum;
286}
287
256extern int nf_register_afinfo(const struct nf_afinfo *afinfo); 288extern int nf_register_afinfo(const struct nf_afinfo *afinfo);
257extern void nf_unregister_afinfo(const struct nf_afinfo *afinfo); 289extern void nf_unregister_afinfo(const struct nf_afinfo *afinfo);
258 290
@@ -311,5 +343,56 @@ extern void (*nf_ct_destroy)(struct nf_conntrack *);
311static inline void nf_ct_attach(struct sk_buff *new, struct sk_buff *skb) {} 343static inline void nf_ct_attach(struct sk_buff *new, struct sk_buff *skb) {}
312#endif 344#endif
313 345
346static inline struct net *nf_pre_routing_net(const struct net_device *in,
347 const struct net_device *out)
348{
349#ifdef CONFIG_NET_NS
350 return in->nd_net;
351#else
352 return &init_net;
353#endif
354}
355
356static inline struct net *nf_local_in_net(const struct net_device *in,
357 const struct net_device *out)
358{
359#ifdef CONFIG_NET_NS
360 return in->nd_net;
361#else
362 return &init_net;
363#endif
364}
365
366static inline struct net *nf_forward_net(const struct net_device *in,
367 const struct net_device *out)
368{
369#ifdef CONFIG_NET_NS
370 BUG_ON(in->nd_net != out->nd_net);
371 return in->nd_net;
372#else
373 return &init_net;
374#endif
375}
376
377static inline struct net *nf_local_out_net(const struct net_device *in,
378 const struct net_device *out)
379{
380#ifdef CONFIG_NET_NS
381 return out->nd_net;
382#else
383 return &init_net;
384#endif
385}
386
387static inline struct net *nf_post_routing_net(const struct net_device *in,
388 const struct net_device *out)
389{
390#ifdef CONFIG_NET_NS
391 return out->nd_net;
392#else
393 return &init_net;
394#endif
395}
396
314#endif /*__KERNEL__*/ 397#endif /*__KERNEL__*/
315#endif /*__LINUX_NETFILTER_H*/ 398#endif /*__LINUX_NETFILTER_H*/
diff --git a/include/linux/netfilter/nf_conntrack_dccp.h b/include/linux/netfilter/nf_conntrack_dccp.h
new file mode 100644
index 000000000000..40dcc82058d1
--- /dev/null
+++ b/include/linux/netfilter/nf_conntrack_dccp.h
@@ -0,0 +1,40 @@
1#ifndef _NF_CONNTRACK_DCCP_H
2#define _NF_CONNTRACK_DCCP_H
3
4/* Exposed to userspace over nfnetlink */
5enum ct_dccp_states {
6 CT_DCCP_NONE,
7 CT_DCCP_REQUEST,
8 CT_DCCP_RESPOND,
9 CT_DCCP_PARTOPEN,
10 CT_DCCP_OPEN,
11 CT_DCCP_CLOSEREQ,
12 CT_DCCP_CLOSING,
13 CT_DCCP_TIMEWAIT,
14 CT_DCCP_IGNORE,
15 CT_DCCP_INVALID,
16 __CT_DCCP_MAX
17};
18#define CT_DCCP_MAX (__CT_DCCP_MAX - 1)
19
20enum ct_dccp_roles {
21 CT_DCCP_ROLE_CLIENT,
22 CT_DCCP_ROLE_SERVER,
23 __CT_DCCP_ROLE_MAX
24};
25#define CT_DCCP_ROLE_MAX (__CT_DCCP_ROLE_MAX - 1)
26
27#ifdef __KERNEL__
28#include <net/netfilter/nf_conntrack_tuple.h>
29
30struct nf_ct_dccp {
31 u_int8_t role[IP_CT_DIR_MAX];
32 u_int8_t state;
33 u_int8_t last_pkt;
34 u_int8_t last_dir;
35 u_int64_t handshake_seq;
36};
37
38#endif /* __KERNEL__ */
39
40#endif /* _NF_CONNTRACK_DCCP_H */
diff --git a/include/linux/netfilter/nf_conntrack_sip.h b/include/linux/netfilter/nf_conntrack_sip.h
index 8e5ce1ca7bfc..5da04e586a3f 100644
--- a/include/linux/netfilter/nf_conntrack_sip.h
+++ b/include/linux/netfilter/nf_conntrack_sip.h
@@ -5,37 +5,164 @@
5#define SIP_PORT 5060 5#define SIP_PORT 5060
6#define SIP_TIMEOUT 3600 6#define SIP_TIMEOUT 3600
7 7
8enum sip_header_pos { 8struct nf_ct_sip_master {
9 POS_REG_REQ_URI, 9 unsigned int register_cseq;
10 POS_REQ_URI, 10};
11 POS_FROM, 11
12 POS_TO, 12enum sip_expectation_classes {
13 POS_VIA, 13 SIP_EXPECT_SIGNALLING,
14 POS_CONTACT, 14 SIP_EXPECT_AUDIO,
15 POS_CONTENT, 15 SIP_EXPECT_VIDEO,
16 POS_MEDIA, 16 __SIP_EXPECT_MAX
17 POS_OWNER_IP4, 17};
18 POS_CONNECTION_IP4, 18#define SIP_EXPECT_MAX (__SIP_EXPECT_MAX - 1)
19 POS_OWNER_IP6, 19
20 POS_CONNECTION_IP6, 20struct sdp_media_type {
21 POS_SDP_HEADER, 21 const char *name;
22 unsigned int len;
23 enum sip_expectation_classes class;
24};
25
26#define SDP_MEDIA_TYPE(__name, __class) \
27{ \
28 .name = (__name), \
29 .len = sizeof(__name) - 1, \
30 .class = (__class), \
31}
32
33struct sip_handler {
34 const char *method;
35 unsigned int len;
36 int (*request)(struct sk_buff *skb,
37 const char **dptr, unsigned int *datalen,
38 unsigned int cseq);
39 int (*response)(struct sk_buff *skb,
40 const char **dptr, unsigned int *datalen,
41 unsigned int cseq, unsigned int code);
42};
43
44#define SIP_HANDLER(__method, __request, __response) \
45{ \
46 .method = (__method), \
47 .len = sizeof(__method) - 1, \
48 .request = (__request), \
49 .response = (__response), \
50}
51
52struct sip_header {
53 const char *name;
54 const char *cname;
55 const char *search;
56 unsigned int len;
57 unsigned int clen;
58 unsigned int slen;
59 int (*match_len)(const struct nf_conn *ct,
60 const char *dptr, const char *limit,
61 int *shift);
62};
63
64#define __SIP_HDR(__name, __cname, __search, __match) \
65{ \
66 .name = (__name), \
67 .len = sizeof(__name) - 1, \
68 .cname = (__cname), \
69 .clen = (__cname) ? sizeof(__cname) - 1 : 0, \
70 .search = (__search), \
71 .slen = (__search) ? sizeof(__search) - 1 : 0, \
72 .match_len = (__match), \
73}
74
75#define SIP_HDR(__name, __cname, __search, __match) \
76 __SIP_HDR(__name, __cname, __search, __match)
77
78#define SDP_HDR(__name, __search, __match) \
79 __SIP_HDR(__name, NULL, __search, __match)
80
81enum sip_header_types {
82 SIP_HDR_CSEQ,
83 SIP_HDR_FROM,
84 SIP_HDR_TO,
85 SIP_HDR_CONTACT,
86 SIP_HDR_VIA,
87 SIP_HDR_EXPIRES,
88 SIP_HDR_CONTENT_LENGTH,
89};
90
91enum sdp_header_types {
92 SDP_HDR_UNSPEC,
93 SDP_HDR_VERSION,
94 SDP_HDR_OWNER_IP4,
95 SDP_HDR_CONNECTION_IP4,
96 SDP_HDR_OWNER_IP6,
97 SDP_HDR_CONNECTION_IP6,
98 SDP_HDR_MEDIA,
22}; 99};
23 100
24extern unsigned int (*nf_nat_sip_hook)(struct sk_buff *skb, 101extern unsigned int (*nf_nat_sip_hook)(struct sk_buff *skb,
25 enum ip_conntrack_info ctinfo, 102 const char **dptr,
26 struct nf_conn *ct, 103 unsigned int *datalen);
27 const char **dptr); 104extern unsigned int (*nf_nat_sip_expect_hook)(struct sk_buff *skb,
28extern unsigned int (*nf_nat_sdp_hook)(struct sk_buff *skb, 105 const char **dptr,
29 enum ip_conntrack_info ctinfo, 106 unsigned int *datalen,
30 struct nf_conntrack_expect *exp, 107 struct nf_conntrack_expect *exp,
31 const char *dptr); 108 unsigned int matchoff,
32 109 unsigned int matchlen);
33extern int ct_sip_get_info(const struct nf_conn *ct, const char *dptr, 110extern unsigned int (*nf_nat_sdp_addr_hook)(struct sk_buff *skb,
34 size_t dlen, unsigned int *matchoff, 111 const char **dptr,
35 unsigned int *matchlen, enum sip_header_pos pos); 112 unsigned int dataoff,
36extern int ct_sip_lnlen(const char *line, const char *limit); 113 unsigned int *datalen,
37extern const char *ct_sip_search(const char *needle, const char *haystack, 114 enum sdp_header_types type,
38 size_t needle_len, size_t haystack_len, 115 enum sdp_header_types term,
39 int case_sensitive); 116 const union nf_inet_addr *addr);
117extern unsigned int (*nf_nat_sdp_port_hook)(struct sk_buff *skb,
118 const char **dptr,
119 unsigned int *datalen,
120 unsigned int matchoff,
121 unsigned int matchlen,
122 u_int16_t port);
123extern unsigned int (*nf_nat_sdp_session_hook)(struct sk_buff *skb,
124 const char **dptr,
125 unsigned int dataoff,
126 unsigned int *datalen,
127 const union nf_inet_addr *addr);
128extern unsigned int (*nf_nat_sdp_media_hook)(struct sk_buff *skb,
129 const char **dptr,
130 unsigned int *datalen,
131 struct nf_conntrack_expect *rtp_exp,
132 struct nf_conntrack_expect *rtcp_exp,
133 unsigned int mediaoff,
134 unsigned int medialen,
135 union nf_inet_addr *rtp_addr);
136
137extern int ct_sip_parse_request(const struct nf_conn *ct,
138 const char *dptr, unsigned int datalen,
139 unsigned int *matchoff, unsigned int *matchlen,
140 union nf_inet_addr *addr, __be16 *port);
141extern int ct_sip_get_header(const struct nf_conn *ct, const char *dptr,
142 unsigned int dataoff, unsigned int datalen,
143 enum sip_header_types type,
144 unsigned int *matchoff, unsigned int *matchlen);
145extern int ct_sip_parse_header_uri(const struct nf_conn *ct, const char *dptr,
146 unsigned int *dataoff, unsigned int datalen,
147 enum sip_header_types type, int *in_header,
148 unsigned int *matchoff, unsigned int *matchlen,
149 union nf_inet_addr *addr, __be16 *port);
150extern int ct_sip_parse_address_param(const struct nf_conn *ct, const char *dptr,
151 unsigned int dataoff, unsigned int datalen,
152 const char *name,
153 unsigned int *matchoff, unsigned int *matchlen,
154 union nf_inet_addr *addr);
155extern int ct_sip_parse_numerical_param(const struct nf_conn *ct, const char *dptr,
156 unsigned int off, unsigned int datalen,
157 const char *name,
158 unsigned int *matchoff, unsigned int *matchen,
159 unsigned int *val);
160
161extern int ct_sip_get_sdp_header(const struct nf_conn *ct, const char *dptr,
162 unsigned int dataoff, unsigned int datalen,
163 enum sdp_header_types type,
164 enum sdp_header_types term,
165 unsigned int *matchoff, unsigned int *matchlen);
166
40#endif /* __KERNEL__ */ 167#endif /* __KERNEL__ */
41#endif /* __NF_CONNTRACK_SIP_H__ */ 168#endif /* __NF_CONNTRACK_SIP_H__ */
diff --git a/include/linux/netfilter/nfnetlink_conntrack.h b/include/linux/netfilter/nfnetlink_conntrack.h
index e3e1533aba2d..0a383ac083cb 100644
--- a/include/linux/netfilter/nfnetlink_conntrack.h
+++ b/include/linux/netfilter/nfnetlink_conntrack.h
@@ -80,6 +80,7 @@ enum ctattr_l4proto {
80enum ctattr_protoinfo { 80enum ctattr_protoinfo {
81 CTA_PROTOINFO_UNSPEC, 81 CTA_PROTOINFO_UNSPEC,
82 CTA_PROTOINFO_TCP, 82 CTA_PROTOINFO_TCP,
83 CTA_PROTOINFO_DCCP,
83 __CTA_PROTOINFO_MAX 84 __CTA_PROTOINFO_MAX
84}; 85};
85#define CTA_PROTOINFO_MAX (__CTA_PROTOINFO_MAX - 1) 86#define CTA_PROTOINFO_MAX (__CTA_PROTOINFO_MAX - 1)
@@ -95,6 +96,13 @@ enum ctattr_protoinfo_tcp {
95}; 96};
96#define CTA_PROTOINFO_TCP_MAX (__CTA_PROTOINFO_TCP_MAX - 1) 97#define CTA_PROTOINFO_TCP_MAX (__CTA_PROTOINFO_TCP_MAX - 1)
97 98
99enum ctattr_protoinfo_dccp {
100 CTA_PROTOINFO_DCCP_UNSPEC,
101 CTA_PROTOINFO_DCCP_STATE,
102 __CTA_PROTOINFO_DCCP_MAX,
103};
104#define CTA_PROTOINFO_DCCP_MAX (__CTA_PROTOINFO_DCCP_MAX - 1)
105
98enum ctattr_counters { 106enum ctattr_counters {
99 CTA_COUNTERS_UNSPEC, 107 CTA_COUNTERS_UNSPEC,
100 CTA_COUNTERS_PACKETS, /* old 64bit counters */ 108 CTA_COUNTERS_PACKETS, /* old 64bit counters */
diff --git a/include/linux/netfilter/x_tables.h b/include/linux/netfilter/x_tables.h
index b2c62cc618f5..2326296b6f25 100644
--- a/include/linux/netfilter/x_tables.h
+++ b/include/linux/netfilter/x_tables.h
@@ -430,13 +430,13 @@ extern int xt_compat_add_offset(int af, unsigned int offset, short delta);
430extern void xt_compat_flush_offsets(int af); 430extern void xt_compat_flush_offsets(int af);
431extern short xt_compat_calc_jump(int af, unsigned int offset); 431extern short xt_compat_calc_jump(int af, unsigned int offset);
432 432
433extern int xt_compat_match_offset(struct xt_match *match); 433extern int xt_compat_match_offset(const struct xt_match *match);
434extern int xt_compat_match_from_user(struct xt_entry_match *m, 434extern int xt_compat_match_from_user(struct xt_entry_match *m,
435 void **dstptr, unsigned int *size); 435 void **dstptr, unsigned int *size);
436extern int xt_compat_match_to_user(struct xt_entry_match *m, 436extern int xt_compat_match_to_user(struct xt_entry_match *m,
437 void __user **dstptr, unsigned int *size); 437 void __user **dstptr, unsigned int *size);
438 438
439extern int xt_compat_target_offset(struct xt_target *target); 439extern int xt_compat_target_offset(const struct xt_target *target);
440extern void xt_compat_target_from_user(struct xt_entry_target *t, 440extern void xt_compat_target_from_user(struct xt_entry_target *t,
441 void **dstptr, unsigned int *size); 441 void **dstptr, unsigned int *size);
442extern int xt_compat_target_to_user(struct xt_entry_target *t, 442extern int xt_compat_target_to_user(struct xt_entry_target *t,
diff --git a/include/linux/netfilter/xt_sctp.h b/include/linux/netfilter/xt_sctp.h
index dd5a4fd4cfd3..32000ba6ecef 100644
--- a/include/linux/netfilter/xt_sctp.h
+++ b/include/linux/netfilter/xt_sctp.h
@@ -37,68 +37,54 @@ struct xt_sctp_info {
37 37
38#define SCTP_CHUNKMAP_SET(chunkmap, type) \ 38#define SCTP_CHUNKMAP_SET(chunkmap, type) \
39 do { \ 39 do { \
40 chunkmap[type / bytes(u_int32_t)] |= \ 40 (chunkmap)[type / bytes(u_int32_t)] |= \
41 1 << (type % bytes(u_int32_t)); \ 41 1 << (type % bytes(u_int32_t)); \
42 } while (0) 42 } while (0)
43 43
44#define SCTP_CHUNKMAP_CLEAR(chunkmap, type) \ 44#define SCTP_CHUNKMAP_CLEAR(chunkmap, type) \
45 do { \ 45 do { \
46 chunkmap[type / bytes(u_int32_t)] &= \ 46 (chunkmap)[type / bytes(u_int32_t)] &= \
47 ~(1 << (type % bytes(u_int32_t))); \ 47 ~(1 << (type % bytes(u_int32_t))); \
48 } while (0) 48 } while (0)
49 49
50#define SCTP_CHUNKMAP_IS_SET(chunkmap, type) \ 50#define SCTP_CHUNKMAP_IS_SET(chunkmap, type) \
51({ \ 51({ \
52 (chunkmap[type / bytes (u_int32_t)] & \ 52 ((chunkmap)[type / bytes (u_int32_t)] & \
53 (1 << (type % bytes (u_int32_t)))) ? 1: 0; \ 53 (1 << (type % bytes (u_int32_t)))) ? 1: 0; \
54}) 54})
55 55
56#define SCTP_CHUNKMAP_RESET(chunkmap) \ 56#define SCTP_CHUNKMAP_RESET(chunkmap) \
57 do { \ 57 memset((chunkmap), 0, sizeof(chunkmap))
58 int i; \ 58
59 for (i = 0; i < ARRAY_SIZE(chunkmap); i++) \ 59#define SCTP_CHUNKMAP_SET_ALL(chunkmap) \
60 chunkmap[i] = 0; \ 60 memset((chunkmap), ~0U, sizeof(chunkmap))
61 } while (0) 61
62 62#define SCTP_CHUNKMAP_COPY(destmap, srcmap) \
63#define SCTP_CHUNKMAP_SET_ALL(chunkmap) \ 63 memcpy((destmap), (srcmap), sizeof(srcmap))
64 do { \ 64
65 int i; \ 65#define SCTP_CHUNKMAP_IS_CLEAR(chunkmap) \
66 for (i = 0; i < ARRAY_SIZE(chunkmap); i++) \ 66 __sctp_chunkmap_is_clear((chunkmap), ARRAY_SIZE(chunkmap))
67 chunkmap[i] = ~0; \ 67static inline bool
68 } while (0) 68__sctp_chunkmap_is_clear(const u_int32_t *chunkmap, unsigned int n)
69 69{
70#define SCTP_CHUNKMAP_COPY(destmap, srcmap) \ 70 unsigned int i;
71 do { \ 71 for (i = 0; i < n; ++i)
72 int i; \ 72 if (chunkmap[i])
73 for (i = 0; i < ARRAY_SIZE(srcmap); i++) \ 73 return false;
74 destmap[i] = srcmap[i]; \ 74 return true;
75 } while (0) 75}
76 76
77#define SCTP_CHUNKMAP_IS_CLEAR(chunkmap) \ 77#define SCTP_CHUNKMAP_IS_ALL_SET(chunkmap) \
78({ \ 78 __sctp_chunkmap_is_all_set((chunkmap), ARRAY_SIZE(chunkmap))
79 int i; \ 79static inline bool
80 int flag = 1; \ 80__sctp_chunkmap_is_all_set(const u_int32_t *chunkmap, unsigned int n)
81 for (i = 0; i < ARRAY_SIZE(chunkmap); i++) { \ 81{
82 if (chunkmap[i]) { \ 82 unsigned int i;
83 flag = 0; \ 83 for (i = 0; i < n; ++i)
84 break; \ 84 if (chunkmap[i] != ~0U)
85 } \ 85 return false;
86 } \ 86 return true;
87 flag; \ 87}
88})
89
90#define SCTP_CHUNKMAP_IS_ALL_SET(chunkmap) \
91({ \
92 int i; \
93 int flag = 1; \
94 for (i = 0; i < ARRAY_SIZE(chunkmap); i++) { \
95 if (chunkmap[i] != ~0) { \
96 flag = 0; \
97 break; \
98 } \
99 } \
100 flag; \
101})
102 88
103#endif /* _XT_SCTP_H_ */ 89#endif /* _XT_SCTP_H_ */
104 90
diff --git a/include/linux/netfilter_arp/arp_tables.h b/include/linux/netfilter_arp/arp_tables.h
index db223ca92c8b..dd9c97f2d436 100644
--- a/include/linux/netfilter_arp/arp_tables.h
+++ b/include/linux/netfilter_arp/arp_tables.h
@@ -23,8 +23,6 @@
23 23
24#define ARPT_FUNCTION_MAXNAMELEN XT_FUNCTION_MAXNAMELEN 24#define ARPT_FUNCTION_MAXNAMELEN XT_FUNCTION_MAXNAMELEN
25#define ARPT_TABLE_MAXNAMELEN XT_TABLE_MAXNAMELEN 25#define ARPT_TABLE_MAXNAMELEN XT_TABLE_MAXNAMELEN
26#define arpt_target xt_target
27#define arpt_table xt_table
28 26
29#define ARPT_DEV_ADDR_LEN_MAX 16 27#define ARPT_DEV_ADDR_LEN_MAX 16
30 28
@@ -266,20 +264,15 @@ struct arpt_error
266 .target.errorname = "ERROR", \ 264 .target.errorname = "ERROR", \
267} 265}
268 266
269#define arpt_register_target(tgt) \ 267extern struct xt_table *arpt_register_table(struct net *net,
270({ (tgt)->family = NF_ARP; \ 268 struct xt_table *table,
271 xt_register_target(tgt); }) 269 const struct arpt_replace *repl);
272#define arpt_unregister_target(tgt) xt_unregister_target(tgt) 270extern void arpt_unregister_table(struct xt_table *table);
273
274extern struct arpt_table *arpt_register_table(struct net *net,
275 struct arpt_table *table,
276 const struct arpt_replace *repl);
277extern void arpt_unregister_table(struct arpt_table *table);
278extern unsigned int arpt_do_table(struct sk_buff *skb, 271extern unsigned int arpt_do_table(struct sk_buff *skb,
279 unsigned int hook, 272 unsigned int hook,
280 const struct net_device *in, 273 const struct net_device *in,
281 const struct net_device *out, 274 const struct net_device *out,
282 struct arpt_table *table); 275 struct xt_table *table);
283 276
284#define ARPT_ALIGN(s) XT_ALIGN(s) 277#define ARPT_ALIGN(s) XT_ALIGN(s)
285 278
diff --git a/include/linux/netfilter_bridge/ebt_nflog.h b/include/linux/netfilter_bridge/ebt_nflog.h
new file mode 100644
index 000000000000..052817849b83
--- /dev/null
+++ b/include/linux/netfilter_bridge/ebt_nflog.h
@@ -0,0 +1,21 @@
1#ifndef __LINUX_BRIDGE_EBT_NFLOG_H
2#define __LINUX_BRIDGE_EBT_NFLOG_H
3
4#define EBT_NFLOG_MASK 0x0
5
6#define EBT_NFLOG_PREFIX_SIZE 64
7#define EBT_NFLOG_WATCHER "nflog"
8
9#define EBT_NFLOG_DEFAULT_GROUP 0x1
10#define EBT_NFLOG_DEFAULT_THRESHOLD 1
11
12struct ebt_nflog_info {
13 u_int32_t len;
14 u_int16_t group;
15 u_int16_t threshold;
16 u_int16_t flags;
17 u_int16_t pad;
18 char prefix[EBT_NFLOG_PREFIX_SIZE];
19};
20
21#endif /* __LINUX_BRIDGE_EBT_NFLOG_H */
diff --git a/include/linux/netfilter_ipv4.h b/include/linux/netfilter_ipv4.h
index 9a10092e358c..650318b0c405 100644
--- a/include/linux/netfilter_ipv4.h
+++ b/include/linux/netfilter_ipv4.h
@@ -62,8 +62,6 @@ enum nf_ip_hook_priorities {
62 NF_IP_PRI_FILTER = 0, 62 NF_IP_PRI_FILTER = 0,
63 NF_IP_PRI_NAT_SRC = 100, 63 NF_IP_PRI_NAT_SRC = 100,
64 NF_IP_PRI_SELINUX_LAST = 225, 64 NF_IP_PRI_SELINUX_LAST = 225,
65 NF_IP_PRI_CONNTRACK_HELPER = INT_MAX - 2,
66 NF_IP_PRI_NAT_SEQ_ADJUST = INT_MAX - 1,
67 NF_IP_PRI_CONNTRACK_CONFIRM = INT_MAX, 65 NF_IP_PRI_CONNTRACK_CONFIRM = INT_MAX,
68 NF_IP_PRI_LAST = INT_MAX, 66 NF_IP_PRI_LAST = INT_MAX,
69}; 67};
diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h
index 9fecf902419c..ea6517e58b04 100644
--- a/include/linux/nl80211.h
+++ b/include/linux/nl80211.h
@@ -78,6 +78,18 @@
78 * or, if no MAC address given, all stations, on the interface identified 78 * or, if no MAC address given, all stations, on the interface identified
79 * by %NL80211_ATTR_IFINDEX. 79 * by %NL80211_ATTR_IFINDEX.
80 * 80 *
81 * @NL80211_CMD_GET_MPATH: Get mesh path attributes for mesh path to
82 * destination %NL80211_ATTR_MAC on the interface identified by
83 * %NL80211_ATTR_IFINDEX.
84 * @NL80211_CMD_SET_MPATH: Set mesh path attributes for mesh path to
85 * destination %NL80211_ATTR_MAC on the interface identified by
86 * %NL80211_ATTR_IFINDEX.
87 * @NL80211_CMD_NEW_PATH: Add a mesh path with given attributes to the
88 * the interface identified by %NL80211_ATTR_IFINDEX.
89 * @NL80211_CMD_DEL_PATH: Remove a mesh path identified by %NL80211_ATTR_MAC
90 * or, if no MAC address given, all mesh paths, on the interface identified
91 * by %NL80211_ATTR_IFINDEX.
92 *
81 * @NL80211_CMD_MAX: highest used command number 93 * @NL80211_CMD_MAX: highest used command number
82 * @__NL80211_CMD_AFTER_LAST: internal use 94 * @__NL80211_CMD_AFTER_LAST: internal use
83 */ 95 */
@@ -112,6 +124,11 @@ enum nl80211_commands {
112 124
113 /* add commands here */ 125 /* add commands here */
114 126
127 NL80211_CMD_GET_MPATH,
128 NL80211_CMD_SET_MPATH,
129 NL80211_CMD_NEW_MPATH,
130 NL80211_CMD_DEL_MPATH,
131
115 /* used to define NL80211_CMD_MAX below */ 132 /* used to define NL80211_CMD_MAX below */
116 __NL80211_CMD_AFTER_LAST, 133 __NL80211_CMD_AFTER_LAST,
117 NL80211_CMD_MAX = __NL80211_CMD_AFTER_LAST - 1 134 NL80211_CMD_MAX = __NL80211_CMD_AFTER_LAST - 1
@@ -157,9 +174,23 @@ enum nl80211_commands {
157 * restriction (at most %NL80211_MAX_SUPP_RATES). 174 * restriction (at most %NL80211_MAX_SUPP_RATES).
158 * @NL80211_ATTR_STA_VLAN: interface index of VLAN interface to move station 175 * @NL80211_ATTR_STA_VLAN: interface index of VLAN interface to move station
159 * to, or the AP interface the station was originally added to to. 176 * to, or the AP interface the station was originally added to to.
160 * @NL80211_ATTR_STA_STATS: statistics for a station, part of station info 177 * @NL80211_ATTR_STA_INFO: information about a station, part of station info
161 * given for %NL80211_CMD_GET_STATION, nested attribute containing 178 * given for %NL80211_CMD_GET_STATION, nested attribute containing
162 * info as possible, see &enum nl80211_sta_stats. 179 * info as possible, see &enum nl80211_sta_info.
180 *
181 * @NL80211_ATTR_WIPHY_BANDS: Information about an operating bands,
182 * consisting of a nested array.
183 *
184 * @NL80211_ATTR_MESH_ID: mesh id (1-32 bytes).
185 * @NL80211_ATTR_PLINK_ACTION: action to perform on the mesh peer link.
186 * @NL80211_ATTR_MPATH_NEXT_HOP: MAC address of the next hop for a mesh path.
187 * @NL80211_ATTR_MPATH_INFO: information about a mesh_path, part of mesh path
188 * info given for %NL80211_CMD_GET_MPATH, nested attribute described at
189 * &enum nl80211_mpath_info.
190 *
191 *
192 * @NL80211_ATTR_MNTR_FLAGS: flags, nested element with NLA_FLAG attributes of
193 * &enum nl80211_mntr_flags.
163 * 194 *
164 * @NL80211_ATTR_MAX: highest attribute number currently defined 195 * @NL80211_ATTR_MAX: highest attribute number currently defined
165 * @__NL80211_ATTR_AFTER_LAST: internal use 196 * @__NL80211_ATTR_AFTER_LAST: internal use
@@ -193,10 +224,19 @@ enum nl80211_attrs {
193 NL80211_ATTR_STA_LISTEN_INTERVAL, 224 NL80211_ATTR_STA_LISTEN_INTERVAL,
194 NL80211_ATTR_STA_SUPPORTED_RATES, 225 NL80211_ATTR_STA_SUPPORTED_RATES,
195 NL80211_ATTR_STA_VLAN, 226 NL80211_ATTR_STA_VLAN,
196 NL80211_ATTR_STA_STATS, 227 NL80211_ATTR_STA_INFO,
228
229 NL80211_ATTR_WIPHY_BANDS,
230
231 NL80211_ATTR_MNTR_FLAGS,
197 232
198 /* add attributes here, update the policy in nl80211.c */ 233 /* add attributes here, update the policy in nl80211.c */
199 234
235 NL80211_ATTR_MESH_ID,
236 NL80211_ATTR_STA_PLINK_ACTION,
237 NL80211_ATTR_MPATH_NEXT_HOP,
238 NL80211_ATTR_MPATH_INFO,
239
200 __NL80211_ATTR_AFTER_LAST, 240 __NL80211_ATTR_AFTER_LAST,
201 NL80211_ATTR_MAX = __NL80211_ATTR_AFTER_LAST - 1 241 NL80211_ATTR_MAX = __NL80211_ATTR_AFTER_LAST - 1
202}; 242};
@@ -213,6 +253,7 @@ enum nl80211_attrs {
213 * @NL80211_IFTYPE_AP_VLAN: VLAN interface for access points 253 * @NL80211_IFTYPE_AP_VLAN: VLAN interface for access points
214 * @NL80211_IFTYPE_WDS: wireless distribution interface 254 * @NL80211_IFTYPE_WDS: wireless distribution interface
215 * @NL80211_IFTYPE_MONITOR: monitor interface receiving all frames 255 * @NL80211_IFTYPE_MONITOR: monitor interface receiving all frames
256 * @NL80211_IFTYPE_MESH_POINT: mesh point
216 * @NL80211_IFTYPE_MAX: highest interface type number currently defined 257 * @NL80211_IFTYPE_MAX: highest interface type number currently defined
217 * @__NL80211_IFTYPE_AFTER_LAST: internal use 258 * @__NL80211_IFTYPE_AFTER_LAST: internal use
218 * 259 *
@@ -228,6 +269,7 @@ enum nl80211_iftype {
228 NL80211_IFTYPE_AP_VLAN, 269 NL80211_IFTYPE_AP_VLAN,
229 NL80211_IFTYPE_WDS, 270 NL80211_IFTYPE_WDS,
230 NL80211_IFTYPE_MONITOR, 271 NL80211_IFTYPE_MONITOR,
272 NL80211_IFTYPE_MESH_POINT,
231 273
232 /* keep last */ 274 /* keep last */
233 __NL80211_IFTYPE_AFTER_LAST, 275 __NL80211_IFTYPE_AFTER_LAST,
@@ -257,27 +299,167 @@ enum nl80211_sta_flags {
257}; 299};
258 300
259/** 301/**
260 * enum nl80211_sta_stats - station statistics 302 * enum nl80211_sta_info - station information
261 * 303 *
262 * These attribute types are used with %NL80211_ATTR_STA_STATS 304 * These attribute types are used with %NL80211_ATTR_STA_INFO
263 * when getting information about a station. 305 * when getting information about a station.
264 * 306 *
265 * @__NL80211_STA_STAT_INVALID: attribute number 0 is reserved 307 * @__NL80211_STA_INFO_INVALID: attribute number 0 is reserved
266 * @NL80211_STA_STAT_INACTIVE_TIME: time since last activity (u32, msecs) 308 * @NL80211_STA_INFO_INACTIVE_TIME: time since last activity (u32, msecs)
267 * @NL80211_STA_STAT_RX_BYTES: total received bytes (u32, from this station) 309 * @NL80211_STA_INFO_RX_BYTES: total received bytes (u32, from this station)
268 * @NL80211_STA_STAT_TX_BYTES: total transmitted bytes (u32, to this station) 310 * @NL80211_STA_INFO_TX_BYTES: total transmitted bytes (u32, to this station)
269 * @__NL80211_STA_STAT_AFTER_LAST: internal 311 * @__NL80211_STA_INFO_AFTER_LAST: internal
270 * @NL80211_STA_STAT_MAX: highest possible station stats attribute 312 * @NL80211_STA_INFO_MAX: highest possible station info attribute
313 */
314enum nl80211_sta_info {
315 __NL80211_STA_INFO_INVALID,
316 NL80211_STA_INFO_INACTIVE_TIME,
317 NL80211_STA_INFO_RX_BYTES,
318 NL80211_STA_INFO_TX_BYTES,
319 NL80211_STA_INFO_LLID,
320 NL80211_STA_INFO_PLID,
321 NL80211_STA_INFO_PLINK_STATE,
322
323 /* keep last */
324 __NL80211_STA_INFO_AFTER_LAST,
325 NL80211_STA_INFO_MAX = __NL80211_STA_INFO_AFTER_LAST - 1
326};
327
328/**
329 * enum nl80211_mpath_flags - nl80211 mesh path flags
330 *
331 * @NL80211_MPATH_FLAG_ACTIVE: the mesh path is active
332 * @NL80211_MPATH_FLAG_RESOLVING: the mesh path discovery process is running
333 * @NL80211_MPATH_FLAG_DSN_VALID: the mesh path contains a valid DSN
334 * @NL80211_MPATH_FLAG_FIXED: the mesh path has been manually set
335 * @NL80211_MPATH_FLAG_RESOLVED: the mesh path discovery process succeeded
336 */
337enum nl80211_mpath_flags {
338 NL80211_MPATH_FLAG_ACTIVE = 1<<0,
339 NL80211_MPATH_FLAG_RESOLVING = 1<<1,
340 NL80211_MPATH_FLAG_DSN_VALID = 1<<2,
341 NL80211_MPATH_FLAG_FIXED = 1<<3,
342 NL80211_MPATH_FLAG_RESOLVED = 1<<4,
343};
344
345/**
346 * enum nl80211_mpath_info - mesh path information
347 *
348 * These attribute types are used with %NL80211_ATTR_MPATH_INFO when getting
349 * information about a mesh path.
350 *
351 * @__NL80211_MPATH_INFO_INVALID: attribute number 0 is reserved
352 * @NL80211_ATTR_MPATH_FRAME_QLEN: number of queued frames for this destination
353 * @NL80211_ATTR_MPATH_DSN: destination sequence number
354 * @NL80211_ATTR_MPATH_METRIC: metric (cost) of this mesh path
355 * @NL80211_ATTR_MPATH_EXPTIME: expiration time for the path, in msec from now
356 * @NL80211_ATTR_MPATH_FLAGS: mesh path flags, enumerated in
357 * &enum nl80211_mpath_flags;
358 * @NL80211_ATTR_MPATH_DISCOVERY_TIMEOUT: total path discovery timeout, in msec
359 * @NL80211_ATTR_MPATH_DISCOVERY_RETRIES: mesh path discovery retries
360 */
361enum nl80211_mpath_info {
362 __NL80211_MPATH_INFO_INVALID,
363 NL80211_MPATH_INFO_FRAME_QLEN,
364 NL80211_MPATH_INFO_DSN,
365 NL80211_MPATH_INFO_METRIC,
366 NL80211_MPATH_INFO_EXPTIME,
367 NL80211_MPATH_INFO_FLAGS,
368 NL80211_MPATH_INFO_DISCOVERY_TIMEOUT,
369 NL80211_MPATH_INFO_DISCOVERY_RETRIES,
370
371 /* keep last */
372 __NL80211_MPATH_INFO_AFTER_LAST,
373 NL80211_MPATH_INFO_MAX = __NL80211_MPATH_INFO_AFTER_LAST - 1
374};
375
376/**
377 * enum nl80211_band_attr - band attributes
378 * @__NL80211_BAND_ATTR_INVALID: attribute number 0 is reserved
379 * @NL80211_BAND_ATTR_FREQS: supported frequencies in this band,
380 * an array of nested frequency attributes
381 * @NL80211_BAND_ATTR_RATES: supported bitrates in this band,
382 * an array of nested bitrate attributes
383 */
384enum nl80211_band_attr {
385 __NL80211_BAND_ATTR_INVALID,
386 NL80211_BAND_ATTR_FREQS,
387 NL80211_BAND_ATTR_RATES,
388
389 /* keep last */
390 __NL80211_BAND_ATTR_AFTER_LAST,
391 NL80211_BAND_ATTR_MAX = __NL80211_BAND_ATTR_AFTER_LAST - 1
392};
393
394/**
395 * enum nl80211_frequency_attr - frequency attributes
396 * @NL80211_FREQUENCY_ATTR_FREQ: Frequency in MHz
397 * @NL80211_FREQUENCY_ATTR_DISABLED: Channel is disabled in current
398 * regulatory domain.
399 * @NL80211_FREQUENCY_ATTR_PASSIVE_SCAN: Only passive scanning is
400 * permitted on this channel in current regulatory domain.
401 * @NL80211_FREQUENCY_ATTR_NO_IBSS: IBSS networks are not permitted
402 * on this channel in current regulatory domain.
403 * @NL80211_FREQUENCY_ATTR_RADAR: Radar detection is mandatory
404 * on this channel in current regulatory domain.
405 */
406enum nl80211_frequency_attr {
407 __NL80211_FREQUENCY_ATTR_INVALID,
408 NL80211_FREQUENCY_ATTR_FREQ,
409 NL80211_FREQUENCY_ATTR_DISABLED,
410 NL80211_FREQUENCY_ATTR_PASSIVE_SCAN,
411 NL80211_FREQUENCY_ATTR_NO_IBSS,
412 NL80211_FREQUENCY_ATTR_RADAR,
413
414 /* keep last */
415 __NL80211_FREQUENCY_ATTR_AFTER_LAST,
416 NL80211_FREQUENCY_ATTR_MAX = __NL80211_FREQUENCY_ATTR_AFTER_LAST - 1
417};
418
419/**
420 * enum nl80211_bitrate_attr - bitrate attributes
421 * @NL80211_BITRATE_ATTR_RATE: Bitrate in units of 100 kbps
422 * @NL80211_BITRATE_ATTR_2GHZ_SHORTPREAMBLE: Short preamble supported
423 * in 2.4 GHz band.
424 */
425enum nl80211_bitrate_attr {
426 __NL80211_BITRATE_ATTR_INVALID,
427 NL80211_BITRATE_ATTR_RATE,
428 NL80211_BITRATE_ATTR_2GHZ_SHORTPREAMBLE,
429
430 /* keep last */
431 __NL80211_BITRATE_ATTR_AFTER_LAST,
432 NL80211_BITRATE_ATTR_MAX = __NL80211_BITRATE_ATTR_AFTER_LAST - 1
433};
434
435/**
436 * enum nl80211_mntr_flags - monitor configuration flags
437 *
438 * Monitor configuration flags.
439 *
440 * @__NL80211_MNTR_FLAG_INVALID: reserved
441 *
442 * @NL80211_MNTR_FLAG_FCSFAIL: pass frames with bad FCS
443 * @NL80211_MNTR_FLAG_PLCPFAIL: pass frames with bad PLCP
444 * @NL80211_MNTR_FLAG_CONTROL: pass control frames
445 * @NL80211_MNTR_FLAG_OTHER_BSS: disable BSSID filtering
446 * @NL80211_MNTR_FLAG_COOK_FRAMES: report frames after processing.
447 * overrides all other flags.
448 *
449 * @__NL80211_MNTR_FLAG_AFTER_LAST: internal use
450 * @NL80211_MNTR_FLAG_MAX: highest possible monitor flag
271 */ 451 */
272enum nl80211_sta_stats { 452enum nl80211_mntr_flags {
273 __NL80211_STA_STAT_INVALID, 453 __NL80211_MNTR_FLAG_INVALID,
274 NL80211_STA_STAT_INACTIVE_TIME, 454 NL80211_MNTR_FLAG_FCSFAIL,
275 NL80211_STA_STAT_RX_BYTES, 455 NL80211_MNTR_FLAG_PLCPFAIL,
276 NL80211_STA_STAT_TX_BYTES, 456 NL80211_MNTR_FLAG_CONTROL,
457 NL80211_MNTR_FLAG_OTHER_BSS,
458 NL80211_MNTR_FLAG_COOK_FRAMES,
277 459
278 /* keep last */ 460 /* keep last */
279 __NL80211_STA_STAT_AFTER_LAST, 461 __NL80211_MNTR_FLAG_AFTER_LAST,
280 NL80211_STA_STAT_MAX = __NL80211_STA_STAT_AFTER_LAST - 1 462 NL80211_MNTR_FLAG_MAX = __NL80211_MNTR_FLAG_AFTER_LAST - 1
281}; 463};
282 464
283#endif /* __LINUX_NL80211_H */ 465#endif /* __LINUX_NL80211_H */
diff --git a/include/linux/of.h b/include/linux/of.h
index 6981016dcc25..59a61bdc98b6 100644
--- a/include/linux/of.h
+++ b/include/linux/of.h
@@ -62,6 +62,7 @@ extern struct property *of_find_property(const struct device_node *np,
62 int *lenp); 62 int *lenp);
63extern int of_device_is_compatible(const struct device_node *device, 63extern int of_device_is_compatible(const struct device_node *device,
64 const char *); 64 const char *);
65extern int of_device_is_available(const struct device_node *device);
65extern const void *of_get_property(const struct device_node *node, 66extern const void *of_get_property(const struct device_node *node,
66 const char *name, 67 const char *name,
67 int *lenp); 68 int *lenp);
diff --git a/include/linux/of_gpio.h b/include/linux/of_gpio.h
new file mode 100644
index 000000000000..2ee97e9877a7
--- /dev/null
+++ b/include/linux/of_gpio.h
@@ -0,0 +1,69 @@
1/*
2 * OF helpers for the GPIO API
3 *
4 * Copyright (c) 2007-2008 MontaVista Software, Inc.
5 *
6 * Author: Anton Vorontsov <avorontsov@ru.mvista.com>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 */
13
14#ifndef __LINUX_OF_GPIO_H
15#define __LINUX_OF_GPIO_H
16
17#include <linux/errno.h>
18#include <asm/gpio.h>
19
20#ifdef CONFIG_OF_GPIO
21
22/*
23 * Generic OF GPIO chip
24 */
25struct of_gpio_chip {
26 struct gpio_chip gc;
27 int gpio_cells;
28 int (*xlate)(struct of_gpio_chip *of_gc, struct device_node *np,
29 const void *gpio_spec);
30};
31
32static inline struct of_gpio_chip *to_of_gpio_chip(struct gpio_chip *gc)
33{
34 return container_of(gc, struct of_gpio_chip, gc);
35}
36
37/*
38 * OF GPIO chip for memory mapped banks
39 */
40struct of_mm_gpio_chip {
41 struct of_gpio_chip of_gc;
42 void (*save_regs)(struct of_mm_gpio_chip *mm_gc);
43 void __iomem *regs;
44};
45
46static inline struct of_mm_gpio_chip *to_of_mm_gpio_chip(struct gpio_chip *gc)
47{
48 struct of_gpio_chip *of_gc = to_of_gpio_chip(gc);
49
50 return container_of(of_gc, struct of_mm_gpio_chip, of_gc);
51}
52
53extern int of_get_gpio(struct device_node *np, int index);
54extern int of_mm_gpiochip_add(struct device_node *np,
55 struct of_mm_gpio_chip *mm_gc);
56extern int of_gpio_simple_xlate(struct of_gpio_chip *of_gc,
57 struct device_node *np,
58 const void *gpio_spec);
59#else
60
61/* Drivers may not strictly depend on the GPIO support, so let them link. */
62static inline int of_get_gpio(struct device_node *np, int index)
63{
64 return -ENOSYS;
65}
66
67#endif /* CONFIG_OF_GPIO */
68
69#endif /* __LINUX_OF_GPIO_H */
diff --git a/include/linux/of_i2c.h b/include/linux/of_i2c.h
new file mode 100644
index 000000000000..2e5a96732042
--- /dev/null
+++ b/include/linux/of_i2c.h
@@ -0,0 +1,24 @@
1/*
2 * Generic I2C API implementation for PowerPC.
3 *
4 * Copyright (c) 2008 Jochen Friedrich <jochen@scram.de>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 */
11
12#ifndef __LINUX_OF_I2C_H
13#define __LINUX_OF_I2C_H
14
15#include <linux/i2c.h>
16
17#ifdef CONFIG_OF_I2C
18
19void of_register_i2c_devices(struct i2c_adapter *adap,
20 struct device_node *adap_node);
21
22#endif /* CONFIG_OF_I2C */
23
24#endif /* __LINUX_OF_I2C_H */
diff --git a/include/linux/parport.h b/include/linux/parport.h
index d1ad546c8c9e..dcb9e01a69ca 100644
--- a/include/linux/parport.h
+++ b/include/linux/parport.h
@@ -101,9 +101,9 @@ typedef enum {
101#include <linux/spinlock.h> 101#include <linux/spinlock.h>
102#include <linux/wait.h> 102#include <linux/wait.h>
103#include <linux/irqreturn.h> 103#include <linux/irqreturn.h>
104#include <linux/semaphore.h>
104#include <asm/system.h> 105#include <asm/system.h>
105#include <asm/ptrace.h> 106#include <asm/ptrace.h>
106#include <asm/semaphore.h>
107 107
108/* Define this later. */ 108/* Define this later. */
109struct parport; 109struct parport;
diff --git a/include/linux/pci-aspm.h b/include/linux/pci-aspm.h
new file mode 100644
index 000000000000..a1a1e618e996
--- /dev/null
+++ b/include/linux/pci-aspm.h
@@ -0,0 +1,56 @@
1/*
2 * aspm.h
3 *
4 * PCI Express ASPM defines and function prototypes
5 *
6 * Copyright (C) 2007 Intel Corp.
7 * Zhang Yanmin (yanmin.zhang@intel.com)
8 * Shaohua Li (shaohua.li@intel.com)
9 *
10 * For more information, please consult the following manuals (look at
11 * http://www.pcisig.com/ for how to get them):
12 *
13 * PCI Express Specification
14 */
15
16#ifndef LINUX_ASPM_H
17#define LINUX_ASPM_H
18
19#include <linux/pci.h>
20
21#define PCIE_LINK_STATE_L0S 1
22#define PCIE_LINK_STATE_L1 2
23#define PCIE_LINK_STATE_CLKPM 4
24
25#ifdef CONFIG_PCIEASPM
26extern void pcie_aspm_init_link_state(struct pci_dev *pdev);
27extern void pcie_aspm_exit_link_state(struct pci_dev *pdev);
28extern void pcie_aspm_pm_state_change(struct pci_dev *pdev);
29extern void pci_disable_link_state(struct pci_dev *pdev, int state);
30#else
31static inline void pcie_aspm_init_link_state(struct pci_dev *pdev)
32{
33}
34static inline void pcie_aspm_exit_link_state(struct pci_dev *pdev)
35{
36}
37static inline void pcie_aspm_pm_state_change(struct pci_dev *pdev)
38{
39}
40static inline void pci_disable_link_state(struct pci_dev *pdev, int state)
41{
42}
43#endif
44
45#ifdef CONFIG_PCIEASPM_DEBUG /* this depends on CONFIG_PCIEASPM */
46extern void pcie_aspm_create_sysfs_dev_files(struct pci_dev *pdev);
47extern void pcie_aspm_remove_sysfs_dev_files(struct pci_dev *pdev);
48#else
49static inline void pcie_aspm_create_sysfs_dev_files(struct pci_dev *pdev)
50{
51}
52static inline void pcie_aspm_remove_sysfs_dev_files(struct pci_dev *pdev)
53{
54}
55#endif
56#endif /* LINUX_ASPM_H */
diff --git a/include/linux/pci.h b/include/linux/pci.h
index ea760e519c46..292491324b01 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -20,6 +20,8 @@
20/* Include the pci register defines */ 20/* Include the pci register defines */
21#include <linux/pci_regs.h> 21#include <linux/pci_regs.h>
22 22
23struct pci_vpd;
24
23/* 25/*
24 * The PCI interface treats multi-function devices as independent 26 * The PCI interface treats multi-function devices as independent
25 * devices. The slot/function address of each device is encoded 27 * devices. The slot/function address of each device is encoded
@@ -128,11 +130,11 @@ struct pci_cap_saved_state {
128 u32 data[0]; 130 u32 data[0];
129}; 131};
130 132
133struct pcie_link_state;
131/* 134/*
132 * The pci_dev structure is used to describe PCI devices. 135 * The pci_dev structure is used to describe PCI devices.
133 */ 136 */
134struct pci_dev { 137struct pci_dev {
135 struct list_head global_list; /* node in list of all PCI devices */
136 struct list_head bus_list; /* node in per-bus list */ 138 struct list_head bus_list; /* node in per-bus list */
137 struct pci_bus *bus; /* bus this device is on */ 139 struct pci_bus *bus; /* bus this device is on */
138 struct pci_bus *subordinate; /* bus this device bridges to */ 140 struct pci_bus *subordinate; /* bus this device bridges to */
@@ -165,6 +167,10 @@ struct pci_dev {
165 this is D0-D3, D0 being fully functional, 167 this is D0-D3, D0 being fully functional,
166 and D3 being off. */ 168 and D3 being off. */
167 169
170#ifdef CONFIG_PCIEASPM
171 struct pcie_link_state *link_state; /* ASPM link state. */
172#endif
173
168 pci_channel_state_t error_state; /* current connectivity state */ 174 pci_channel_state_t error_state; /* current connectivity state */
169 struct device dev; /* Generic device interface */ 175 struct device dev; /* Generic device interface */
170 176
@@ -181,6 +187,7 @@ struct pci_dev {
181 unsigned int transparent:1; /* Transparent PCI bridge */ 187 unsigned int transparent:1; /* Transparent PCI bridge */
182 unsigned int multifunction:1;/* Part of multi-function device */ 188 unsigned int multifunction:1;/* Part of multi-function device */
183 /* keep track of device state */ 189 /* keep track of device state */
190 unsigned int is_added:1;
184 unsigned int is_busmaster:1; /* device is busmaster */ 191 unsigned int is_busmaster:1; /* device is busmaster */
185 unsigned int no_msi:1; /* device may not use msi */ 192 unsigned int no_msi:1; /* device may not use msi */
186 unsigned int no_d1d2:1; /* only allow d0 or d3 */ 193 unsigned int no_d1d2:1; /* only allow d0 or d3 */
@@ -201,11 +208,11 @@ struct pci_dev {
201#ifdef CONFIG_PCI_MSI 208#ifdef CONFIG_PCI_MSI
202 struct list_head msi_list; 209 struct list_head msi_list;
203#endif 210#endif
211 struct pci_vpd *vpd;
204}; 212};
205 213
206extern struct pci_dev *alloc_pci_dev(void); 214extern struct pci_dev *alloc_pci_dev(void);
207 215
208#define pci_dev_g(n) list_entry(n, struct pci_dev, global_list)
209#define pci_dev_b(n) list_entry(n, struct pci_dev, bus_list) 216#define pci_dev_b(n) list_entry(n, struct pci_dev, bus_list)
210#define to_pci_dev(n) container_of(n, struct pci_dev, dev) 217#define to_pci_dev(n) container_of(n, struct pci_dev, dev)
211#define for_each_pci_dev(d) while ((d = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, d)) != NULL) 218#define for_each_pci_dev(d) while ((d = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, d)) != NULL)
@@ -449,7 +456,6 @@ extern struct bus_type pci_bus_type;
449/* Do NOT directly access these two variables, unless you are arch specific pci 456/* Do NOT directly access these two variables, unless you are arch specific pci
450 * code, or pci core code. */ 457 * code, or pci core code. */
451extern struct list_head pci_root_buses; /* list of all known PCI buses */ 458extern struct list_head pci_root_buses; /* list of all known PCI buses */
452extern struct list_head pci_devices; /* list of all devices */
453/* Some device drivers need know if pci is initiated */ 459/* Some device drivers need know if pci is initiated */
454extern int no_pci_devices(void); 460extern int no_pci_devices(void);
455 461
@@ -517,17 +523,13 @@ struct pci_bus *pci_find_next_bus(const struct pci_bus *from);
517 523
518struct pci_dev *pci_get_device(unsigned int vendor, unsigned int device, 524struct pci_dev *pci_get_device(unsigned int vendor, unsigned int device,
519 struct pci_dev *from); 525 struct pci_dev *from);
520struct pci_dev *pci_get_device_reverse(unsigned int vendor, unsigned int device,
521 struct pci_dev *from);
522
523struct pci_dev *pci_get_subsys(unsigned int vendor, unsigned int device, 526struct pci_dev *pci_get_subsys(unsigned int vendor, unsigned int device,
524 unsigned int ss_vendor, unsigned int ss_device, 527 unsigned int ss_vendor, unsigned int ss_device,
525 struct pci_dev *from); 528 const struct pci_dev *from);
526struct pci_dev *pci_get_slot(struct pci_bus *bus, unsigned int devfn); 529struct pci_dev *pci_get_slot(struct pci_bus *bus, unsigned int devfn);
527struct pci_dev *pci_get_bus_and_slot(unsigned int bus, unsigned int devfn); 530struct pci_dev *pci_get_bus_and_slot(unsigned int bus, unsigned int devfn);
528struct pci_dev *pci_get_class(unsigned int class, struct pci_dev *from); 531struct pci_dev *pci_get_class(unsigned int class, struct pci_dev *from);
529int pci_dev_present(const struct pci_device_id *ids); 532int pci_dev_present(const struct pci_device_id *ids);
530const struct pci_device_id *pci_find_present(const struct pci_device_id *ids);
531 533
532int pci_bus_read_config_byte(struct pci_bus *bus, unsigned int devfn, 534int pci_bus_read_config_byte(struct pci_bus *bus, unsigned int devfn,
533 int where, u8 *val); 535 int where, u8 *val);
@@ -601,7 +603,6 @@ int pcie_get_readrq(struct pci_dev *dev);
601int pcie_set_readrq(struct pci_dev *dev, int rq); 603int pcie_set_readrq(struct pci_dev *dev, int rq);
602void pci_update_resource(struct pci_dev *dev, struct resource *res, int resno); 604void pci_update_resource(struct pci_dev *dev, struct resource *res, int resno);
603int __must_check pci_assign_resource(struct pci_dev *dev, int i); 605int __must_check pci_assign_resource(struct pci_dev *dev, int i);
604int __must_check pci_assign_resource_fixed(struct pci_dev *dev, int i);
605int pci_select_bars(struct pci_dev *dev, unsigned long flags); 606int pci_select_bars(struct pci_dev *dev, unsigned long flags);
606 607
607/* ROM control related routines */ 608/* ROM control related routines */
@@ -626,6 +627,7 @@ int pci_claim_resource(struct pci_dev *, int);
626void pci_assign_unassigned_resources(void); 627void pci_assign_unassigned_resources(void);
627void pdev_enable_device(struct pci_dev *); 628void pdev_enable_device(struct pci_dev *);
628void pdev_sort_resources(struct pci_dev *, struct resource_list *); 629void pdev_sort_resources(struct pci_dev *, struct resource_list *);
630int pci_enable_resources(struct pci_dev *, int mask);
629void pci_fixup_irqs(u8 (*)(struct pci_dev *, u8 *), 631void pci_fixup_irqs(u8 (*)(struct pci_dev *, u8 *),
630 int (*)(struct pci_dev *, u8, u8)); 632 int (*)(struct pci_dev *, u8, u8));
631#define HAVE_PCI_REQ_REGIONS 2 633#define HAVE_PCI_REQ_REGIONS 2
@@ -793,18 +795,11 @@ static inline struct pci_dev *pci_get_device(unsigned int vendor,
793 return NULL; 795 return NULL;
794} 796}
795 797
796static inline struct pci_dev *pci_get_device_reverse(unsigned int vendor,
797 unsigned int device,
798 struct pci_dev *from)
799{
800 return NULL;
801}
802
803static inline struct pci_dev *pci_get_subsys(unsigned int vendor, 798static inline struct pci_dev *pci_get_subsys(unsigned int vendor,
804 unsigned int device, 799 unsigned int device,
805 unsigned int ss_vendor, 800 unsigned int ss_vendor,
806 unsigned int ss_device, 801 unsigned int ss_device,
807 struct pci_dev *from) 802 const struct pci_dev *from)
808{ 803{
809 return NULL; 804 return NULL;
810} 805}
@@ -817,7 +812,6 @@ static inline struct pci_dev *pci_get_class(unsigned int class,
817 812
818#define pci_dev_present(ids) (0) 813#define pci_dev_present(ids) (0)
819#define no_pci_devices() (1) 814#define no_pci_devices() (1)
820#define pci_find_present(ids) (NULL)
821#define pci_dev_put(dev) do { } while (0) 815#define pci_dev_put(dev) do { } while (0)
822 816
823static inline void pci_set_master(struct pci_dev *dev) 817static inline void pci_set_master(struct pci_dev *dev)
diff --git a/include/linux/pci_regs.h b/include/linux/pci_regs.h
index c1914a8b94a9..c0c1223c9194 100644
--- a/include/linux/pci_regs.h
+++ b/include/linux/pci_regs.h
@@ -395,9 +395,17 @@
395#define PCI_EXP_DEVSTA_AUXPD 0x10 /* AUX Power Detected */ 395#define PCI_EXP_DEVSTA_AUXPD 0x10 /* AUX Power Detected */
396#define PCI_EXP_DEVSTA_TRPND 0x20 /* Transactions Pending */ 396#define PCI_EXP_DEVSTA_TRPND 0x20 /* Transactions Pending */
397#define PCI_EXP_LNKCAP 12 /* Link Capabilities */ 397#define PCI_EXP_LNKCAP 12 /* Link Capabilities */
398#define PCI_EXP_LNKCAP_ASPMS 0xc00 /* ASPM Support */
399#define PCI_EXP_LNKCAP_L0SEL 0x7000 /* L0s Exit Latency */
400#define PCI_EXP_LNKCAP_L1EL 0x38000 /* L1 Exit Latency */
401#define PCI_EXP_LNKCAP_CLKPM 0x40000 /* L1 Clock Power Management */
398#define PCI_EXP_LNKCTL 16 /* Link Control */ 402#define PCI_EXP_LNKCTL 16 /* Link Control */
403#define PCI_EXP_LNKCTL_RL 0x20 /* Retrain Link */
404#define PCI_EXP_LNKCTL_CCC 0x40 /* Common Clock COnfiguration */
399#define PCI_EXP_LNKCTL_CLKREQ_EN 0x100 /* Enable clkreq */ 405#define PCI_EXP_LNKCTL_CLKREQ_EN 0x100 /* Enable clkreq */
400#define PCI_EXP_LNKSTA 18 /* Link Status */ 406#define PCI_EXP_LNKSTA 18 /* Link Status */
407#define PCI_EXP_LNKSTA_LT 0x800 /* Link Training */
408#define PCI_EXP_LNKSTA_SLC 0x1000 /* Slot Clock Configuration */
401#define PCI_EXP_SLTCAP 20 /* Slot Capabilities */ 409#define PCI_EXP_SLTCAP 20 /* Slot Capabilities */
402#define PCI_EXP_SLTCTL 24 /* Slot Control */ 410#define PCI_EXP_SLTCTL 24 /* Slot Control */
403#define PCI_EXP_SLTSTA 26 /* Slot Status */ 411#define PCI_EXP_SLTSTA 26 /* Slot Status */
diff --git a/include/linux/pcounter.h b/include/linux/pcounter.h
deleted file mode 100644
index a82d9f2628ca..000000000000
--- a/include/linux/pcounter.h
+++ /dev/null
@@ -1,74 +0,0 @@
1#ifndef __LINUX_PCOUNTER_H
2#define __LINUX_PCOUNTER_H
3/*
4 * Using a dynamic percpu 'int' variable has a cost :
5 * 1) Extra dereference
6 * Current per_cpu_ptr() implementation uses an array per 'percpu variable'.
7 * 2) memory cost of NR_CPUS*(32+sizeof(void *)) instead of num_possible_cpus()*4
8 *
9 * This pcounter implementation is an abstraction to be able to use
10 * either a static or a dynamic per cpu variable.
11 * One dynamic per cpu variable gets a fast & cheap implementation, we can
12 * change pcounter implementation too.
13 */
14struct pcounter {
15#ifdef CONFIG_SMP
16 void (*add)(struct pcounter *self, int inc);
17 int (*getval)(const struct pcounter *self, int cpu);
18 int *per_cpu_values;
19#else
20 int val;
21#endif
22};
23
24#ifdef CONFIG_SMP
25#include <linux/percpu.h>
26
27#define DEFINE_PCOUNTER(NAME) \
28static DEFINE_PER_CPU(int, NAME##_pcounter_values); \
29static void NAME##_pcounter_add(struct pcounter *self, int val) \
30{ \
31 __get_cpu_var(NAME##_pcounter_values) += val; \
32} \
33static int NAME##_pcounter_getval(const struct pcounter *self, int cpu) \
34{ \
35 return per_cpu(NAME##_pcounter_values, cpu); \
36} \
37
38#define PCOUNTER_MEMBER_INITIALIZER(NAME, MEMBER) \
39 MEMBER = { \
40 .add = NAME##_pcounter_add, \
41 .getval = NAME##_pcounter_getval, \
42 }
43
44
45static inline void pcounter_add(struct pcounter *self, int inc)
46{
47 self->add(self, inc);
48}
49
50extern int pcounter_getval(const struct pcounter *self);
51extern int pcounter_alloc(struct pcounter *self);
52extern void pcounter_free(struct pcounter *self);
53
54
55#else /* CONFIG_SMP */
56
57static inline void pcounter_add(struct pcounter *self, int inc)
58{
59 self->val += inc;
60}
61
62static inline int pcounter_getval(const struct pcounter *self)
63{
64 return self->val;
65}
66
67#define DEFINE_PCOUNTER(NAME)
68#define PCOUNTER_MEMBER_INITIALIZER(NAME, MEMBER)
69#define pcounter_alloc(self) 0
70#define pcounter_free(self)
71
72#endif /* CONFIG_SMP */
73
74#endif /* __LINUX_PCOUNTER_H */
diff --git a/include/linux/phy.h b/include/linux/phy.h
index 5e43ae751412..779cbcd65f62 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -39,7 +39,8 @@
39 SUPPORTED_1000baseT_Half | \ 39 SUPPORTED_1000baseT_Half | \
40 SUPPORTED_1000baseT_Full) 40 SUPPORTED_1000baseT_Full)
41 41
42/* Set phydev->irq to PHY_POLL if interrupts are not supported, 42/*
43 * Set phydev->irq to PHY_POLL if interrupts are not supported,
43 * or not desired for this PHY. Set to PHY_IGNORE_INTERRUPT if 44 * or not desired for this PHY. Set to PHY_IGNORE_INTERRUPT if
44 * the attached driver handles the interrupt 45 * the attached driver handles the interrupt
45 */ 46 */
@@ -63,8 +64,6 @@ typedef enum {
63 PHY_INTERFACE_MODE_RTBI 64 PHY_INTERFACE_MODE_RTBI
64} phy_interface_t; 65} phy_interface_t;
65 66
66#define MII_BUS_MAX 4
67
68 67
69#define PHY_INIT_TIMEOUT 100000 68#define PHY_INIT_TIMEOUT 100000
70#define PHY_STATE_TIME 1 69#define PHY_STATE_TIME 1
@@ -74,20 +73,30 @@ typedef enum {
74#define PHY_MAX_ADDR 32 73#define PHY_MAX_ADDR 32
75 74
76/* Used when trying to connect to a specific phy (mii bus id:phy device id) */ 75/* Used when trying to connect to a specific phy (mii bus id:phy device id) */
77#define PHY_ID_FMT "%x:%02x" 76#define PHY_ID_FMT "%s:%02x"
78 77
79/* The Bus class for PHYs. Devices which provide access to 78/*
80 * PHYs should register using this structure */ 79 * Need to be a little smaller than phydev->dev.bus_id to leave room
80 * for the ":%02x"
81 */
82#define MII_BUS_ID_SIZE (BUS_ID_SIZE - 3)
83
84/*
85 * The Bus class for PHYs. Devices which provide access to
86 * PHYs should register using this structure
87 */
81struct mii_bus { 88struct mii_bus {
82 const char *name; 89 const char *name;
83 int id; 90 char id[MII_BUS_ID_SIZE];
84 void *priv; 91 void *priv;
85 int (*read)(struct mii_bus *bus, int phy_id, int regnum); 92 int (*read)(struct mii_bus *bus, int phy_id, int regnum);
86 int (*write)(struct mii_bus *bus, int phy_id, int regnum, u16 val); 93 int (*write)(struct mii_bus *bus, int phy_id, int regnum, u16 val);
87 int (*reset)(struct mii_bus *bus); 94 int (*reset)(struct mii_bus *bus);
88 95
89 /* A lock to ensure that only one thing can read/write 96 /*
90 * the MDIO bus at a time */ 97 * A lock to ensure that only one thing can read/write
98 * the MDIO bus at a time
99 */
91 struct mutex mdio_lock; 100 struct mutex mdio_lock;
92 101
93 struct device *dev; 102 struct device *dev;
@@ -98,8 +107,10 @@ struct mii_bus {
98 /* Phy addresses to be ignored when probing */ 107 /* Phy addresses to be ignored when probing */
99 u32 phy_mask; 108 u32 phy_mask;
100 109
101 /* Pointer to an array of interrupts, each PHY's 110 /*
102 * interrupt at the index matching its address */ 111 * Pointer to an array of interrupts, each PHY's
112 * interrupt at the index matching its address
113 */
103 int *irq; 114 int *irq;
104}; 115};
105 116
@@ -251,7 +262,8 @@ struct phy_device {
251 /* Bus address of the PHY (0-32) */ 262 /* Bus address of the PHY (0-32) */
252 int addr; 263 int addr;
253 264
254 /* forced speed & duplex (no autoneg) 265 /*
266 * forced speed & duplex (no autoneg)
255 * partner speed & duplex & pause (autoneg) 267 * partner speed & duplex & pause (autoneg)
256 */ 268 */
257 int speed; 269 int speed;
@@ -274,8 +286,10 @@ struct phy_device {
274 286
275 int link_timeout; 287 int link_timeout;
276 288
277 /* Interrupt number for this PHY 289 /*
278 * -1 means no interrupt */ 290 * Interrupt number for this PHY
291 * -1 means no interrupt
292 */
279 int irq; 293 int irq;
280 294
281 /* private data pointer */ 295 /* private data pointer */
@@ -325,22 +339,28 @@ struct phy_driver {
325 u32 features; 339 u32 features;
326 u32 flags; 340 u32 flags;
327 341
328 /* Called to initialize the PHY, 342 /*
329 * including after a reset */ 343 * Called to initialize the PHY,
344 * including after a reset
345 */
330 int (*config_init)(struct phy_device *phydev); 346 int (*config_init)(struct phy_device *phydev);
331 347
332 /* Called during discovery. Used to set 348 /*
333 * up device-specific structures, if any */ 349 * Called during discovery. Used to set
350 * up device-specific structures, if any
351 */
334 int (*probe)(struct phy_device *phydev); 352 int (*probe)(struct phy_device *phydev);
335 353
336 /* PHY Power Management */ 354 /* PHY Power Management */
337 int (*suspend)(struct phy_device *phydev); 355 int (*suspend)(struct phy_device *phydev);
338 int (*resume)(struct phy_device *phydev); 356 int (*resume)(struct phy_device *phydev);
339 357
340 /* Configures the advertisement and resets 358 /*
359 * Configures the advertisement and resets
341 * autonegotiation if phydev->autoneg is on, 360 * autonegotiation if phydev->autoneg is on,
342 * forces the speed to the current settings in phydev 361 * forces the speed to the current settings in phydev
343 * if phydev->autoneg is off */ 362 * if phydev->autoneg is off
363 */
344 int (*config_aneg)(struct phy_device *phydev); 364 int (*config_aneg)(struct phy_device *phydev);
345 365
346 /* Determines the negotiated speed and duplex */ 366 /* Determines the negotiated speed and duplex */
@@ -361,6 +381,7 @@ struct phy_driver {
361 381
362int phy_read(struct phy_device *phydev, u16 regnum); 382int phy_read(struct phy_device *phydev, u16 regnum);
363int phy_write(struct phy_device *phydev, u16 regnum, u16 val); 383int phy_write(struct phy_device *phydev, u16 regnum, u16 val);
384int get_phy_id(struct mii_bus *bus, int addr, u32 *phy_id);
364struct phy_device* get_phy_device(struct mii_bus *bus, int addr); 385struct phy_device* get_phy_device(struct mii_bus *bus, int addr);
365int phy_clear_interrupt(struct phy_device *phydev); 386int phy_clear_interrupt(struct phy_device *phydev);
366int phy_config_interrupt(struct phy_device *phydev, u32 interrupts); 387int phy_config_interrupt(struct phy_device *phydev, u32 interrupts);
diff --git a/include/linux/pim.h b/include/linux/pim.h
new file mode 100644
index 000000000000..236ffd317394
--- /dev/null
+++ b/include/linux/pim.h
@@ -0,0 +1,45 @@
1#ifndef __LINUX_PIM_H
2#define __LINUX_PIM_H
3
4#include <asm/byteorder.h>
5
6#ifndef __KERNEL__
7struct pim {
8#if defined(__LITTLE_ENDIAN_BITFIELD)
9 __u8 pim_type:4, /* PIM message type */
10 pim_ver:4; /* PIM version */
11#elif defined(__BIG_ENDIAN_BITFIELD)
12 __u8 pim_ver:4; /* PIM version */
13 pim_type:4; /* PIM message type */
14#endif
15 __u8 pim_rsv; /* Reserved */
16 __be16 pim_cksum; /* Checksum */
17};
18
19#define PIM_MINLEN 8
20#endif
21
22/* Message types - V1 */
23#define PIM_V1_VERSION __constant_htonl(0x10000000)
24#define PIM_V1_REGISTER 1
25
26/* Message types - V2 */
27#define PIM_VERSION 2
28#define PIM_REGISTER 1
29
30#if defined(__KERNEL__)
31#define PIM_NULL_REGISTER __constant_htonl(0x40000000)
32
33/* PIMv2 register message header layout (ietf-draft-idmr-pimvsm-v2-00.ps */
34struct pimreghdr
35{
36 __u8 type;
37 __u8 reserved;
38 __be16 csum;
39 __be32 flags;
40};
41
42struct sk_buff;
43extern int pim_rcv_v1(struct sk_buff *);
44#endif
45#endif
diff --git a/include/linux/pm.h b/include/linux/pm.h
index 015b735811b4..1de72cbbe0d1 100644
--- a/include/linux/pm.h
+++ b/include/linux/pm.h
@@ -183,8 +183,9 @@ typedef struct pm_message {
183struct dev_pm_info { 183struct dev_pm_info {
184 pm_message_t power_state; 184 pm_message_t power_state;
185 unsigned can_wakeup:1; 185 unsigned can_wakeup:1;
186#ifdef CONFIG_PM_SLEEP
187 unsigned should_wakeup:1; 186 unsigned should_wakeup:1;
187 bool sleeping:1; /* Owned by the PM core */
188#ifdef CONFIG_PM_SLEEP
188 struct list_head entry; 189 struct list_head entry;
189#endif 190#endif
190}; 191};
@@ -197,11 +198,6 @@ extern void device_resume(void);
197extern int device_suspend(pm_message_t state); 198extern int device_suspend(pm_message_t state);
198extern int device_prepare_suspend(pm_message_t state); 199extern int device_prepare_suspend(pm_message_t state);
199 200
200#define device_set_wakeup_enable(dev,val) \
201 ((dev)->power.should_wakeup = !!(val))
202#define device_may_wakeup(dev) \
203 (device_can_wakeup(dev) && (dev)->power.should_wakeup)
204
205extern void __suspend_report_result(const char *function, void *fn, int ret); 201extern void __suspend_report_result(const char *function, void *fn, int ret);
206 202
207#define suspend_report_result(fn, ret) \ 203#define suspend_report_result(fn, ret) \
@@ -209,20 +205,6 @@ extern void __suspend_report_result(const char *function, void *fn, int ret);
209 __suspend_report_result(__FUNCTION__, fn, ret); \ 205 __suspend_report_result(__FUNCTION__, fn, ret); \
210 } while (0) 206 } while (0)
211 207
212/*
213 * Platform hook to activate device wakeup capability, if that's not already
214 * handled by enable_irq_wake() etc.
215 * Returns zero on success, else negative errno
216 */
217extern int (*platform_enable_wakeup)(struct device *dev, int is_on);
218
219static inline int call_platform_enable_wakeup(struct device *dev, int is_on)
220{
221 if (platform_enable_wakeup)
222 return (*platform_enable_wakeup)(dev, is_on);
223 return 0;
224}
225
226#else /* !CONFIG_PM_SLEEP */ 208#else /* !CONFIG_PM_SLEEP */
227 209
228static inline int device_suspend(pm_message_t state) 210static inline int device_suspend(pm_message_t state)
@@ -230,29 +212,10 @@ static inline int device_suspend(pm_message_t state)
230 return 0; 212 return 0;
231} 213}
232 214
233#define device_set_wakeup_enable(dev,val) do{}while(0) 215#define suspend_report_result(fn, ret) do {} while (0)
234#define device_may_wakeup(dev) (0)
235
236#define suspend_report_result(fn, ret) do { } while (0)
237
238static inline int call_platform_enable_wakeup(struct device *dev, int is_on)
239{
240 return 0;
241}
242 216
243#endif /* !CONFIG_PM_SLEEP */ 217#endif /* !CONFIG_PM_SLEEP */
244 218
245/* changes to device_may_wakeup take effect on the next pm state change.
246 * by default, devices should wakeup if they can.
247 */
248#define device_can_wakeup(dev) \
249 ((dev)->power.can_wakeup)
250#define device_init_wakeup(dev,val) \
251 do { \
252 device_can_wakeup(dev) = !!(val); \
253 device_set_wakeup_enable(dev,val); \
254 } while(0)
255
256/* 219/*
257 * Global Power Management flags 220 * Global Power Management flags
258 * Used to keep APM and ACPI from both being active 221 * Used to keep APM and ACPI from both being active
diff --git a/include/linux/pm_wakeup.h b/include/linux/pm_wakeup.h
new file mode 100644
index 000000000000..f0d0b2cb8d20
--- /dev/null
+++ b/include/linux/pm_wakeup.h
@@ -0,0 +1,90 @@
1/*
2 * pm_wakeup.h - Power management wakeup interface
3 *
4 * Copyright (C) 2008 Alan Stern
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20
21#ifndef _LINUX_PM_WAKEUP_H
22#define _LINUX_PM_WAKEUP_H
23
24#ifndef _DEVICE_H_
25# error "please don't include this file directly"
26#endif
27
28#ifdef CONFIG_PM
29
30/* changes to device_may_wakeup take effect on the next pm state change.
31 * by default, devices should wakeup if they can.
32 */
33static inline void device_init_wakeup(struct device *dev, int val)
34{
35 dev->power.can_wakeup = dev->power.should_wakeup = !!val;
36}
37
38static inline int device_can_wakeup(struct device *dev)
39{
40 return dev->power.can_wakeup;
41}
42
43static inline void device_set_wakeup_enable(struct device *dev, int val)
44{
45 dev->power.should_wakeup = !!val;
46}
47
48static inline int device_may_wakeup(struct device *dev)
49{
50 return dev->power.can_wakeup & dev->power.should_wakeup;
51}
52
53/*
54 * Platform hook to activate device wakeup capability, if that's not already
55 * handled by enable_irq_wake() etc.
56 * Returns zero on success, else negative errno
57 */
58extern int (*platform_enable_wakeup)(struct device *dev, int is_on);
59
60static inline int call_platform_enable_wakeup(struct device *dev, int is_on)
61{
62 if (platform_enable_wakeup)
63 return (*platform_enable_wakeup)(dev, is_on);
64 return 0;
65}
66
67#else /* !CONFIG_PM */
68
69/* For some reason the next two routines work even without CONFIG_PM */
70static inline void device_init_wakeup(struct device *dev, int val)
71{
72 dev->power.can_wakeup = !!val;
73}
74
75static inline int device_can_wakeup(struct device *dev)
76{
77 return dev->power.can_wakeup;
78}
79
80#define device_set_wakeup_enable(dev, val) do {} while (0)
81#define device_may_wakeup(dev) 0
82
83static inline int call_platform_enable_wakeup(struct device *dev, int is_on)
84{
85 return 0;
86}
87
88#endif /* !CONFIG_PM */
89
90#endif /* _LINUX_PM_WAKEUP_H */
diff --git a/include/linux/prctl.h b/include/linux/prctl.h
index 3800639775ae..5c80b1939636 100644
--- a/include/linux/prctl.h
+++ b/include/linux/prctl.h
@@ -67,4 +67,10 @@
67#define PR_CAPBSET_READ 23 67#define PR_CAPBSET_READ 23
68#define PR_CAPBSET_DROP 24 68#define PR_CAPBSET_DROP 24
69 69
70/* Get/set the process' ability to use the timestamp counter instruction */
71#define PR_GET_TSC 25
72#define PR_SET_TSC 26
73# define PR_TSC_ENABLE 1 /* allow the use of the timestamp counter */
74# define PR_TSC_SIGSEGV 2 /* throw a SIGSEGV instead of reading the TSC */
75
70#endif /* _LINUX_PRCTL_H */ 76#endif /* _LINUX_PRCTL_H */
diff --git a/include/linux/raid/md.h b/include/linux/raid/md.h
index fbaeda79b2e9..8ab630b67fcc 100644
--- a/include/linux/raid/md.h
+++ b/include/linux/raid/md.h
@@ -19,7 +19,6 @@
19#define _MD_H 19#define _MD_H
20 20
21#include <linux/blkdev.h> 21#include <linux/blkdev.h>
22#include <asm/semaphore.h>
23#include <linux/major.h> 22#include <linux/major.h>
24#include <linux/ioctl.h> 23#include <linux/ioctl.h>
25#include <linux/types.h> 24#include <linux/types.h>
diff --git a/include/linux/raid_class.h b/include/linux/raid_class.h
index d22ad392242a..6b537f1ac96c 100644
--- a/include/linux/raid_class.h
+++ b/include/linux/raid_class.h
@@ -53,20 +53,20 @@ struct raid_data {
53#define DEFINE_RAID_ATTRIBUTE(type, attr) \ 53#define DEFINE_RAID_ATTRIBUTE(type, attr) \
54static inline void \ 54static inline void \
55raid_set_##attr(struct raid_template *r, struct device *dev, type value) { \ 55raid_set_##attr(struct raid_template *r, struct device *dev, type value) { \
56 struct class_device *cdev = \ 56 struct device *device = \
57 attribute_container_find_class_device(&r->raid_attrs.ac, dev);\ 57 attribute_container_find_class_device(&r->raid_attrs.ac, dev);\
58 struct raid_data *rd; \ 58 struct raid_data *rd; \
59 BUG_ON(!cdev); \ 59 BUG_ON(!device); \
60 rd = class_get_devdata(cdev); \ 60 rd = dev_get_drvdata(device); \
61 rd->attr = value; \ 61 rd->attr = value; \
62} \ 62} \
63static inline type \ 63static inline type \
64raid_get_##attr(struct raid_template *r, struct device *dev) { \ 64raid_get_##attr(struct raid_template *r, struct device *dev) { \
65 struct class_device *cdev = \ 65 struct device *device = \
66 attribute_container_find_class_device(&r->raid_attrs.ac, dev);\ 66 attribute_container_find_class_device(&r->raid_attrs.ac, dev);\
67 struct raid_data *rd; \ 67 struct raid_data *rd; \
68 BUG_ON(!cdev); \ 68 BUG_ON(!device); \
69 rd = class_get_devdata(cdev); \ 69 rd = dev_get_drvdata(device); \
70 return rd->attr; \ 70 return rd->attr; \
71} 71}
72 72
diff --git a/include/linux/scatterlist.h b/include/linux/scatterlist.h
index a3d567a974e8..71fc81360048 100644
--- a/include/linux/scatterlist.h
+++ b/include/linux/scatterlist.h
@@ -213,6 +213,11 @@ int __sg_alloc_table(struct sg_table *, unsigned int, unsigned int, gfp_t,
213 sg_alloc_fn *); 213 sg_alloc_fn *);
214int sg_alloc_table(struct sg_table *, unsigned int, gfp_t); 214int sg_alloc_table(struct sg_table *, unsigned int, gfp_t);
215 215
216size_t sg_copy_from_buffer(struct scatterlist *sgl, unsigned int nents,
217 void *buf, size_t buflen);
218size_t sg_copy_to_buffer(struct scatterlist *sgl, unsigned int nents,
219 void *buf, size_t buflen);
220
216/* 221/*
217 * Maximum number of entries that will be allocated in one piece, if 222 * Maximum number of entries that will be allocated in one piece, if
218 * a list larger than this is required then chaining will be utilized. 223 * a list larger than this is required then chaining will be utilized.
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 6a1e7afb099b..311380e5fe89 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -61,7 +61,6 @@ struct sched_param {
61#include <linux/mm_types.h> 61#include <linux/mm_types.h>
62 62
63#include <asm/system.h> 63#include <asm/system.h>
64#include <asm/semaphore.h>
65#include <asm/page.h> 64#include <asm/page.h>
66#include <asm/ptrace.h> 65#include <asm/ptrace.h>
67#include <asm/cputime.h> 66#include <asm/cputime.h>
@@ -704,6 +703,7 @@ enum cpu_idle_type {
704#define SD_POWERSAVINGS_BALANCE 256 /* Balance for power savings */ 703#define SD_POWERSAVINGS_BALANCE 256 /* Balance for power savings */
705#define SD_SHARE_PKG_RESOURCES 512 /* Domain members share cpu pkg resources */ 704#define SD_SHARE_PKG_RESOURCES 512 /* Domain members share cpu pkg resources */
706#define SD_SERIALIZE 1024 /* Only a single load balancing instance */ 705#define SD_SERIALIZE 1024 /* Only a single load balancing instance */
706#define SD_WAKE_IDLE_FAR 2048 /* Gain latency sacrificing cache hit */
707 707
708#define BALANCE_FOR_MC_POWER \ 708#define BALANCE_FOR_MC_POWER \
709 (sched_smt_power_savings ? SD_POWERSAVINGS_BALANCE : 0) 709 (sched_smt_power_savings ? SD_POWERSAVINGS_BALANCE : 0)
@@ -733,12 +733,31 @@ struct sched_group {
733 u32 reciprocal_cpu_power; 733 u32 reciprocal_cpu_power;
734}; 734};
735 735
736enum sched_domain_level {
737 SD_LV_NONE = 0,
738 SD_LV_SIBLING,
739 SD_LV_MC,
740 SD_LV_CPU,
741 SD_LV_NODE,
742 SD_LV_ALLNODES,
743 SD_LV_MAX
744};
745
746struct sched_domain_attr {
747 int relax_domain_level;
748};
749
750#define SD_ATTR_INIT (struct sched_domain_attr) { \
751 .relax_domain_level = -1, \
752}
753
736struct sched_domain { 754struct sched_domain {
737 /* These fields must be setup */ 755 /* These fields must be setup */
738 struct sched_domain *parent; /* top domain must be null terminated */ 756 struct sched_domain *parent; /* top domain must be null terminated */
739 struct sched_domain *child; /* bottom domain must be null terminated */ 757 struct sched_domain *child; /* bottom domain must be null terminated */
740 struct sched_group *groups; /* the balancing groups of the domain */ 758 struct sched_group *groups; /* the balancing groups of the domain */
741 cpumask_t span; /* span of all CPUs in this domain */ 759 cpumask_t span; /* span of all CPUs in this domain */
760 int first_cpu; /* cache of the first cpu in this domain */
742 unsigned long min_interval; /* Minimum balance interval ms */ 761 unsigned long min_interval; /* Minimum balance interval ms */
743 unsigned long max_interval; /* Maximum balance interval ms */ 762 unsigned long max_interval; /* Maximum balance interval ms */
744 unsigned int busy_factor; /* less balancing by factor if busy */ 763 unsigned int busy_factor; /* less balancing by factor if busy */
@@ -750,6 +769,7 @@ struct sched_domain {
750 unsigned int wake_idx; 769 unsigned int wake_idx;
751 unsigned int forkexec_idx; 770 unsigned int forkexec_idx;
752 int flags; /* See SD_* */ 771 int flags; /* See SD_* */
772 enum sched_domain_level level;
753 773
754 /* Runtime fields. */ 774 /* Runtime fields. */
755 unsigned long last_balance; /* init to jiffies. units in jiffies */ 775 unsigned long last_balance; /* init to jiffies. units in jiffies */
@@ -789,7 +809,8 @@ struct sched_domain {
789#endif 809#endif
790}; 810};
791 811
792extern void partition_sched_domains(int ndoms_new, cpumask_t *doms_new); 812extern void partition_sched_domains(int ndoms_new, cpumask_t *doms_new,
813 struct sched_domain_attr *dattr_new);
793extern int arch_reinit_sched_domains(void); 814extern int arch_reinit_sched_domains(void);
794 815
795#endif /* CONFIG_SMP */ 816#endif /* CONFIG_SMP */
@@ -889,7 +910,8 @@ struct sched_class {
889 void (*set_curr_task) (struct rq *rq); 910 void (*set_curr_task) (struct rq *rq);
890 void (*task_tick) (struct rq *rq, struct task_struct *p, int queued); 911 void (*task_tick) (struct rq *rq, struct task_struct *p, int queued);
891 void (*task_new) (struct rq *rq, struct task_struct *p); 912 void (*task_new) (struct rq *rq, struct task_struct *p);
892 void (*set_cpus_allowed)(struct task_struct *p, cpumask_t *newmask); 913 void (*set_cpus_allowed)(struct task_struct *p,
914 const cpumask_t *newmask);
893 915
894 void (*join_domain)(struct rq *rq); 916 void (*join_domain)(struct rq *rq);
895 void (*leave_domain)(struct rq *rq); 917 void (*leave_domain)(struct rq *rq);
@@ -923,6 +945,7 @@ struct load_weight {
923struct sched_entity { 945struct sched_entity {
924 struct load_weight load; /* for load-balancing */ 946 struct load_weight load; /* for load-balancing */
925 struct rb_node run_node; 947 struct rb_node run_node;
948 struct list_head group_node;
926 unsigned int on_rq; 949 unsigned int on_rq;
927 950
928 u64 exec_start; 951 u64 exec_start;
@@ -982,6 +1005,7 @@ struct sched_rt_entity {
982 unsigned long timeout; 1005 unsigned long timeout;
983 int nr_cpus_allowed; 1006 int nr_cpus_allowed;
984 1007
1008 struct sched_rt_entity *back;
985#ifdef CONFIG_RT_GROUP_SCHED 1009#ifdef CONFIG_RT_GROUP_SCHED
986 struct sched_rt_entity *parent; 1010 struct sched_rt_entity *parent;
987 /* rq on which this entity is (to be) queued: */ 1011 /* rq on which this entity is (to be) queued: */
@@ -1502,15 +1526,21 @@ static inline void put_task_struct(struct task_struct *t)
1502#define used_math() tsk_used_math(current) 1526#define used_math() tsk_used_math(current)
1503 1527
1504#ifdef CONFIG_SMP 1528#ifdef CONFIG_SMP
1505extern int set_cpus_allowed(struct task_struct *p, cpumask_t new_mask); 1529extern int set_cpus_allowed_ptr(struct task_struct *p,
1530 const cpumask_t *new_mask);
1506#else 1531#else
1507static inline int set_cpus_allowed(struct task_struct *p, cpumask_t new_mask) 1532static inline int set_cpus_allowed_ptr(struct task_struct *p,
1533 const cpumask_t *new_mask)
1508{ 1534{
1509 if (!cpu_isset(0, new_mask)) 1535 if (!cpu_isset(0, *new_mask))
1510 return -EINVAL; 1536 return -EINVAL;
1511 return 0; 1537 return 0;
1512} 1538}
1513#endif 1539#endif
1540static inline int set_cpus_allowed(struct task_struct *p, cpumask_t new_mask)
1541{
1542 return set_cpus_allowed_ptr(p, &new_mask);
1543}
1514 1544
1515extern unsigned long long sched_clock(void); 1545extern unsigned long long sched_clock(void);
1516 1546
@@ -1551,7 +1581,6 @@ static inline void wake_up_idle_cpu(int cpu) { }
1551extern unsigned int sysctl_sched_latency; 1581extern unsigned int sysctl_sched_latency;
1552extern unsigned int sysctl_sched_min_granularity; 1582extern unsigned int sysctl_sched_min_granularity;
1553extern unsigned int sysctl_sched_wakeup_granularity; 1583extern unsigned int sysctl_sched_wakeup_granularity;
1554extern unsigned int sysctl_sched_batch_wakeup_granularity;
1555extern unsigned int sysctl_sched_child_runs_first; 1584extern unsigned int sysctl_sched_child_runs_first;
1556extern unsigned int sysctl_sched_features; 1585extern unsigned int sysctl_sched_features;
1557extern unsigned int sysctl_sched_migration_cost; 1586extern unsigned int sysctl_sched_migration_cost;
@@ -1564,6 +1593,10 @@ int sched_nr_latency_handler(struct ctl_table *table, int write,
1564extern unsigned int sysctl_sched_rt_period; 1593extern unsigned int sysctl_sched_rt_period;
1565extern int sysctl_sched_rt_runtime; 1594extern int sysctl_sched_rt_runtime;
1566 1595
1596int sched_rt_handler(struct ctl_table *table, int write,
1597 struct file *filp, void __user *buffer, size_t *lenp,
1598 loff_t *ppos);
1599
1567extern unsigned int sysctl_sched_compat_yield; 1600extern unsigned int sysctl_sched_compat_yield;
1568 1601
1569#ifdef CONFIG_RT_MUTEXES 1602#ifdef CONFIG_RT_MUTEXES
@@ -2031,7 +2064,7 @@ static inline void arch_pick_mmap_layout(struct mm_struct *mm)
2031} 2064}
2032#endif 2065#endif
2033 2066
2034extern long sched_setaffinity(pid_t pid, cpumask_t new_mask); 2067extern long sched_setaffinity(pid_t pid, const cpumask_t *new_mask);
2035extern long sched_getaffinity(pid_t pid, cpumask_t *mask); 2068extern long sched_getaffinity(pid_t pid, cpumask_t *mask);
2036 2069
2037extern int sched_mc_power_savings, sched_smt_power_savings; 2070extern int sched_mc_power_savings, sched_smt_power_savings;
@@ -2041,8 +2074,11 @@ extern void normalize_rt_tasks(void);
2041#ifdef CONFIG_GROUP_SCHED 2074#ifdef CONFIG_GROUP_SCHED
2042 2075
2043extern struct task_group init_task_group; 2076extern struct task_group init_task_group;
2077#ifdef CONFIG_USER_SCHED
2078extern struct task_group root_task_group;
2079#endif
2044 2080
2045extern struct task_group *sched_create_group(void); 2081extern struct task_group *sched_create_group(struct task_group *parent);
2046extern void sched_destroy_group(struct task_group *tg); 2082extern void sched_destroy_group(struct task_group *tg);
2047extern void sched_move_task(struct task_struct *tsk); 2083extern void sched_move_task(struct task_struct *tsk);
2048#ifdef CONFIG_FAIR_GROUP_SCHED 2084#ifdef CONFIG_FAIR_GROUP_SCHED
@@ -2053,6 +2089,9 @@ extern unsigned long sched_group_shares(struct task_group *tg);
2053extern int sched_group_set_rt_runtime(struct task_group *tg, 2089extern int sched_group_set_rt_runtime(struct task_group *tg,
2054 long rt_runtime_us); 2090 long rt_runtime_us);
2055extern long sched_group_rt_runtime(struct task_group *tg); 2091extern long sched_group_rt_runtime(struct task_group *tg);
2092extern int sched_group_set_rt_period(struct task_group *tg,
2093 long rt_period_us);
2094extern long sched_group_rt_period(struct task_group *tg);
2056#endif 2095#endif
2057#endif 2096#endif
2058 2097
diff --git a/include/linux/security.h b/include/linux/security.h
index c673dfd4dffc..fea1f4aa4dd5 100644
--- a/include/linux/security.h
+++ b/include/linux/security.h
@@ -36,7 +36,11 @@
36 36
37extern unsigned securebits; 37extern unsigned securebits;
38 38
39/* Maximum number of letters for an LSM name string */
40#define SECURITY_NAME_MAX 10
41
39struct ctl_table; 42struct ctl_table;
43struct audit_krule;
40 44
41/* 45/*
42 * These functions are in security/capability.c and are used 46 * These functions are in security/capability.c and are used
@@ -136,6 +140,12 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts)
136/** 140/**
137 * struct security_operations - main security structure 141 * struct security_operations - main security structure
138 * 142 *
143 * Security module identifier.
144 *
145 * @name:
146 * A string that acts as a unique identifeir for the LSM with max number
147 * of characters = SECURITY_NAME_MAX.
148 *
139 * Security hooks for program execution operations. 149 * Security hooks for program execution operations.
140 * 150 *
141 * @bprm_alloc_security: 151 * @bprm_alloc_security:
@@ -468,6 +478,11 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts)
468 * @dentry is the dentry being changed. 478 * @dentry is the dentry being changed.
469 * Return 0 on success. If error is returned, then the operation 479 * Return 0 on success. If error is returned, then the operation
470 * causing setuid bit removal is failed. 480 * causing setuid bit removal is failed.
481 * @inode_getsecid:
482 * Get the secid associated with the node.
483 * @inode contains a pointer to the inode.
484 * @secid contains a pointer to the location where result will be saved.
485 * In case of failure, @secid will be set to zero.
471 * 486 *
472 * Security hooks for file operations 487 * Security hooks for file operations
473 * 488 *
@@ -636,6 +651,8 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts)
636 * @task_getsecid: 651 * @task_getsecid:
637 * Retrieve the security identifier of the process @p. 652 * Retrieve the security identifier of the process @p.
638 * @p contains the task_struct for the process and place is into @secid. 653 * @p contains the task_struct for the process and place is into @secid.
654 * In case of failure, @secid will be set to zero.
655 *
639 * @task_setgroups: 656 * @task_setgroups:
640 * Check permission before setting the supplementary group set of the 657 * Check permission before setting the supplementary group set of the
641 * current process. 658 * current process.
@@ -910,24 +927,24 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts)
910 * Security hooks for XFRM operations. 927 * Security hooks for XFRM operations.
911 * 928 *
912 * @xfrm_policy_alloc_security: 929 * @xfrm_policy_alloc_security:
913 * @xp contains the xfrm_policy being added to Security Policy Database 930 * @ctxp is a pointer to the xfrm_sec_ctx being added to Security Policy
914 * used by the XFRM system. 931 * Database used by the XFRM system.
915 * @sec_ctx contains the security context information being provided by 932 * @sec_ctx contains the security context information being provided by
916 * the user-level policy update program (e.g., setkey). 933 * the user-level policy update program (e.g., setkey).
917 * Allocate a security structure to the xp->security field; the security 934 * Allocate a security structure to the xp->security field; the security
918 * field is initialized to NULL when the xfrm_policy is allocated. 935 * field is initialized to NULL when the xfrm_policy is allocated.
919 * Return 0 if operation was successful (memory to allocate, legal context) 936 * Return 0 if operation was successful (memory to allocate, legal context)
920 * @xfrm_policy_clone_security: 937 * @xfrm_policy_clone_security:
921 * @old contains an existing xfrm_policy in the SPD. 938 * @old_ctx contains an existing xfrm_sec_ctx.
922 * @new contains a new xfrm_policy being cloned from old. 939 * @new_ctxp contains a new xfrm_sec_ctx being cloned from old.
923 * Allocate a security structure to the new->security field 940 * Allocate a security structure in new_ctxp that contains the
924 * that contains the information from the old->security field. 941 * information from the old_ctx structure.
925 * Return 0 if operation was successful (memory to allocate). 942 * Return 0 if operation was successful (memory to allocate).
926 * @xfrm_policy_free_security: 943 * @xfrm_policy_free_security:
927 * @xp contains the xfrm_policy 944 * @ctx contains the xfrm_sec_ctx
928 * Deallocate xp->security. 945 * Deallocate xp->security.
929 * @xfrm_policy_delete_security: 946 * @xfrm_policy_delete_security:
930 * @xp contains the xfrm_policy. 947 * @ctx contains the xfrm_sec_ctx.
931 * Authorize deletion of xp->security. 948 * Authorize deletion of xp->security.
932 * @xfrm_state_alloc_security: 949 * @xfrm_state_alloc_security:
933 * @x contains the xfrm_state being added to the Security Association 950 * @x contains the xfrm_state being added to the Security Association
@@ -947,7 +964,7 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts)
947 * @x contains the xfrm_state. 964 * @x contains the xfrm_state.
948 * Authorize deletion of x->security. 965 * Authorize deletion of x->security.
949 * @xfrm_policy_lookup: 966 * @xfrm_policy_lookup:
950 * @xp contains the xfrm_policy for which the access control is being 967 * @ctx contains the xfrm_sec_ctx for which the access control is being
951 * checked. 968 * checked.
952 * @fl_secid contains the flow security label that is used to authorize 969 * @fl_secid contains the flow security label that is used to authorize
953 * access to the policy xp. 970 * access to the policy xp.
@@ -997,6 +1014,11 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts)
997 * @ipcp contains the kernel IPC permission structure 1014 * @ipcp contains the kernel IPC permission structure
998 * @flag contains the desired (requested) permission set 1015 * @flag contains the desired (requested) permission set
999 * Return 0 if permission is granted. 1016 * Return 0 if permission is granted.
1017 * @ipc_getsecid:
1018 * Get the secid associated with the ipc object.
1019 * @ipcp contains the kernel IPC permission structure.
1020 * @secid contains a pointer to the location where result will be saved.
1021 * In case of failure, @secid will be set to zero.
1000 * 1022 *
1001 * Security hooks for individual messages held in System V IPC message queues 1023 * Security hooks for individual messages held in System V IPC message queues
1002 * @msg_msg_alloc_security: 1024 * @msg_msg_alloc_security:
@@ -1223,9 +1245,42 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts)
1223 * @secdata contains the security context. 1245 * @secdata contains the security context.
1224 * @seclen contains the length of the security context. 1246 * @seclen contains the length of the security context.
1225 * 1247 *
1248 * Security hooks for Audit
1249 *
1250 * @audit_rule_init:
1251 * Allocate and initialize an LSM audit rule structure.
1252 * @field contains the required Audit action. Fields flags are defined in include/linux/audit.h
1253 * @op contains the operator the rule uses.
1254 * @rulestr contains the context where the rule will be applied to.
1255 * @lsmrule contains a pointer to receive the result.
1256 * Return 0 if @lsmrule has been successfully set,
1257 * -EINVAL in case of an invalid rule.
1258 *
1259 * @audit_rule_known:
1260 * Specifies whether given @rule contains any fields related to current LSM.
1261 * @rule contains the audit rule of interest.
1262 * Return 1 in case of relation found, 0 otherwise.
1263 *
1264 * @audit_rule_match:
1265 * Determine if given @secid matches a rule previously approved
1266 * by @audit_rule_known.
1267 * @secid contains the security id in question.
1268 * @field contains the field which relates to current LSM.
1269 * @op contains the operator that will be used for matching.
1270 * @rule points to the audit rule that will be checked against.
1271 * @actx points to the audit context associated with the check.
1272 * Return 1 if secid matches the rule, 0 if it does not, -ERRNO on failure.
1273 *
1274 * @audit_rule_free:
1275 * Deallocate the LSM audit rule structure previously allocated by
1276 * audit_rule_init.
1277 * @rule contains the allocated rule
1278 *
1226 * This is the main security structure. 1279 * This is the main security structure.
1227 */ 1280 */
1228struct security_operations { 1281struct security_operations {
1282 char name[SECURITY_NAME_MAX + 1];
1283
1229 int (*ptrace) (struct task_struct * parent, struct task_struct * child); 1284 int (*ptrace) (struct task_struct * parent, struct task_struct * child);
1230 int (*capget) (struct task_struct * target, 1285 int (*capget) (struct task_struct * target,
1231 kernel_cap_t * effective, 1286 kernel_cap_t * effective,
@@ -1317,6 +1372,7 @@ struct security_operations {
1317 int (*inode_getsecurity)(const struct inode *inode, const char *name, void **buffer, bool alloc); 1372 int (*inode_getsecurity)(const struct inode *inode, const char *name, void **buffer, bool alloc);
1318 int (*inode_setsecurity)(struct inode *inode, const char *name, const void *value, size_t size, int flags); 1373 int (*inode_setsecurity)(struct inode *inode, const char *name, const void *value, size_t size, int flags);
1319 int (*inode_listsecurity)(struct inode *inode, char *buffer, size_t buffer_size); 1374 int (*inode_listsecurity)(struct inode *inode, char *buffer, size_t buffer_size);
1375 void (*inode_getsecid)(const struct inode *inode, u32 *secid);
1320 1376
1321 int (*file_permission) (struct file * file, int mask); 1377 int (*file_permission) (struct file * file, int mask);
1322 int (*file_alloc_security) (struct file * file); 1378 int (*file_alloc_security) (struct file * file);
@@ -1369,6 +1425,7 @@ struct security_operations {
1369 void (*task_to_inode)(struct task_struct *p, struct inode *inode); 1425 void (*task_to_inode)(struct task_struct *p, struct inode *inode);
1370 1426
1371 int (*ipc_permission) (struct kern_ipc_perm * ipcp, short flag); 1427 int (*ipc_permission) (struct kern_ipc_perm * ipcp, short flag);
1428 void (*ipc_getsecid) (struct kern_ipc_perm *ipcp, u32 *secid);
1372 1429
1373 int (*msg_msg_alloc_security) (struct msg_msg * msg); 1430 int (*msg_msg_alloc_security) (struct msg_msg * msg);
1374 void (*msg_msg_free_security) (struct msg_msg * msg); 1431 void (*msg_msg_free_security) (struct msg_msg * msg);
@@ -1454,17 +1511,17 @@ struct security_operations {
1454#endif /* CONFIG_SECURITY_NETWORK */ 1511#endif /* CONFIG_SECURITY_NETWORK */
1455 1512
1456#ifdef CONFIG_SECURITY_NETWORK_XFRM 1513#ifdef CONFIG_SECURITY_NETWORK_XFRM
1457 int (*xfrm_policy_alloc_security) (struct xfrm_policy *xp, 1514 int (*xfrm_policy_alloc_security) (struct xfrm_sec_ctx **ctxp,
1458 struct xfrm_user_sec_ctx *sec_ctx); 1515 struct xfrm_user_sec_ctx *sec_ctx);
1459 int (*xfrm_policy_clone_security) (struct xfrm_policy *old, struct xfrm_policy *new); 1516 int (*xfrm_policy_clone_security) (struct xfrm_sec_ctx *old_ctx, struct xfrm_sec_ctx **new_ctx);
1460 void (*xfrm_policy_free_security) (struct xfrm_policy *xp); 1517 void (*xfrm_policy_free_security) (struct xfrm_sec_ctx *ctx);
1461 int (*xfrm_policy_delete_security) (struct xfrm_policy *xp); 1518 int (*xfrm_policy_delete_security) (struct xfrm_sec_ctx *ctx);
1462 int (*xfrm_state_alloc_security) (struct xfrm_state *x, 1519 int (*xfrm_state_alloc_security) (struct xfrm_state *x,
1463 struct xfrm_user_sec_ctx *sec_ctx, 1520 struct xfrm_user_sec_ctx *sec_ctx,
1464 u32 secid); 1521 u32 secid);
1465 void (*xfrm_state_free_security) (struct xfrm_state *x); 1522 void (*xfrm_state_free_security) (struct xfrm_state *x);
1466 int (*xfrm_state_delete_security) (struct xfrm_state *x); 1523 int (*xfrm_state_delete_security) (struct xfrm_state *x);
1467 int (*xfrm_policy_lookup)(struct xfrm_policy *xp, u32 fl_secid, u8 dir); 1524 int (*xfrm_policy_lookup)(struct xfrm_sec_ctx *ctx, u32 fl_secid, u8 dir);
1468 int (*xfrm_state_pol_flow_match)(struct xfrm_state *x, 1525 int (*xfrm_state_pol_flow_match)(struct xfrm_state *x,
1469 struct xfrm_policy *xp, struct flowi *fl); 1526 struct xfrm_policy *xp, struct flowi *fl);
1470 int (*xfrm_decode_session)(struct sk_buff *skb, u32 *secid, int ckall); 1527 int (*xfrm_decode_session)(struct sk_buff *skb, u32 *secid, int ckall);
@@ -1480,10 +1537,18 @@ struct security_operations {
1480 1537
1481#endif /* CONFIG_KEYS */ 1538#endif /* CONFIG_KEYS */
1482 1539
1540#ifdef CONFIG_AUDIT
1541 int (*audit_rule_init)(u32 field, u32 op, char *rulestr, void **lsmrule);
1542 int (*audit_rule_known)(struct audit_krule *krule);
1543 int (*audit_rule_match)(u32 secid, u32 field, u32 op, void *lsmrule,
1544 struct audit_context *actx);
1545 void (*audit_rule_free)(void *lsmrule);
1546#endif /* CONFIG_AUDIT */
1483}; 1547};
1484 1548
1485/* prototypes */ 1549/* prototypes */
1486extern int security_init (void); 1550extern int security_init (void);
1551extern int security_module_enable(struct security_operations *ops);
1487extern int register_security (struct security_operations *ops); 1552extern int register_security (struct security_operations *ops);
1488extern int mod_reg_security (const char *name, struct security_operations *ops); 1553extern int mod_reg_security (const char *name, struct security_operations *ops);
1489extern struct dentry *securityfs_create_file(const char *name, mode_t mode, 1554extern struct dentry *securityfs_create_file(const char *name, mode_t mode,
@@ -1578,6 +1643,7 @@ int security_inode_killpriv(struct dentry *dentry);
1578int security_inode_getsecurity(const struct inode *inode, const char *name, void **buffer, bool alloc); 1643int security_inode_getsecurity(const struct inode *inode, const char *name, void **buffer, bool alloc);
1579int security_inode_setsecurity(struct inode *inode, const char *name, const void *value, size_t size, int flags); 1644int security_inode_setsecurity(struct inode *inode, const char *name, const void *value, size_t size, int flags);
1580int security_inode_listsecurity(struct inode *inode, char *buffer, size_t buffer_size); 1645int security_inode_listsecurity(struct inode *inode, char *buffer, size_t buffer_size);
1646void security_inode_getsecid(const struct inode *inode, u32 *secid);
1581int security_file_permission(struct file *file, int mask); 1647int security_file_permission(struct file *file, int mask);
1582int security_file_alloc(struct file *file); 1648int security_file_alloc(struct file *file);
1583void security_file_free(struct file *file); 1649void security_file_free(struct file *file);
@@ -1622,6 +1688,7 @@ int security_task_prctl(int option, unsigned long arg2, unsigned long arg3,
1622void security_task_reparent_to_init(struct task_struct *p); 1688void security_task_reparent_to_init(struct task_struct *p);
1623void security_task_to_inode(struct task_struct *p, struct inode *inode); 1689void security_task_to_inode(struct task_struct *p, struct inode *inode);
1624int security_ipc_permission(struct kern_ipc_perm *ipcp, short flag); 1690int security_ipc_permission(struct kern_ipc_perm *ipcp, short flag);
1691void security_ipc_getsecid(struct kern_ipc_perm *ipcp, u32 *secid);
1625int security_msg_msg_alloc(struct msg_msg *msg); 1692int security_msg_msg_alloc(struct msg_msg *msg);
1626void security_msg_msg_free(struct msg_msg *msg); 1693void security_msg_msg_free(struct msg_msg *msg);
1627int security_msg_queue_alloc(struct msg_queue *msq); 1694int security_msg_queue_alloc(struct msg_queue *msq);
@@ -2022,6 +2089,11 @@ static inline int security_inode_listsecurity(struct inode *inode, char *buffer,
2022 return 0; 2089 return 0;
2023} 2090}
2024 2091
2092static inline void security_inode_getsecid(const struct inode *inode, u32 *secid)
2093{
2094 *secid = 0;
2095}
2096
2025static inline int security_file_permission (struct file *file, int mask) 2097static inline int security_file_permission (struct file *file, int mask)
2026{ 2098{
2027 return 0; 2099 return 0;
@@ -2137,7 +2209,9 @@ static inline int security_task_getsid (struct task_struct *p)
2137} 2209}
2138 2210
2139static inline void security_task_getsecid (struct task_struct *p, u32 *secid) 2211static inline void security_task_getsecid (struct task_struct *p, u32 *secid)
2140{ } 2212{
2213 *secid = 0;
2214}
2141 2215
2142static inline int security_task_setgroups (struct group_info *group_info) 2216static inline int security_task_setgroups (struct group_info *group_info)
2143{ 2217{
@@ -2216,6 +2290,11 @@ static inline int security_ipc_permission (struct kern_ipc_perm *ipcp,
2216 return 0; 2290 return 0;
2217} 2291}
2218 2292
2293static inline void security_ipc_getsecid(struct kern_ipc_perm *ipcp, u32 *secid)
2294{
2295 *secid = 0;
2296}
2297
2219static inline int security_msg_msg_alloc (struct msg_msg * msg) 2298static inline int security_msg_msg_alloc (struct msg_msg * msg)
2220{ 2299{
2221 return 0; 2300 return 0;
@@ -2562,16 +2641,16 @@ static inline void security_inet_conn_established(struct sock *sk,
2562 2641
2563#ifdef CONFIG_SECURITY_NETWORK_XFRM 2642#ifdef CONFIG_SECURITY_NETWORK_XFRM
2564 2643
2565int security_xfrm_policy_alloc(struct xfrm_policy *xp, struct xfrm_user_sec_ctx *sec_ctx); 2644int security_xfrm_policy_alloc(struct xfrm_sec_ctx **ctxp, struct xfrm_user_sec_ctx *sec_ctx);
2566int security_xfrm_policy_clone(struct xfrm_policy *old, struct xfrm_policy *new); 2645int security_xfrm_policy_clone(struct xfrm_sec_ctx *old_ctx, struct xfrm_sec_ctx **new_ctxp);
2567void security_xfrm_policy_free(struct xfrm_policy *xp); 2646void security_xfrm_policy_free(struct xfrm_sec_ctx *ctx);
2568int security_xfrm_policy_delete(struct xfrm_policy *xp); 2647int security_xfrm_policy_delete(struct xfrm_sec_ctx *ctx);
2569int security_xfrm_state_alloc(struct xfrm_state *x, struct xfrm_user_sec_ctx *sec_ctx); 2648int security_xfrm_state_alloc(struct xfrm_state *x, struct xfrm_user_sec_ctx *sec_ctx);
2570int security_xfrm_state_alloc_acquire(struct xfrm_state *x, 2649int security_xfrm_state_alloc_acquire(struct xfrm_state *x,
2571 struct xfrm_sec_ctx *polsec, u32 secid); 2650 struct xfrm_sec_ctx *polsec, u32 secid);
2572int security_xfrm_state_delete(struct xfrm_state *x); 2651int security_xfrm_state_delete(struct xfrm_state *x);
2573void security_xfrm_state_free(struct xfrm_state *x); 2652void security_xfrm_state_free(struct xfrm_state *x);
2574int security_xfrm_policy_lookup(struct xfrm_policy *xp, u32 fl_secid, u8 dir); 2653int security_xfrm_policy_lookup(struct xfrm_sec_ctx *ctx, u32 fl_secid, u8 dir);
2575int security_xfrm_state_pol_flow_match(struct xfrm_state *x, 2654int security_xfrm_state_pol_flow_match(struct xfrm_state *x,
2576 struct xfrm_policy *xp, struct flowi *fl); 2655 struct xfrm_policy *xp, struct flowi *fl);
2577int security_xfrm_decode_session(struct sk_buff *skb, u32 *secid); 2656int security_xfrm_decode_session(struct sk_buff *skb, u32 *secid);
@@ -2579,21 +2658,21 @@ void security_skb_classify_flow(struct sk_buff *skb, struct flowi *fl);
2579 2658
2580#else /* CONFIG_SECURITY_NETWORK_XFRM */ 2659#else /* CONFIG_SECURITY_NETWORK_XFRM */
2581 2660
2582static inline int security_xfrm_policy_alloc(struct xfrm_policy *xp, struct xfrm_user_sec_ctx *sec_ctx) 2661static inline int security_xfrm_policy_alloc(struct xfrm_sec_ctx **ctxp, struct xfrm_user_sec_ctx *sec_ctx)
2583{ 2662{
2584 return 0; 2663 return 0;
2585} 2664}
2586 2665
2587static inline int security_xfrm_policy_clone(struct xfrm_policy *old, struct xfrm_policy *new) 2666static inline int security_xfrm_policy_clone(struct xfrm_sec_ctx *old, struct xfrm_sec_ctx **new_ctxp)
2588{ 2667{
2589 return 0; 2668 return 0;
2590} 2669}
2591 2670
2592static inline void security_xfrm_policy_free(struct xfrm_policy *xp) 2671static inline void security_xfrm_policy_free(struct xfrm_sec_ctx *ctx)
2593{ 2672{
2594} 2673}
2595 2674
2596static inline int security_xfrm_policy_delete(struct xfrm_policy *xp) 2675static inline int security_xfrm_policy_delete(struct xfrm_sec_ctx *ctx)
2597{ 2676{
2598 return 0; 2677 return 0;
2599} 2678}
@@ -2619,7 +2698,7 @@ static inline int security_xfrm_state_delete(struct xfrm_state *x)
2619 return 0; 2698 return 0;
2620} 2699}
2621 2700
2622static inline int security_xfrm_policy_lookup(struct xfrm_policy *xp, u32 fl_secid, u8 dir) 2701static inline int security_xfrm_policy_lookup(struct xfrm_sec_ctx *ctx, u32 fl_secid, u8 dir)
2623{ 2702{
2624 return 0; 2703 return 0;
2625} 2704}
@@ -2672,5 +2751,38 @@ static inline int security_key_permission(key_ref_t key_ref,
2672#endif 2751#endif
2673#endif /* CONFIG_KEYS */ 2752#endif /* CONFIG_KEYS */
2674 2753
2754#ifdef CONFIG_AUDIT
2755#ifdef CONFIG_SECURITY
2756int security_audit_rule_init(u32 field, u32 op, char *rulestr, void **lsmrule);
2757int security_audit_rule_known(struct audit_krule *krule);
2758int security_audit_rule_match(u32 secid, u32 field, u32 op, void *lsmrule,
2759 struct audit_context *actx);
2760void security_audit_rule_free(void *lsmrule);
2761
2762#else
2763
2764static inline int security_audit_rule_init(u32 field, u32 op, char *rulestr,
2765 void **lsmrule)
2766{
2767 return 0;
2768}
2769
2770static inline int security_audit_rule_known(struct audit_krule *krule)
2771{
2772 return 0;
2773}
2774
2775static inline int security_audit_rule_match(u32 secid, u32 field, u32 op,
2776 void *lsmrule, struct audit_context *actx)
2777{
2778 return 0;
2779}
2780
2781static inline void security_audit_rule_free(void *lsmrule)
2782{ }
2783
2784#endif /* CONFIG_SECURITY */
2785#endif /* CONFIG_AUDIT */
2786
2675#endif /* ! __LINUX_SECURITY_H */ 2787#endif /* ! __LINUX_SECURITY_H */
2676 2788
diff --git a/include/linux/selinux.h b/include/linux/selinux.h
index 8c2cc4c02526..20f965d4b041 100644
--- a/include/linux/selinux.h
+++ b/include/linux/selinux.h
@@ -16,99 +16,11 @@
16 16
17struct selinux_audit_rule; 17struct selinux_audit_rule;
18struct audit_context; 18struct audit_context;
19struct inode;
20struct kern_ipc_perm; 19struct kern_ipc_perm;
21 20
22#ifdef CONFIG_SECURITY_SELINUX 21#ifdef CONFIG_SECURITY_SELINUX
23 22
24/** 23/**
25 * selinux_audit_rule_init - alloc/init an selinux audit rule structure.
26 * @field: the field this rule refers to
27 * @op: the operater the rule uses
28 * @rulestr: the text "target" of the rule
29 * @rule: pointer to the new rule structure returned via this
30 *
31 * Returns 0 if successful, -errno if not. On success, the rule structure
32 * will be allocated internally. The caller must free this structure with
33 * selinux_audit_rule_free() after use.
34 */
35int selinux_audit_rule_init(u32 field, u32 op, char *rulestr,
36 struct selinux_audit_rule **rule);
37
38/**
39 * selinux_audit_rule_free - free an selinux audit rule structure.
40 * @rule: pointer to the audit rule to be freed
41 *
42 * This will free all memory associated with the given rule.
43 * If @rule is NULL, no operation is performed.
44 */
45void selinux_audit_rule_free(struct selinux_audit_rule *rule);
46
47/**
48 * selinux_audit_rule_match - determine if a context ID matches a rule.
49 * @sid: the context ID to check
50 * @field: the field this rule refers to
51 * @op: the operater the rule uses
52 * @rule: pointer to the audit rule to check against
53 * @actx: the audit context (can be NULL) associated with the check
54 *
55 * Returns 1 if the context id matches the rule, 0 if it does not, and
56 * -errno on failure.
57 */
58int selinux_audit_rule_match(u32 sid, u32 field, u32 op,
59 struct selinux_audit_rule *rule,
60 struct audit_context *actx);
61
62/**
63 * selinux_audit_set_callback - set the callback for policy reloads.
64 * @callback: the function to call when the policy is reloaded
65 *
66 * This sets the function callback function that will update the rules
67 * upon policy reloads. This callback should rebuild all existing rules
68 * using selinux_audit_rule_init().
69 */
70void selinux_audit_set_callback(int (*callback)(void));
71
72/**
73 * selinux_sid_to_string - map a security context ID to a string
74 * @sid: security context ID to be converted.
75 * @ctx: address of context string to be returned
76 * @ctxlen: length of returned context string.
77 *
78 * Returns 0 if successful, -errno if not. On success, the context
79 * string will be allocated internally, and the caller must call
80 * kfree() on it after use.
81 */
82int selinux_sid_to_string(u32 sid, char **ctx, u32 *ctxlen);
83
84/**
85 * selinux_get_inode_sid - get the inode's security context ID
86 * @inode: inode structure to get the sid from.
87 * @sid: pointer to security context ID to be filled in.
88 *
89 * Returns nothing
90 */
91void selinux_get_inode_sid(const struct inode *inode, u32 *sid);
92
93/**
94 * selinux_get_ipc_sid - get the ipc security context ID
95 * @ipcp: ipc structure to get the sid from.
96 * @sid: pointer to security context ID to be filled in.
97 *
98 * Returns nothing
99 */
100void selinux_get_ipc_sid(const struct kern_ipc_perm *ipcp, u32 *sid);
101
102/**
103 * selinux_get_task_sid - return the SID of task
104 * @tsk: the task whose SID will be returned
105 * @sid: pointer to security context ID to be filled in.
106 *
107 * Returns nothing
108 */
109void selinux_get_task_sid(struct task_struct *tsk, u32 *sid);
110
111/**
112 * selinux_string_to_sid - map a security context string to a security ID 24 * selinux_string_to_sid - map a security context string to a security ID
113 * @str: the security context string to be mapped 25 * @str: the security context string to be mapped
114 * @sid: ID value returned via this. 26 * @sid: ID value returned via this.
@@ -151,52 +63,6 @@ void selinux_secmark_refcount_inc(void);
151void selinux_secmark_refcount_dec(void); 63void selinux_secmark_refcount_dec(void);
152#else 64#else
153 65
154static inline int selinux_audit_rule_init(u32 field, u32 op,
155 char *rulestr,
156 struct selinux_audit_rule **rule)
157{
158 return -EOPNOTSUPP;
159}
160
161static inline void selinux_audit_rule_free(struct selinux_audit_rule *rule)
162{
163 return;
164}
165
166static inline int selinux_audit_rule_match(u32 sid, u32 field, u32 op,
167 struct selinux_audit_rule *rule,
168 struct audit_context *actx)
169{
170 return 0;
171}
172
173static inline void selinux_audit_set_callback(int (*callback)(void))
174{
175 return;
176}
177
178static inline int selinux_sid_to_string(u32 sid, char **ctx, u32 *ctxlen)
179{
180 *ctx = NULL;
181 *ctxlen = 0;
182 return 0;
183}
184
185static inline void selinux_get_inode_sid(const struct inode *inode, u32 *sid)
186{
187 *sid = 0;
188}
189
190static inline void selinux_get_ipc_sid(const struct kern_ipc_perm *ipcp, u32 *sid)
191{
192 *sid = 0;
193}
194
195static inline void selinux_get_task_sid(struct task_struct *tsk, u32 *sid)
196{
197 *sid = 0;
198}
199
200static inline int selinux_string_to_sid(const char *str, u32 *sid) 66static inline int selinux_string_to_sid(const char *str, u32 *sid)
201{ 67{
202 *sid = 0; 68 *sid = 0;
diff --git a/include/linux/seq_file.h b/include/linux/seq_file.h
index 67c2563961f3..1da1e6208a0a 100644
--- a/include/linux/seq_file.h
+++ b/include/linux/seq_file.h
@@ -62,18 +62,5 @@ extern struct list_head *seq_list_start_head(struct list_head *head,
62extern struct list_head *seq_list_next(void *v, struct list_head *head, 62extern struct list_head *seq_list_next(void *v, struct list_head *head,
63 loff_t *ppos); 63 loff_t *ppos);
64 64
65struct net;
66struct seq_net_private {
67 struct net *net;
68};
69
70int seq_open_net(struct inode *, struct file *,
71 const struct seq_operations *, int);
72int seq_release_net(struct inode *, struct file *);
73static inline struct net *seq_file_net(struct seq_file *seq)
74{
75 return ((struct seq_net_private *)seq->private)->net;
76}
77
78#endif 65#endif
79#endif 66#endif
diff --git a/include/linux/seq_file_net.h b/include/linux/seq_file_net.h
new file mode 100644
index 000000000000..4ac52542a563
--- /dev/null
+++ b/include/linux/seq_file_net.h
@@ -0,0 +1,27 @@
1#ifndef __SEQ_FILE_NET_H__
2#define __SEQ_FILE_NET_H__
3
4#include <linux/seq_file.h>
5
6struct net;
7extern struct net init_net;
8
9struct seq_net_private {
10#ifdef CONFIG_NET_NS
11 struct net *net;
12#endif
13};
14
15int seq_open_net(struct inode *, struct file *,
16 const struct seq_operations *, int);
17int seq_release_net(struct inode *, struct file *);
18static inline struct net *seq_file_net(struct seq_file *seq)
19{
20#ifdef CONFIG_NET_NS
21 return ((struct seq_net_private *)seq->private)->net;
22#else
23 return &init_net;
24#endif
25}
26
27#endif
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index bbd8d0027e2f..299ec4b31412 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -242,6 +242,7 @@ typedef unsigned char *sk_buff_data_t;
242 * @queue_mapping: Queue mapping for multiqueue devices 242 * @queue_mapping: Queue mapping for multiqueue devices
243 * @tc_index: Traffic control index 243 * @tc_index: Traffic control index
244 * @tc_verd: traffic control verdict 244 * @tc_verd: traffic control verdict
245 * @ndisc_nodetype: router type (from link layer)
245 * @dma_cookie: a cookie to one of several possible DMA operations 246 * @dma_cookie: a cookie to one of several possible DMA operations
246 * done by skb DMA functions 247 * done by skb DMA functions
247 * @secmark: security marking 248 * @secmark: security marking
@@ -256,7 +257,10 @@ struct sk_buff {
256 ktime_t tstamp; 257 ktime_t tstamp;
257 struct net_device *dev; 258 struct net_device *dev;
258 259
259 struct dst_entry *dst; 260 union {
261 struct dst_entry *dst;
262 struct rtable *rtable;
263 };
260 struct sec_path *sp; 264 struct sec_path *sp;
261 265
262 /* 266 /*
@@ -310,7 +314,10 @@ struct sk_buff {
310 __u16 tc_verd; /* traffic control verdict */ 314 __u16 tc_verd; /* traffic control verdict */
311#endif 315#endif
312#endif 316#endif
313 /* 2 byte hole */ 317#ifdef CONFIG_IPV6_NDISC_NODETYPE
318 __u8 ndisc_nodetype:2;
319#endif
320 /* 14 bit hole */
314 321
315#ifdef CONFIG_NET_DMA 322#ifdef CONFIG_NET_DMA
316 dma_cookie_t dma_cookie; 323 dma_cookie_t dma_cookie;
@@ -657,11 +664,21 @@ static inline void skb_queue_head_init_class(struct sk_buff_head *list,
657} 664}
658 665
659/* 666/*
660 * Insert an sk_buff at the start of a list. 667 * Insert an sk_buff on a list.
661 * 668 *
662 * The "__skb_xxxx()" functions are the non-atomic ones that 669 * The "__skb_xxxx()" functions are the non-atomic ones that
663 * can only be called with interrupts disabled. 670 * can only be called with interrupts disabled.
664 */ 671 */
672extern void skb_insert(struct sk_buff *old, struct sk_buff *newsk, struct sk_buff_head *list);
673static inline void __skb_insert(struct sk_buff *newsk,
674 struct sk_buff *prev, struct sk_buff *next,
675 struct sk_buff_head *list)
676{
677 newsk->next = next;
678 newsk->prev = prev;
679 next->prev = prev->next = newsk;
680 list->qlen++;
681}
665 682
666/** 683/**
667 * __skb_queue_after - queue a buffer at the list head 684 * __skb_queue_after - queue a buffer at the list head
@@ -678,13 +695,17 @@ static inline void __skb_queue_after(struct sk_buff_head *list,
678 struct sk_buff *prev, 695 struct sk_buff *prev,
679 struct sk_buff *newsk) 696 struct sk_buff *newsk)
680{ 697{
681 struct sk_buff *next; 698 __skb_insert(newsk, prev, prev->next, list);
682 list->qlen++; 699}
683 700
684 next = prev->next; 701extern void skb_append(struct sk_buff *old, struct sk_buff *newsk,
685 newsk->next = next; 702 struct sk_buff_head *list);
686 newsk->prev = prev; 703
687 next->prev = prev->next = newsk; 704static inline void __skb_queue_before(struct sk_buff_head *list,
705 struct sk_buff *next,
706 struct sk_buff *newsk)
707{
708 __skb_insert(newsk, next->prev, next, list);
688} 709}
689 710
690/** 711/**
@@ -718,66 +739,7 @@ extern void skb_queue_tail(struct sk_buff_head *list, struct sk_buff *newsk);
718static inline void __skb_queue_tail(struct sk_buff_head *list, 739static inline void __skb_queue_tail(struct sk_buff_head *list,
719 struct sk_buff *newsk) 740 struct sk_buff *newsk)
720{ 741{
721 struct sk_buff *prev, *next; 742 __skb_queue_before(list, (struct sk_buff *)list, newsk);
722
723 list->qlen++;
724 next = (struct sk_buff *)list;
725 prev = next->prev;
726 newsk->next = next;
727 newsk->prev = prev;
728 next->prev = prev->next = newsk;
729}
730
731
732/**
733 * __skb_dequeue - remove from the head of the queue
734 * @list: list to dequeue from
735 *
736 * Remove the head of the list. This function does not take any locks
737 * so must be used with appropriate locks held only. The head item is
738 * returned or %NULL if the list is empty.
739 */
740extern struct sk_buff *skb_dequeue(struct sk_buff_head *list);
741static inline struct sk_buff *__skb_dequeue(struct sk_buff_head *list)
742{
743 struct sk_buff *next, *prev, *result;
744
745 prev = (struct sk_buff *) list;
746 next = prev->next;
747 result = NULL;
748 if (next != prev) {
749 result = next;
750 next = next->next;
751 list->qlen--;
752 next->prev = prev;
753 prev->next = next;
754 result->next = result->prev = NULL;
755 }
756 return result;
757}
758
759
760/*
761 * Insert a packet on a list.
762 */
763extern void skb_insert(struct sk_buff *old, struct sk_buff *newsk, struct sk_buff_head *list);
764static inline void __skb_insert(struct sk_buff *newsk,
765 struct sk_buff *prev, struct sk_buff *next,
766 struct sk_buff_head *list)
767{
768 newsk->next = next;
769 newsk->prev = prev;
770 next->prev = prev->next = newsk;
771 list->qlen++;
772}
773
774/*
775 * Place a packet after a given packet in a list.
776 */
777extern void skb_append(struct sk_buff *old, struct sk_buff *newsk, struct sk_buff_head *list);
778static inline void __skb_append(struct sk_buff *old, struct sk_buff *newsk, struct sk_buff_head *list)
779{
780 __skb_insert(newsk, old, old->next, list);
781} 743}
782 744
783/* 745/*
@@ -797,8 +759,22 @@ static inline void __skb_unlink(struct sk_buff *skb, struct sk_buff_head *list)
797 prev->next = next; 759 prev->next = next;
798} 760}
799 761
800 762/**
801/* XXX: more streamlined implementation */ 763 * __skb_dequeue - remove from the head of the queue
764 * @list: list to dequeue from
765 *
766 * Remove the head of the list. This function does not take any locks
767 * so must be used with appropriate locks held only. The head item is
768 * returned or %NULL if the list is empty.
769 */
770extern struct sk_buff *skb_dequeue(struct sk_buff_head *list);
771static inline struct sk_buff *__skb_dequeue(struct sk_buff_head *list)
772{
773 struct sk_buff *skb = skb_peek(list);
774 if (skb)
775 __skb_unlink(skb, list);
776 return skb;
777}
802 778
803/** 779/**
804 * __skb_dequeue_tail - remove from the tail of the queue 780 * __skb_dequeue_tail - remove from the tail of the queue
@@ -889,6 +865,7 @@ static inline void skb_set_tail_pointer(struct sk_buff *skb, const int offset)
889/* 865/*
890 * Add data to an sk_buff 866 * Add data to an sk_buff
891 */ 867 */
868extern unsigned char *skb_put(struct sk_buff *skb, unsigned int len);
892static inline unsigned char *__skb_put(struct sk_buff *skb, unsigned int len) 869static inline unsigned char *__skb_put(struct sk_buff *skb, unsigned int len)
893{ 870{
894 unsigned char *tmp = skb_tail_pointer(skb); 871 unsigned char *tmp = skb_tail_pointer(skb);
@@ -898,26 +875,7 @@ static inline unsigned char *__skb_put(struct sk_buff *skb, unsigned int len)
898 return tmp; 875 return tmp;
899} 876}
900 877
901/** 878extern unsigned char *skb_push(struct sk_buff *skb, unsigned int len);
902 * skb_put - add data to a buffer
903 * @skb: buffer to use
904 * @len: amount of data to add
905 *
906 * This function extends the used data area of the buffer. If this would
907 * exceed the total buffer size the kernel will panic. A pointer to the
908 * first byte of the extra data is returned.
909 */
910static inline unsigned char *skb_put(struct sk_buff *skb, unsigned int len)
911{
912 unsigned char *tmp = skb_tail_pointer(skb);
913 SKB_LINEAR_ASSERT(skb);
914 skb->tail += len;
915 skb->len += len;
916 if (unlikely(skb->tail > skb->end))
917 skb_over_panic(skb, len, current_text_addr());
918 return tmp;
919}
920
921static inline unsigned char *__skb_push(struct sk_buff *skb, unsigned int len) 879static inline unsigned char *__skb_push(struct sk_buff *skb, unsigned int len)
922{ 880{
923 skb->data -= len; 881 skb->data -= len;
@@ -925,24 +883,7 @@ static inline unsigned char *__skb_push(struct sk_buff *skb, unsigned int len)
925 return skb->data; 883 return skb->data;
926} 884}
927 885
928/** 886extern unsigned char *skb_pull(struct sk_buff *skb, unsigned int len);
929 * skb_push - add data to the start of a buffer
930 * @skb: buffer to use
931 * @len: amount of data to add
932 *
933 * This function extends the used data area of the buffer at the buffer
934 * start. If this would exceed the total buffer headroom the kernel will
935 * panic. A pointer to the first byte of the extra data is returned.
936 */
937static inline unsigned char *skb_push(struct sk_buff *skb, unsigned int len)
938{
939 skb->data -= len;
940 skb->len += len;
941 if (unlikely(skb->data<skb->head))
942 skb_under_panic(skb, len, current_text_addr());
943 return skb->data;
944}
945
946static inline unsigned char *__skb_pull(struct sk_buff *skb, unsigned int len) 887static inline unsigned char *__skb_pull(struct sk_buff *skb, unsigned int len)
947{ 888{
948 skb->len -= len; 889 skb->len -= len;
@@ -950,21 +891,6 @@ static inline unsigned char *__skb_pull(struct sk_buff *skb, unsigned int len)
950 return skb->data += len; 891 return skb->data += len;
951} 892}
952 893
953/**
954 * skb_pull - remove data from the start of a buffer
955 * @skb: buffer to use
956 * @len: amount of data to remove
957 *
958 * This function removes data from the start of a buffer, returning
959 * the memory to the headroom. A pointer to the next data in the buffer
960 * is returned. Once the data has been pulled future pushes will overwrite
961 * the old data.
962 */
963static inline unsigned char *skb_pull(struct sk_buff *skb, unsigned int len)
964{
965 return unlikely(len > skb->len) ? NULL : __skb_pull(skb, len);
966}
967
968extern unsigned char *__pskb_pull_tail(struct sk_buff *skb, int delta); 894extern unsigned char *__pskb_pull_tail(struct sk_buff *skb, int delta);
969 895
970static inline unsigned char *__pskb_pull(struct sk_buff *skb, unsigned int len) 896static inline unsigned char *__pskb_pull(struct sk_buff *skb, unsigned int len)
@@ -1205,21 +1131,7 @@ static inline void __skb_trim(struct sk_buff *skb, unsigned int len)
1205 skb_set_tail_pointer(skb, len); 1131 skb_set_tail_pointer(skb, len);
1206} 1132}
1207 1133
1208/** 1134extern void skb_trim(struct sk_buff *skb, unsigned int len);
1209 * skb_trim - remove end from a buffer
1210 * @skb: buffer to alter
1211 * @len: new length
1212 *
1213 * Cut the length of a buffer down by removing data from the tail. If
1214 * the buffer is already under the length specified it is not modified.
1215 * The skb must be linear.
1216 */
1217static inline void skb_trim(struct sk_buff *skb, unsigned int len)
1218{
1219 if (skb->len > len)
1220 __skb_trim(skb, len);
1221}
1222
1223 1135
1224static inline int __pskb_trim(struct sk_buff *skb, unsigned int len) 1136static inline int __pskb_trim(struct sk_buff *skb, unsigned int len)
1225{ 1137{
@@ -1302,22 +1214,7 @@ static inline struct sk_buff *__dev_alloc_skb(unsigned int length,
1302 return skb; 1214 return skb;
1303} 1215}
1304 1216
1305/** 1217extern struct sk_buff *dev_alloc_skb(unsigned int length);
1306 * dev_alloc_skb - allocate an skbuff for receiving
1307 * @length: length to allocate
1308 *
1309 * Allocate a new &sk_buff and assign it a usage count of one. The
1310 * buffer has unspecified headroom built in. Users should allocate
1311 * the headroom they think they need without accounting for the
1312 * built in space. The built in space is used for optimisations.
1313 *
1314 * %NULL is returned if there is no free memory. Although this function
1315 * allocates memory it can be called from an interrupt.
1316 */
1317static inline struct sk_buff *dev_alloc_skb(unsigned int length)
1318{
1319 return __dev_alloc_skb(length, GFP_ATOMIC);
1320}
1321 1218
1322extern struct sk_buff *__netdev_alloc_skb(struct net_device *dev, 1219extern struct sk_buff *__netdev_alloc_skb(struct net_device *dev,
1323 unsigned int length, gfp_t gfp_mask); 1220 unsigned int length, gfp_t gfp_mask);
diff --git a/include/linux/smc91x.h b/include/linux/smc91x.h
new file mode 100644
index 000000000000..8e0556b8781c
--- /dev/null
+++ b/include/linux/smc91x.h
@@ -0,0 +1,13 @@
1#ifndef __SMC91X_H__
2#define __SMC91X_H__
3
4#define SMC91X_USE_8BIT (1 << 0)
5#define SMC91X_USE_16BIT (1 << 1)
6#define SMC91X_USE_32BIT (1 << 2)
7
8struct smc91x_platdata {
9 unsigned long flags;
10 unsigned long irq_flags; /* IRQF_... */
11};
12
13#endif /* __SMC91X_H__ */
diff --git a/include/linux/ssb/ssb.h b/include/linux/ssb/ssb.h
index db53defde5ee..50dfd0dc4093 100644
--- a/include/linux/ssb/ssb.h
+++ b/include/linux/ssb/ssb.h
@@ -72,10 +72,18 @@ struct ssb_device;
72/* Lowlevel read/write operations on the device MMIO. 72/* Lowlevel read/write operations on the device MMIO.
73 * Internal, don't use that outside of ssb. */ 73 * Internal, don't use that outside of ssb. */
74struct ssb_bus_ops { 74struct ssb_bus_ops {
75 u8 (*read8)(struct ssb_device *dev, u16 offset);
75 u16 (*read16)(struct ssb_device *dev, u16 offset); 76 u16 (*read16)(struct ssb_device *dev, u16 offset);
76 u32 (*read32)(struct ssb_device *dev, u16 offset); 77 u32 (*read32)(struct ssb_device *dev, u16 offset);
78 void (*write8)(struct ssb_device *dev, u16 offset, u8 value);
77 void (*write16)(struct ssb_device *dev, u16 offset, u16 value); 79 void (*write16)(struct ssb_device *dev, u16 offset, u16 value);
78 void (*write32)(struct ssb_device *dev, u16 offset, u32 value); 80 void (*write32)(struct ssb_device *dev, u16 offset, u32 value);
81#ifdef CONFIG_SSB_BLOCKIO
82 void (*block_read)(struct ssb_device *dev, void *buffer,
83 size_t count, u16 offset, u8 reg_width);
84 void (*block_write)(struct ssb_device *dev, const void *buffer,
85 size_t count, u16 offset, u8 reg_width);
86#endif
79}; 87};
80 88
81 89
@@ -247,9 +255,9 @@ struct ssb_bus {
247 /* Pointer to the PCMCIA device (only if bustype == SSB_BUSTYPE_PCMCIA). */ 255 /* Pointer to the PCMCIA device (only if bustype == SSB_BUSTYPE_PCMCIA). */
248 struct pcmcia_device *host_pcmcia; 256 struct pcmcia_device *host_pcmcia;
249 257
250#ifdef CONFIG_SSB_PCIHOST 258#ifdef CONFIG_SSB_SPROM
251 /* Mutex to protect the SPROM writing. */ 259 /* Mutex to protect the SPROM writing. */
252 struct mutex pci_sprom_mutex; 260 struct mutex sprom_mutex;
253#endif 261#endif
254 262
255 /* ID information about the Chip. */ 263 /* ID information about the Chip. */
@@ -262,9 +270,6 @@ struct ssb_bus {
262 struct ssb_device devices[SSB_MAX_NR_CORES]; 270 struct ssb_device devices[SSB_MAX_NR_CORES];
263 u8 nr_devices; 271 u8 nr_devices;
264 272
265 /* Reference count. Number of suspended devices. */
266 u8 suspend_cnt;
267
268 /* Software ID number for this bus. */ 273 /* Software ID number for this bus. */
269 unsigned int busnumber; 274 unsigned int busnumber;
270 275
@@ -336,6 +341,13 @@ extern int ssb_bus_pcmciabus_register(struct ssb_bus *bus,
336 341
337extern void ssb_bus_unregister(struct ssb_bus *bus); 342extern void ssb_bus_unregister(struct ssb_bus *bus);
338 343
344/* Suspend a SSB bus.
345 * Call this from the parent bus suspend routine. */
346extern int ssb_bus_suspend(struct ssb_bus *bus);
347/* Resume a SSB bus.
348 * Call this from the parent bus resume routine. */
349extern int ssb_bus_resume(struct ssb_bus *bus);
350
339extern u32 ssb_clockspeed(struct ssb_bus *bus); 351extern u32 ssb_clockspeed(struct ssb_bus *bus);
340 352
341/* Is the device enabled in hardware? */ 353/* Is the device enabled in hardware? */
@@ -348,6 +360,10 @@ void ssb_device_disable(struct ssb_device *dev, u32 core_specific_flags);
348 360
349 361
350/* Device MMIO register read/write functions. */ 362/* Device MMIO register read/write functions. */
363static inline u8 ssb_read8(struct ssb_device *dev, u16 offset)
364{
365 return dev->ops->read8(dev, offset);
366}
351static inline u16 ssb_read16(struct ssb_device *dev, u16 offset) 367static inline u16 ssb_read16(struct ssb_device *dev, u16 offset)
352{ 368{
353 return dev->ops->read16(dev, offset); 369 return dev->ops->read16(dev, offset);
@@ -356,6 +372,10 @@ static inline u32 ssb_read32(struct ssb_device *dev, u16 offset)
356{ 372{
357 return dev->ops->read32(dev, offset); 373 return dev->ops->read32(dev, offset);
358} 374}
375static inline void ssb_write8(struct ssb_device *dev, u16 offset, u8 value)
376{
377 dev->ops->write8(dev, offset, value);
378}
359static inline void ssb_write16(struct ssb_device *dev, u16 offset, u16 value) 379static inline void ssb_write16(struct ssb_device *dev, u16 offset, u16 value)
360{ 380{
361 dev->ops->write16(dev, offset, value); 381 dev->ops->write16(dev, offset, value);
@@ -364,6 +384,19 @@ static inline void ssb_write32(struct ssb_device *dev, u16 offset, u32 value)
364{ 384{
365 dev->ops->write32(dev, offset, value); 385 dev->ops->write32(dev, offset, value);
366} 386}
387#ifdef CONFIG_SSB_BLOCKIO
388static inline void ssb_block_read(struct ssb_device *dev, void *buffer,
389 size_t count, u16 offset, u8 reg_width)
390{
391 dev->ops->block_read(dev, buffer, count, offset, reg_width);
392}
393
394static inline void ssb_block_write(struct ssb_device *dev, const void *buffer,
395 size_t count, u16 offset, u8 reg_width)
396{
397 dev->ops->block_write(dev, buffer, count, offset, reg_width);
398}
399#endif /* CONFIG_SSB_BLOCKIO */
367 400
368 401
369/* Translation (routing) bits that need to be ORed to DMA 402/* Translation (routing) bits that need to be ORed to DMA
@@ -416,5 +449,12 @@ extern int ssb_bus_powerup(struct ssb_bus *bus, bool dynamic_pctl);
416extern u32 ssb_admatch_base(u32 adm); 449extern u32 ssb_admatch_base(u32 adm);
417extern u32 ssb_admatch_size(u32 adm); 450extern u32 ssb_admatch_size(u32 adm);
418 451
452/* PCI device mapping and fixup routines.
453 * Called from the architecture pcibios init code.
454 * These are only available on SSB_EMBEDDED configurations. */
455#ifdef CONFIG_SSB_EMBEDDED
456int ssb_pcibios_plat_dev_init(struct pci_dev *dev);
457int ssb_pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin);
458#endif /* CONFIG_SSB_EMBEDDED */
419 459
420#endif /* LINUX_SSB_H_ */ 460#endif /* LINUX_SSB_H_ */
diff --git a/include/linux/ssb/ssb_driver_chipcommon.h b/include/linux/ssb/ssb_driver_chipcommon.h
index 536851b946f6..7d7e03dcf77c 100644
--- a/include/linux/ssb/ssb_driver_chipcommon.h
+++ b/include/linux/ssb/ssb_driver_chipcommon.h
@@ -367,8 +367,7 @@ static inline bool ssb_chipco_available(struct ssb_chipcommon *cc)
367 367
368extern void ssb_chipcommon_init(struct ssb_chipcommon *cc); 368extern void ssb_chipcommon_init(struct ssb_chipcommon *cc);
369 369
370#include <linux/pm.h> 370extern void ssb_chipco_suspend(struct ssb_chipcommon *cc);
371extern void ssb_chipco_suspend(struct ssb_chipcommon *cc, pm_message_t state);
372extern void ssb_chipco_resume(struct ssb_chipcommon *cc); 371extern void ssb_chipco_resume(struct ssb_chipcommon *cc);
373 372
374extern void ssb_chipco_get_clockcpu(struct ssb_chipcommon *cc, 373extern void ssb_chipco_get_clockcpu(struct ssb_chipcommon *cc,
@@ -390,6 +389,10 @@ extern void ssb_chipco_set_clockmode(struct ssb_chipcommon *cc,
390extern void ssb_chipco_watchdog_timer_set(struct ssb_chipcommon *cc, 389extern void ssb_chipco_watchdog_timer_set(struct ssb_chipcommon *cc,
391 u32 ticks); 390 u32 ticks);
392 391
392void ssb_chipco_irq_mask(struct ssb_chipcommon *cc, u32 mask, u32 value);
393
394u32 ssb_chipco_irq_status(struct ssb_chipcommon *cc, u32 mask);
395
393/* Chipcommon GPIO pin access. */ 396/* Chipcommon GPIO pin access. */
394u32 ssb_chipco_gpio_in(struct ssb_chipcommon *cc, u32 mask); 397u32 ssb_chipco_gpio_in(struct ssb_chipcommon *cc, u32 mask);
395u32 ssb_chipco_gpio_out(struct ssb_chipcommon *cc, u32 mask, u32 value); 398u32 ssb_chipco_gpio_out(struct ssb_chipcommon *cc, u32 mask, u32 value);
diff --git a/include/linux/ssb/ssb_driver_gige.h b/include/linux/ssb/ssb_driver_gige.h
new file mode 100644
index 000000000000..01fbdf5fef22
--- /dev/null
+++ b/include/linux/ssb/ssb_driver_gige.h
@@ -0,0 +1,174 @@
1#ifndef LINUX_SSB_DRIVER_GIGE_H_
2#define LINUX_SSB_DRIVER_GIGE_H_
3
4#include <linux/ssb/ssb.h>
5#include <linux/pci.h>
6#include <linux/spinlock.h>
7
8
9#ifdef CONFIG_SSB_DRIVER_GIGE
10
11
12#define SSB_GIGE_PCIIO 0x0000 /* PCI I/O Registers (1024 bytes) */
13#define SSB_GIGE_RESERVED 0x0400 /* Reserved (1024 bytes) */
14#define SSB_GIGE_PCICFG 0x0800 /* PCI config space (256 bytes) */
15#define SSB_GIGE_SHIM_FLUSHSTAT 0x0C00 /* PCI to OCP: Flush status control (32bit) */
16#define SSB_GIGE_SHIM_FLUSHRDA 0x0C04 /* PCI to OCP: Flush read address (32bit) */
17#define SSB_GIGE_SHIM_FLUSHTO 0x0C08 /* PCI to OCP: Flush timeout counter (32bit) */
18#define SSB_GIGE_SHIM_BARRIER 0x0C0C /* PCI to OCP: Barrier register (32bit) */
19#define SSB_GIGE_SHIM_MAOCPSI 0x0C10 /* PCI to OCP: MaocpSI Control (32bit) */
20#define SSB_GIGE_SHIM_SIOCPMA 0x0C14 /* PCI to OCP: SiocpMa Control (32bit) */
21
22/* TM Status High flags */
23#define SSB_GIGE_TMSHIGH_RGMII 0x00010000 /* Have an RGMII PHY-bus */
24/* TM Status Low flags */
25#define SSB_GIGE_TMSLOW_TXBYPASS 0x00080000 /* TX bypass (no delay) */
26#define SSB_GIGE_TMSLOW_RXBYPASS 0x00100000 /* RX bypass (no delay) */
27#define SSB_GIGE_TMSLOW_DLLEN 0x01000000 /* Enable DLL controls */
28
29/* Boardflags (low) */
30#define SSB_GIGE_BFL_ROBOSWITCH 0x0010
31
32
33#define SSB_GIGE_MEM_RES_NAME "SSB Broadcom 47xx GigE memory"
34#define SSB_GIGE_IO_RES_NAME "SSB Broadcom 47xx GigE I/O"
35
36struct ssb_gige {
37 struct ssb_device *dev;
38
39 spinlock_t lock;
40
41 /* True, if the device has an RGMII bus.
42 * False, if the device has a GMII bus. */
43 bool has_rgmii;
44
45 /* The PCI controller device. */
46 struct pci_controller pci_controller;
47 struct pci_ops pci_ops;
48 struct resource mem_resource;
49 struct resource io_resource;
50};
51
52/* Check whether a PCI device is a SSB Gigabit Ethernet core. */
53extern bool pdev_is_ssb_gige_core(struct pci_dev *pdev);
54
55/* Convert a pci_dev pointer to a ssb_gige pointer. */
56static inline struct ssb_gige * pdev_to_ssb_gige(struct pci_dev *pdev)
57{
58 if (!pdev_is_ssb_gige_core(pdev))
59 return NULL;
60 return container_of(pdev->bus->ops, struct ssb_gige, pci_ops);
61}
62
63/* Returns whether the PHY is connected by an RGMII bus. */
64static inline bool ssb_gige_is_rgmii(struct pci_dev *pdev)
65{
66 struct ssb_gige *dev = pdev_to_ssb_gige(pdev);
67 return (dev ? dev->has_rgmii : 0);
68}
69
70/* Returns whether we have a Roboswitch. */
71static inline bool ssb_gige_have_roboswitch(struct pci_dev *pdev)
72{
73 struct ssb_gige *dev = pdev_to_ssb_gige(pdev);
74 if (dev)
75 return !!(dev->dev->bus->sprom.boardflags_lo &
76 SSB_GIGE_BFL_ROBOSWITCH);
77 return 0;
78}
79
80/* Returns whether we can only do one DMA at once. */
81static inline bool ssb_gige_one_dma_at_once(struct pci_dev *pdev)
82{
83 struct ssb_gige *dev = pdev_to_ssb_gige(pdev);
84 if (dev)
85 return ((dev->dev->bus->chip_id == 0x4785) &&
86 (dev->dev->bus->chip_rev < 2));
87 return 0;
88}
89
90/* Returns whether we must flush posted writes. */
91static inline bool ssb_gige_must_flush_posted_writes(struct pci_dev *pdev)
92{
93 struct ssb_gige *dev = pdev_to_ssb_gige(pdev);
94 if (dev)
95 return (dev->dev->bus->chip_id == 0x4785);
96 return 0;
97}
98
99extern char * nvram_get(const char *name);
100/* Get the device MAC address */
101static inline void ssb_gige_get_macaddr(struct pci_dev *pdev, u8 *macaddr)
102{
103#ifdef CONFIG_BCM947XX
104 char *res = nvram_get("et0macaddr");
105 if (res)
106 memcpy(macaddr, res, 6);
107#endif
108}
109
110extern int ssb_gige_pcibios_plat_dev_init(struct ssb_device *sdev,
111 struct pci_dev *pdev);
112extern int ssb_gige_map_irq(struct ssb_device *sdev,
113 const struct pci_dev *pdev);
114
115/* The GigE driver is not a standalone module, because we don't have support
116 * for unregistering the driver. So we could not unload the module anyway. */
117extern int ssb_gige_init(void);
118static inline void ssb_gige_exit(void)
119{
120 /* Currently we can not unregister the GigE driver,
121 * because we can not unregister the PCI bridge. */
122 BUG();
123}
124
125
126#else /* CONFIG_SSB_DRIVER_GIGE */
127/* Gigabit Ethernet driver disabled */
128
129
130static inline int ssb_gige_pcibios_plat_dev_init(struct ssb_device *sdev,
131 struct pci_dev *pdev)
132{
133 return -ENOSYS;
134}
135static inline int ssb_gige_map_irq(struct ssb_device *sdev,
136 const struct pci_dev *pdev)
137{
138 return -ENOSYS;
139}
140static inline int ssb_gige_init(void)
141{
142 return 0;
143}
144static inline void ssb_gige_exit(void)
145{
146}
147
148static inline bool pdev_is_ssb_gige_core(struct pci_dev *pdev)
149{
150 return 0;
151}
152static inline struct ssb_gige * pdev_to_ssb_gige(struct pci_dev *pdev)
153{
154 return NULL;
155}
156static inline bool ssb_gige_is_rgmii(struct pci_dev *pdev)
157{
158 return 0;
159}
160static inline bool ssb_gige_have_roboswitch(struct pci_dev *pdev)
161{
162 return 0;
163}
164static inline bool ssb_gige_one_dma_at_once(struct pci_dev *pdev)
165{
166 return 0;
167}
168static inline bool ssb_gige_must_flush_posted_writes(struct pci_dev *pdev)
169{
170 return 0;
171}
172
173#endif /* CONFIG_SSB_DRIVER_GIGE */
174#endif /* LINUX_SSB_DRIVER_GIGE_H_ */
diff --git a/include/linux/ssb/ssb_driver_pci.h b/include/linux/ssb/ssb_driver_pci.h
index 5e25bac4ed31..41e330e51c2a 100644
--- a/include/linux/ssb/ssb_driver_pci.h
+++ b/include/linux/ssb/ssb_driver_pci.h
@@ -1,6 +1,11 @@
1#ifndef LINUX_SSB_PCICORE_H_ 1#ifndef LINUX_SSB_PCICORE_H_
2#define LINUX_SSB_PCICORE_H_ 2#define LINUX_SSB_PCICORE_H_
3 3
4#include <linux/types.h>
5
6struct pci_dev;
7
8
4#ifdef CONFIG_SSB_DRIVER_PCICORE 9#ifdef CONFIG_SSB_DRIVER_PCICORE
5 10
6/* PCI core registers. */ 11/* PCI core registers. */
@@ -88,6 +93,9 @@ extern void ssb_pcicore_init(struct ssb_pcicore *pc);
88extern int ssb_pcicore_dev_irqvecs_enable(struct ssb_pcicore *pc, 93extern int ssb_pcicore_dev_irqvecs_enable(struct ssb_pcicore *pc,
89 struct ssb_device *dev); 94 struct ssb_device *dev);
90 95
96int ssb_pcicore_plat_dev_init(struct pci_dev *d);
97int ssb_pcicore_pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin);
98
91 99
92#else /* CONFIG_SSB_DRIVER_PCICORE */ 100#else /* CONFIG_SSB_DRIVER_PCICORE */
93 101
@@ -107,5 +115,16 @@ int ssb_pcicore_dev_irqvecs_enable(struct ssb_pcicore *pc,
107 return 0; 115 return 0;
108} 116}
109 117
118static inline
119int ssb_pcicore_plat_dev_init(struct pci_dev *d)
120{
121 return -ENODEV;
122}
123static inline
124int ssb_pcicore_pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
125{
126 return -ENODEV;
127}
128
110#endif /* CONFIG_SSB_DRIVER_PCICORE */ 129#endif /* CONFIG_SSB_DRIVER_PCICORE */
111#endif /* LINUX_SSB_PCICORE_H_ */ 130#endif /* LINUX_SSB_PCICORE_H_ */
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h
index 4c2577bd1c85..8df6d1382ac8 100644
--- a/include/linux/syscalls.h
+++ b/include/linux/syscalls.h
@@ -60,7 +60,6 @@ struct getcpu_cache;
60#include <linux/capability.h> 60#include <linux/capability.h>
61#include <linux/list.h> 61#include <linux/list.h>
62#include <linux/sem.h> 62#include <linux/sem.h>
63#include <asm/semaphore.h>
64#include <asm/siginfo.h> 63#include <asm/siginfo.h>
65#include <asm/signal.h> 64#include <asm/signal.h>
66#include <linux/quota.h> 65#include <linux/quota.h>
diff --git a/include/linux/sysdev.h b/include/linux/sysdev.h
index f752e73bf977..f2767bc6b735 100644
--- a/include/linux/sysdev.h
+++ b/include/linux/sysdev.h
@@ -45,12 +45,16 @@ struct sysdev_class_attribute {
45 ssize_t (*store)(struct sysdev_class *, const char *, size_t); 45 ssize_t (*store)(struct sysdev_class *, const char *, size_t);
46}; 46};
47 47
48#define SYSDEV_CLASS_ATTR(_name,_mode,_show,_store) \ 48#define _SYSDEV_CLASS_ATTR(_name,_mode,_show,_store) \
49struct sysdev_class_attribute attr_##_name = { \ 49{ \
50 .attr = {.name = __stringify(_name), .mode = _mode }, \ 50 .attr = {.name = __stringify(_name), .mode = _mode }, \
51 .show = _show, \ 51 .show = _show, \
52 .store = _store, \ 52 .store = _store, \
53}; 53}
54
55#define SYSDEV_CLASS_ATTR(_name,_mode,_show,_store) \
56 struct sysdev_class_attribute attr_##_name = \
57 _SYSDEV_CLASS_ATTR(_name,_mode,_show,_store)
54 58
55 59
56extern int sysdev_class_register(struct sysdev_class *); 60extern int sysdev_class_register(struct sysdev_class *);
@@ -100,15 +104,16 @@ struct sysdev_attribute {
100}; 104};
101 105
102 106
103#define _SYSDEV_ATTR(_name,_mode,_show,_store) \ 107#define _SYSDEV_ATTR(_name, _mode, _show, _store) \
104{ \ 108{ \
105 .attr = { .name = __stringify(_name), .mode = _mode }, \ 109 .attr = { .name = __stringify(_name), .mode = _mode }, \
106 .show = _show, \ 110 .show = _show, \
107 .store = _store, \ 111 .store = _store, \
108} 112}
109 113
110#define SYSDEV_ATTR(_name,_mode,_show,_store) \ 114#define SYSDEV_ATTR(_name, _mode, _show, _store) \
111struct sysdev_attribute attr_##_name = _SYSDEV_ATTR(_name,_mode,_show,_store); 115 struct sysdev_attribute attr_##_name = \
116 _SYSDEV_ATTR(_name, _mode, _show, _store);
112 117
113extern int sysdev_create_file(struct sys_device *, struct sysdev_attribute *); 118extern int sysdev_create_file(struct sys_device *, struct sysdev_attribute *);
114extern void sysdev_remove_file(struct sys_device *, struct sysdev_attribute *); 119extern void sysdev_remove_file(struct sys_device *, struct sysdev_attribute *);
diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h
index 802710438a9e..03378e3515b3 100644
--- a/include/linux/sysfs.h
+++ b/include/linux/sysfs.h
@@ -131,7 +131,6 @@ static inline int sysfs_create_dir(struct kobject *kobj)
131 131
132static inline void sysfs_remove_dir(struct kobject *kobj) 132static inline void sysfs_remove_dir(struct kobject *kobj)
133{ 133{
134 ;
135} 134}
136 135
137static inline int sysfs_rename_dir(struct kobject *kobj, const char *new_name) 136static inline int sysfs_rename_dir(struct kobject *kobj, const char *new_name)
@@ -160,7 +159,6 @@ static inline int sysfs_chmod_file(struct kobject *kobj,
160static inline void sysfs_remove_file(struct kobject *kobj, 159static inline void sysfs_remove_file(struct kobject *kobj,
161 const struct attribute *attr) 160 const struct attribute *attr)
162{ 161{
163 ;
164} 162}
165 163
166static inline int sysfs_create_bin_file(struct kobject *kobj, 164static inline int sysfs_create_bin_file(struct kobject *kobj,
@@ -169,10 +167,9 @@ static inline int sysfs_create_bin_file(struct kobject *kobj,
169 return 0; 167 return 0;
170} 168}
171 169
172static inline int sysfs_remove_bin_file(struct kobject *kobj, 170static inline void sysfs_remove_bin_file(struct kobject *kobj,
173 struct bin_attribute *attr) 171 struct bin_attribute *attr)
174{ 172{
175 return 0;
176} 173}
177 174
178static inline int sysfs_create_link(struct kobject *kobj, 175static inline int sysfs_create_link(struct kobject *kobj,
@@ -183,7 +180,6 @@ static inline int sysfs_create_link(struct kobject *kobj,
183 180
184static inline void sysfs_remove_link(struct kobject *kobj, const char *name) 181static inline void sysfs_remove_link(struct kobject *kobj, const char *name)
185{ 182{
186 ;
187} 183}
188 184
189static inline int sysfs_create_group(struct kobject *kobj, 185static inline int sysfs_create_group(struct kobject *kobj,
@@ -195,7 +191,6 @@ static inline int sysfs_create_group(struct kobject *kobj,
195static inline void sysfs_remove_group(struct kobject *kobj, 191static inline void sysfs_remove_group(struct kobject *kobj,
196 const struct attribute_group *grp) 192 const struct attribute_group *grp)
197{ 193{
198 ;
199} 194}
200 195
201static inline int sysfs_add_file_to_group(struct kobject *kobj, 196static inline int sysfs_add_file_to_group(struct kobject *kobj,
diff --git a/include/linux/tcp.h b/include/linux/tcp.h
index 08027f1d7f31..d96d9b122304 100644
--- a/include/linux/tcp.h
+++ b/include/linux/tcp.h
@@ -239,6 +239,11 @@ static inline struct tcp_request_sock *tcp_rsk(const struct request_sock *req)
239 return (struct tcp_request_sock *)req; 239 return (struct tcp_request_sock *)req;
240} 240}
241 241
242struct tcp_deferred_accept_info {
243 struct sock *listen_sk;
244 struct request_sock *request;
245};
246
242struct tcp_sock { 247struct tcp_sock {
243 /* inet_connection_sock has to be the first member of tcp_sock */ 248 /* inet_connection_sock has to be the first member of tcp_sock */
244 struct inet_connection_sock inet_conn; 249 struct inet_connection_sock inet_conn;
@@ -374,6 +379,8 @@ struct tcp_sock {
374 unsigned int keepalive_intvl; /* time interval between keep alive probes */ 379 unsigned int keepalive_intvl; /* time interval between keep alive probes */
375 int linger2; 380 int linger2;
376 381
382 struct tcp_deferred_accept_info defer_tcp_accept;
383
377 unsigned long last_synq_overflow; 384 unsigned long last_synq_overflow;
378 385
379 u32 tso_deferred; 386 u32 tso_deferred;
diff --git a/include/linux/topology.h b/include/linux/topology.h
index bd14f8b30f09..4bb7074a2c3a 100644
--- a/include/linux/topology.h
+++ b/include/linux/topology.h
@@ -38,16 +38,15 @@
38#endif 38#endif
39 39
40#ifndef nr_cpus_node 40#ifndef nr_cpus_node
41#define nr_cpus_node(node) \ 41#define nr_cpus_node(node) \
42 ({ \ 42 ({ \
43 cpumask_t __tmp__; \ 43 node_to_cpumask_ptr(__tmp__, node); \
44 __tmp__ = node_to_cpumask(node); \ 44 cpus_weight(*__tmp__); \
45 cpus_weight(__tmp__); \
46 }) 45 })
47#endif 46#endif
48 47
49#define for_each_node_with_cpus(node) \ 48#define for_each_node_with_cpus(node) \
50 for_each_online_node(node) \ 49 for_each_online_node(node) \
51 if (nr_cpus_node(node)) 50 if (nr_cpus_node(node))
52 51
53void arch_update_cpu_topology(void); 52void arch_update_cpu_topology(void);
@@ -80,7 +79,9 @@ void arch_update_cpu_topology(void);
80 * by defining their own arch-specific initializer in include/asm/topology.h. 79 * by defining their own arch-specific initializer in include/asm/topology.h.
81 * A definition there will automagically override these default initializers 80 * A definition there will automagically override these default initializers
82 * and allow arch-specific performance tuning of sched_domains. 81 * and allow arch-specific performance tuning of sched_domains.
82 * (Only non-zero and non-null fields need be specified.)
83 */ 83 */
84
84#ifdef CONFIG_SCHED_SMT 85#ifdef CONFIG_SCHED_SMT
85/* MCD - Do we really need this? It is always on if CONFIG_SCHED_SMT is, 86/* MCD - Do we really need this? It is always on if CONFIG_SCHED_SMT is,
86 * so can't we drop this in favor of CONFIG_SCHED_SMT? 87 * so can't we drop this in favor of CONFIG_SCHED_SMT?
@@ -89,20 +90,10 @@ void arch_update_cpu_topology(void);
89/* Common values for SMT siblings */ 90/* Common values for SMT siblings */
90#ifndef SD_SIBLING_INIT 91#ifndef SD_SIBLING_INIT
91#define SD_SIBLING_INIT (struct sched_domain) { \ 92#define SD_SIBLING_INIT (struct sched_domain) { \
92 .span = CPU_MASK_NONE, \
93 .parent = NULL, \
94 .child = NULL, \
95 .groups = NULL, \
96 .min_interval = 1, \ 93 .min_interval = 1, \
97 .max_interval = 2, \ 94 .max_interval = 2, \
98 .busy_factor = 64, \ 95 .busy_factor = 64, \
99 .imbalance_pct = 110, \ 96 .imbalance_pct = 110, \
100 .cache_nice_tries = 0, \
101 .busy_idx = 0, \
102 .idle_idx = 0, \
103 .newidle_idx = 0, \
104 .wake_idx = 0, \
105 .forkexec_idx = 0, \
106 .flags = SD_LOAD_BALANCE \ 97 .flags = SD_LOAD_BALANCE \
107 | SD_BALANCE_NEWIDLE \ 98 | SD_BALANCE_NEWIDLE \
108 | SD_BALANCE_FORK \ 99 | SD_BALANCE_FORK \
@@ -112,7 +103,6 @@ void arch_update_cpu_topology(void);
112 | SD_SHARE_CPUPOWER, \ 103 | SD_SHARE_CPUPOWER, \
113 .last_balance = jiffies, \ 104 .last_balance = jiffies, \
114 .balance_interval = 1, \ 105 .balance_interval = 1, \
115 .nr_balance_failed = 0, \
116} 106}
117#endif 107#endif
118#endif /* CONFIG_SCHED_SMT */ 108#endif /* CONFIG_SCHED_SMT */
@@ -121,18 +111,12 @@ void arch_update_cpu_topology(void);
121/* Common values for MC siblings. for now mostly derived from SD_CPU_INIT */ 111/* Common values for MC siblings. for now mostly derived from SD_CPU_INIT */
122#ifndef SD_MC_INIT 112#ifndef SD_MC_INIT
123#define SD_MC_INIT (struct sched_domain) { \ 113#define SD_MC_INIT (struct sched_domain) { \
124 .span = CPU_MASK_NONE, \
125 .parent = NULL, \
126 .child = NULL, \
127 .groups = NULL, \
128 .min_interval = 1, \ 114 .min_interval = 1, \
129 .max_interval = 4, \ 115 .max_interval = 4, \
130 .busy_factor = 64, \ 116 .busy_factor = 64, \
131 .imbalance_pct = 125, \ 117 .imbalance_pct = 125, \
132 .cache_nice_tries = 1, \ 118 .cache_nice_tries = 1, \
133 .busy_idx = 2, \ 119 .busy_idx = 2, \
134 .idle_idx = 0, \
135 .newidle_idx = 0, \
136 .wake_idx = 1, \ 120 .wake_idx = 1, \
137 .forkexec_idx = 1, \ 121 .forkexec_idx = 1, \
138 .flags = SD_LOAD_BALANCE \ 122 .flags = SD_LOAD_BALANCE \
@@ -144,7 +128,6 @@ void arch_update_cpu_topology(void);
144 | BALANCE_FOR_MC_POWER, \ 128 | BALANCE_FOR_MC_POWER, \
145 .last_balance = jiffies, \ 129 .last_balance = jiffies, \
146 .balance_interval = 1, \ 130 .balance_interval = 1, \
147 .nr_balance_failed = 0, \
148} 131}
149#endif 132#endif
150#endif /* CONFIG_SCHED_MC */ 133#endif /* CONFIG_SCHED_MC */
@@ -152,10 +135,6 @@ void arch_update_cpu_topology(void);
152/* Common values for CPUs */ 135/* Common values for CPUs */
153#ifndef SD_CPU_INIT 136#ifndef SD_CPU_INIT
154#define SD_CPU_INIT (struct sched_domain) { \ 137#define SD_CPU_INIT (struct sched_domain) { \
155 .span = CPU_MASK_NONE, \
156 .parent = NULL, \
157 .child = NULL, \
158 .groups = NULL, \
159 .min_interval = 1, \ 138 .min_interval = 1, \
160 .max_interval = 4, \ 139 .max_interval = 4, \
161 .busy_factor = 64, \ 140 .busy_factor = 64, \
@@ -174,16 +153,11 @@ void arch_update_cpu_topology(void);
174 | BALANCE_FOR_PKG_POWER,\ 153 | BALANCE_FOR_PKG_POWER,\
175 .last_balance = jiffies, \ 154 .last_balance = jiffies, \
176 .balance_interval = 1, \ 155 .balance_interval = 1, \
177 .nr_balance_failed = 0, \
178} 156}
179#endif 157#endif
180 158
181/* sched_domains SD_ALLNODES_INIT for NUMA machines */ 159/* sched_domains SD_ALLNODES_INIT for NUMA machines */
182#define SD_ALLNODES_INIT (struct sched_domain) { \ 160#define SD_ALLNODES_INIT (struct sched_domain) { \
183 .span = CPU_MASK_NONE, \
184 .parent = NULL, \
185 .child = NULL, \
186 .groups = NULL, \
187 .min_interval = 64, \ 161 .min_interval = 64, \
188 .max_interval = 64*num_online_cpus(), \ 162 .max_interval = 64*num_online_cpus(), \
189 .busy_factor = 128, \ 163 .busy_factor = 128, \
@@ -191,14 +165,10 @@ void arch_update_cpu_topology(void);
191 .cache_nice_tries = 1, \ 165 .cache_nice_tries = 1, \
192 .busy_idx = 3, \ 166 .busy_idx = 3, \
193 .idle_idx = 3, \ 167 .idle_idx = 3, \
194 .newidle_idx = 0, /* unused */ \
195 .wake_idx = 0, /* unused */ \
196 .forkexec_idx = 0, /* unused */ \
197 .flags = SD_LOAD_BALANCE \ 168 .flags = SD_LOAD_BALANCE \
198 | SD_SERIALIZE, \ 169 | SD_SERIALIZE, \
199 .last_balance = jiffies, \ 170 .last_balance = jiffies, \
200 .balance_interval = 64, \ 171 .balance_interval = 64, \
201 .nr_balance_failed = 0, \
202} 172}
203 173
204#ifdef CONFIG_NUMA 174#ifdef CONFIG_NUMA
diff --git a/include/linux/transport_class.h b/include/linux/transport_class.h
index 1d6cc22e5f42..eaec1ea9558e 100644
--- a/include/linux/transport_class.h
+++ b/include/linux/transport_class.h
@@ -17,11 +17,11 @@ struct transport_container;
17struct transport_class { 17struct transport_class {
18 struct class class; 18 struct class class;
19 int (*setup)(struct transport_container *, struct device *, 19 int (*setup)(struct transport_container *, struct device *,
20 struct class_device *); 20 struct device *);
21 int (*configure)(struct transport_container *, struct device *, 21 int (*configure)(struct transport_container *, struct device *,
22 struct class_device *); 22 struct device *);
23 int (*remove)(struct transport_container *, struct device *, 23 int (*remove)(struct transport_container *, struct device *,
24 struct class_device *); 24 struct device *);
25}; 25};
26 26
27#define DECLARE_TRANSPORT_CLASS(cls, nm, su, rm, cfg) \ 27#define DECLARE_TRANSPORT_CLASS(cls, nm, su, rm, cfg) \
@@ -86,9 +86,10 @@ static inline int transport_container_register(struct transport_container *tc)
86 return attribute_container_register(&tc->ac); 86 return attribute_container_register(&tc->ac);
87} 87}
88 88
89static inline int transport_container_unregister(struct transport_container *tc) 89static inline void transport_container_unregister(struct transport_container *tc)
90{ 90{
91 return attribute_container_unregister(&tc->ac); 91 if (unlikely(attribute_container_unregister(&tc->ac)))
92 BUG();
92} 93}
93 94
94int transport_class_register(struct transport_class *); 95int transport_class_register(struct transport_class *);
diff --git a/include/linux/udp.h b/include/linux/udp.h
index 8ec703f462da..581ca2c14c52 100644
--- a/include/linux/udp.h
+++ b/include/linux/udp.h
@@ -26,15 +26,6 @@ struct udphdr {
26 __sum16 check; 26 __sum16 check;
27}; 27};
28 28
29#ifdef __KERNEL__
30#include <linux/skbuff.h>
31
32static inline struct udphdr *udp_hdr(const struct sk_buff *skb)
33{
34 return (struct udphdr *)skb_transport_header(skb);
35}
36#endif
37
38/* UDP socket options */ 29/* UDP socket options */
39#define UDP_CORK 1 /* Never send partially complete segments */ 30#define UDP_CORK 1 /* Never send partially complete segments */
40#define UDP_ENCAP 100 /* Set the socket to accept encapsulated packets */ 31#define UDP_ENCAP 100 /* Set the socket to accept encapsulated packets */
@@ -45,9 +36,14 @@ static inline struct udphdr *udp_hdr(const struct sk_buff *skb)
45#define UDP_ENCAP_L2TPINUDP 3 /* rfc2661 */ 36#define UDP_ENCAP_L2TPINUDP 3 /* rfc2661 */
46 37
47#ifdef __KERNEL__ 38#ifdef __KERNEL__
48#include <linux/types.h>
49
50#include <net/inet_sock.h> 39#include <net/inet_sock.h>
40#include <linux/skbuff.h>
41
42static inline struct udphdr *udp_hdr(const struct sk_buff *skb)
43{
44 return (struct udphdr *)skb_transport_header(skb);
45}
46
51#define UDP_HTABLE_SIZE 128 47#define UDP_HTABLE_SIZE 128
52 48
53struct udp_sock { 49struct udp_sock {
@@ -82,6 +78,7 @@ static inline struct udp_sock *udp_sk(const struct sock *sk)
82{ 78{
83 return (struct udp_sock *)sk; 79 return (struct udp_sock *)sk;
84} 80}
81
85#define IS_UDPLITE(__sk) (udp_sk(__sk)->pcflag) 82#define IS_UDPLITE(__sk) (udp_sk(__sk)->pcflag)
86 83
87#endif 84#endif
diff --git a/include/linux/usb/atmel_usba_udc.h b/include/linux/usb/atmel_usba_udc.h
new file mode 100644
index 000000000000..6311fa2d9f82
--- /dev/null
+++ b/include/linux/usb/atmel_usba_udc.h
@@ -0,0 +1,22 @@
1/*
2 * Platform data definitions for Atmel USBA gadget driver.
3 */
4#ifndef __LINUX_USB_USBA_H
5#define __LINUX_USB_USBA_H
6
7struct usba_ep_data {
8 char *name;
9 int index;
10 int fifo_size;
11 int nr_banks;
12 int can_dma;
13 int can_isoc;
14};
15
16struct usba_platform_data {
17 int vbus_pin;
18 int num_ep;
19 struct usba_ep_data ep[0];
20};
21
22#endif /* __LINUX_USB_USBA_H */
diff --git a/include/linux/wireless.h b/include/linux/wireless.h
index 3160dfed73ca..2864b1699ecc 100644
--- a/include/linux/wireless.h
+++ b/include/linux/wireless.h
@@ -455,6 +455,7 @@
455#define IW_MODE_REPEAT 4 /* Wireless Repeater (forwarder) */ 455#define IW_MODE_REPEAT 4 /* Wireless Repeater (forwarder) */
456#define IW_MODE_SECOND 5 /* Secondary master/repeater (backup) */ 456#define IW_MODE_SECOND 5 /* Secondary master/repeater (backup) */
457#define IW_MODE_MONITOR 6 /* Passive monitor (listen only) */ 457#define IW_MODE_MONITOR 6 /* Passive monitor (listen only) */
458#define IW_MODE_MESH 7 /* Mesh (IEEE 802.11s) network */
458 459
459/* Statistics flags (bitmask in updated) */ 460/* Statistics flags (bitmask in updated) */
460#define IW_QUAL_QUAL_UPDATED 0x01 /* Value was updated since last read */ 461#define IW_QUAL_QUAL_UPDATED 0x01 /* Value was updated since last read */
diff --git a/include/linux/xfrm.h b/include/linux/xfrm.h
index e31b8c84f2c9..0c82c80b277f 100644
--- a/include/linux/xfrm.h
+++ b/include/linux/xfrm.h
@@ -113,7 +113,8 @@ enum
113{ 113{
114 XFRM_POLICY_TYPE_MAIN = 0, 114 XFRM_POLICY_TYPE_MAIN = 0,
115 XFRM_POLICY_TYPE_SUB = 1, 115 XFRM_POLICY_TYPE_SUB = 1,
116 XFRM_POLICY_TYPE_MAX = 2 116 XFRM_POLICY_TYPE_MAX = 2,
117 XFRM_POLICY_TYPE_ANY = 255
117}; 118};
118 119
119enum 120enum
diff --git a/include/net/addrconf.h b/include/net/addrconf.h
index 496503c03846..0a2f0372df31 100644
--- a/include/net/addrconf.h
+++ b/include/net/addrconf.h
@@ -55,9 +55,12 @@ struct prefix_info {
55extern int addrconf_init(void); 55extern int addrconf_init(void);
56extern void addrconf_cleanup(void); 56extern void addrconf_cleanup(void);
57 57
58extern int addrconf_add_ifaddr(void __user *arg); 58extern int addrconf_add_ifaddr(struct net *net,
59extern int addrconf_del_ifaddr(void __user *arg); 59 void __user *arg);
60extern int addrconf_set_dstaddr(void __user *arg); 60extern int addrconf_del_ifaddr(struct net *net,
61 void __user *arg);
62extern int addrconf_set_dstaddr(struct net *net,
63 void __user *arg);
61 64
62extern int ipv6_chk_addr(struct net *net, 65extern int ipv6_chk_addr(struct net *net,
63 struct in6_addr *addr, 66 struct in6_addr *addr,
@@ -68,16 +71,18 @@ extern int ipv6_chk_addr(struct net *net,
68extern int ipv6_chk_home_addr(struct net *net, 71extern int ipv6_chk_home_addr(struct net *net,
69 struct in6_addr *addr); 72 struct in6_addr *addr);
70#endif 73#endif
74
75extern int ipv6_chk_prefix(struct in6_addr *addr,
76 struct net_device *dev);
77
71extern struct inet6_ifaddr *ipv6_get_ifaddr(struct net *net, 78extern struct inet6_ifaddr *ipv6_get_ifaddr(struct net *net,
72 struct in6_addr *addr, 79 const struct in6_addr *addr,
73 struct net_device *dev, 80 struct net_device *dev,
74 int strict); 81 int strict);
75 82
76extern int ipv6_get_saddr(struct dst_entry *dst,
77 struct in6_addr *daddr,
78 struct in6_addr *saddr);
79extern int ipv6_dev_get_saddr(struct net_device *dev, 83extern int ipv6_dev_get_saddr(struct net_device *dev,
80 struct in6_addr *daddr, 84 const struct in6_addr *daddr,
85 unsigned int srcprefs,
81 struct in6_addr *saddr); 86 struct in6_addr *saddr);
82extern int ipv6_get_lladdr(struct net_device *dev, 87extern int ipv6_get_lladdr(struct net_device *dev,
83 struct in6_addr *addr, 88 struct in6_addr *addr,
@@ -100,31 +105,31 @@ extern u32 ipv6_addr_label(const struct in6_addr *addr,
100/* 105/*
101 * multicast prototypes (mcast.c) 106 * multicast prototypes (mcast.c)
102 */ 107 */
103extern int ipv6_sock_mc_join(struct sock *sk, int ifindex, 108extern int ipv6_sock_mc_join(struct sock *sk, int ifindex,
104 struct in6_addr *addr); 109 const struct in6_addr *addr);
105extern int ipv6_sock_mc_drop(struct sock *sk, int ifindex, 110extern int ipv6_sock_mc_drop(struct sock *sk, int ifindex,
106 struct in6_addr *addr); 111 const struct in6_addr *addr);
107extern void ipv6_sock_mc_close(struct sock *sk); 112extern void ipv6_sock_mc_close(struct sock *sk);
108extern int inet6_mc_check(struct sock *sk, struct in6_addr *mc_addr, 113extern int inet6_mc_check(struct sock *sk,
109 struct in6_addr *src_addr); 114 const struct in6_addr *mc_addr,
115 const struct in6_addr *src_addr);
110 116
111extern int ipv6_dev_mc_inc(struct net_device *dev, struct in6_addr *addr); 117extern int ipv6_dev_mc_inc(struct net_device *dev, const struct in6_addr *addr);
112extern int __ipv6_dev_mc_dec(struct inet6_dev *idev, struct in6_addr *addr); 118extern int __ipv6_dev_mc_dec(struct inet6_dev *idev, const struct in6_addr *addr);
113extern int ipv6_dev_mc_dec(struct net_device *dev, struct in6_addr *addr); 119extern int ipv6_dev_mc_dec(struct net_device *dev, const struct in6_addr *addr);
114extern void ipv6_mc_up(struct inet6_dev *idev); 120extern void ipv6_mc_up(struct inet6_dev *idev);
115extern void ipv6_mc_down(struct inet6_dev *idev); 121extern void ipv6_mc_down(struct inet6_dev *idev);
116extern void ipv6_mc_init_dev(struct inet6_dev *idev); 122extern void ipv6_mc_init_dev(struct inet6_dev *idev);
117extern void ipv6_mc_destroy_dev(struct inet6_dev *idev); 123extern void ipv6_mc_destroy_dev(struct inet6_dev *idev);
118extern void addrconf_dad_failure(struct inet6_ifaddr *ifp); 124extern void addrconf_dad_failure(struct inet6_ifaddr *ifp);
119 125
120extern int ipv6_chk_mcast_addr(struct net_device *dev, struct in6_addr *group, 126extern int ipv6_chk_mcast_addr(struct net_device *dev,
121 struct in6_addr *src_addr); 127 const struct in6_addr *group,
128 const struct in6_addr *src_addr);
122extern int ipv6_is_mld(struct sk_buff *skb, int nexthdr); 129extern int ipv6_is_mld(struct sk_buff *skb, int nexthdr);
123 130
124extern void addrconf_prefix_rcv(struct net_device *dev, u8 *opt, int len); 131extern void addrconf_prefix_rcv(struct net_device *dev, u8 *opt, int len);
125 132
126extern int ipv6_get_hoplimit(struct net_device *dev);
127
128/* 133/*
129 * anycast prototypes (anycast.c) 134 * anycast prototypes (anycast.c)
130 */ 135 */
@@ -135,7 +140,8 @@ extern int inet6_ac_check(struct sock *sk, struct in6_addr *addr, int ifindex);
135 140
136extern int ipv6_dev_ac_inc(struct net_device *dev, struct in6_addr *addr); 141extern int ipv6_dev_ac_inc(struct net_device *dev, struct in6_addr *addr);
137extern int __ipv6_dev_ac_dec(struct inet6_dev *idev, struct in6_addr *addr); 142extern int __ipv6_dev_ac_dec(struct inet6_dev *idev, struct in6_addr *addr);
138extern int ipv6_chk_acast_addr(struct net_device *dev, struct in6_addr *addr); 143extern int ipv6_chk_acast_addr(struct net *net, struct net_device *dev,
144 struct in6_addr *addr);
139 145
140 146
141/* Device notifier */ 147/* Device notifier */
@@ -185,26 +191,6 @@ static inline void in6_ifa_put(struct inet6_ifaddr *ifp)
185#define in6_ifa_hold(ifp) atomic_inc(&(ifp)->refcnt) 191#define in6_ifa_hold(ifp) atomic_inc(&(ifp)->refcnt)
186 192
187 193
188extern void addrconf_forwarding_on(void);
189/*
190 * Hash function taken from net_alias.c
191 */
192
193static __inline__ u8 ipv6_addr_hash(const struct in6_addr *addr)
194{
195 __u32 word;
196
197 /*
198 * We perform the hash function over the last 64 bits of the address
199 * This will include the IEEE address token on links that support it.
200 */
201
202 word = (__force u32)(addr->s6_addr32[2] ^ addr->s6_addr32[3]);
203 word ^= (word >> 16);
204 word ^= (word >> 8);
205
206 return ((word ^ (word >> 4)) & 0x0f);
207}
208 194
209/* 195/*
210 * compute link-local solicited-node multicast address 196 * compute link-local solicited-node multicast address
@@ -214,61 +200,31 @@ static inline void addrconf_addr_solict_mult(const struct in6_addr *addr,
214 struct in6_addr *solicited) 200 struct in6_addr *solicited)
215{ 201{
216 ipv6_addr_set(solicited, 202 ipv6_addr_set(solicited,
217 __constant_htonl(0xFF020000), 0, 203 htonl(0xFF020000), 0,
218 __constant_htonl(0x1), 204 htonl(0x1),
219 __constant_htonl(0xFF000000) | addr->s6_addr32[3]); 205 htonl(0xFF000000) | addr->s6_addr32[3]);
220}
221
222
223static inline void ipv6_addr_all_nodes(struct in6_addr *addr)
224{
225 ipv6_addr_set(addr,
226 __constant_htonl(0xFF020000), 0, 0,
227 __constant_htonl(0x1));
228}
229
230static inline void ipv6_addr_all_routers(struct in6_addr *addr)
231{
232 ipv6_addr_set(addr,
233 __constant_htonl(0xFF020000), 0, 0,
234 __constant_htonl(0x2));
235} 206}
236 207
237static inline int ipv6_addr_is_multicast(const struct in6_addr *addr) 208static inline int ipv6_addr_is_multicast(const struct in6_addr *addr)
238{ 209{
239 return (addr->s6_addr32[0] & __constant_htonl(0xFF000000)) == __constant_htonl(0xFF000000); 210 return (addr->s6_addr32[0] & htonl(0xFF000000)) == htonl(0xFF000000);
240} 211}
241 212
242static inline int ipv6_addr_is_ll_all_nodes(const struct in6_addr *addr) 213static inline int ipv6_addr_is_ll_all_nodes(const struct in6_addr *addr)
243{ 214{
244 return (addr->s6_addr32[0] == htonl(0xff020000) && 215 return (((addr->s6_addr32[0] ^ htonl(0xff020000)) |
245 addr->s6_addr32[1] == 0 && 216 addr->s6_addr32[1] | addr->s6_addr32[2] |
246 addr->s6_addr32[2] == 0 && 217 (addr->s6_addr32[3] ^ htonl(0x00000001))) == 0);
247 addr->s6_addr32[3] == htonl(0x00000001));
248} 218}
249 219
250static inline int ipv6_addr_is_ll_all_routers(const struct in6_addr *addr) 220static inline int ipv6_addr_is_ll_all_routers(const struct in6_addr *addr)
251{ 221{
252 return (addr->s6_addr32[0] == htonl(0xff020000) && 222 return (((addr->s6_addr32[0] ^ htonl(0xff020000)) |
253 addr->s6_addr32[1] == 0 && 223 addr->s6_addr32[1] | addr->s6_addr32[2] |
254 addr->s6_addr32[2] == 0 && 224 (addr->s6_addr32[3] ^ htonl(0x00000002))) == 0);
255 addr->s6_addr32[3] == htonl(0x00000002));
256} 225}
257 226
258static inline int ipv6_isatap_eui64(u8 *eui, __be32 addr) 227extern int __ipv6_isatap_ifid(u8 *eui, __be32 addr);
259{
260 eui[0] = (ipv4_is_zeronet(addr) || ipv4_is_private_10(addr) ||
261 ipv4_is_loopback(addr) || ipv4_is_linklocal_169(addr) ||
262 ipv4_is_private_172(addr) || ipv4_is_test_192(addr) ||
263 ipv4_is_anycast_6to4(addr) || ipv4_is_private_192(addr) ||
264 ipv4_is_test_198(addr) || ipv4_is_multicast(addr) ||
265 ipv4_is_lbcast(addr)) ? 0x00 : 0x02;
266 eui[1] = 0;
267 eui[2] = 0x5E;
268 eui[3] = 0xFE;
269 memcpy (eui+4, &addr, 4);
270 return 0;
271}
272 228
273static inline int ipv6_addr_is_isatap(const struct in6_addr *addr) 229static inline int ipv6_addr_is_isatap(const struct in6_addr *addr)
274{ 230{
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index bcc480b8892a..e00750836ba5 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -12,6 +12,16 @@
12 * Copyright 2006, 2007 Johannes Berg <johannes@sipsolutions.net> 12 * Copyright 2006, 2007 Johannes Berg <johannes@sipsolutions.net>
13 */ 13 */
14 14
15/**
16 * struct vif_params - describes virtual interface parameters
17 * @mesh_id: mesh ID to use
18 * @mesh_id_len: length of the mesh ID
19 */
20struct vif_params {
21 u8 *mesh_id;
22 int mesh_id_len;
23};
24
15/* Radiotap header iteration 25/* Radiotap header iteration
16 * implemented in net/wireless/radiotap.c 26 * implemented in net/wireless/radiotap.c
17 * docs in Documentation/networking/radiotap-headers.txt 27 * docs in Documentation/networking/radiotap-headers.txt
@@ -109,6 +119,19 @@ enum station_flags {
109}; 119};
110 120
111/** 121/**
122 * enum plink_action - actions to perform in mesh peers
123 *
124 * @PLINK_ACTION_INVALID: action 0 is reserved
125 * @PLINK_ACTION_OPEN: start mesh peer link establishment
126 * @PLINK_ACTION_BLOCL: block traffic from this mesh peer
127 */
128enum plink_actions {
129 PLINK_ACTION_INVALID,
130 PLINK_ACTION_OPEN,
131 PLINK_ACTION_BLOCK,
132};
133
134/**
112 * struct station_parameters - station parameters 135 * struct station_parameters - station parameters
113 * 136 *
114 * Used to change and create a new station. 137 * Used to change and create a new station.
@@ -128,41 +151,124 @@ struct station_parameters {
128 int listen_interval; 151 int listen_interval;
129 u16 aid; 152 u16 aid;
130 u8 supported_rates_len; 153 u8 supported_rates_len;
154 u8 plink_action;
131}; 155};
132 156
133/** 157/**
134 * enum station_stats_flags - station statistics flags 158 * enum station_info_flags - station information flags
135 * 159 *
136 * Used by the driver to indicate which info in &struct station_stats 160 * Used by the driver to indicate which info in &struct station_info
137 * it has filled in during get_station(). 161 * it has filled in during get_station() or dump_station().
138 * 162 *
139 * @STATION_STAT_INACTIVE_TIME: @inactive_time filled 163 * @STATION_INFO_INACTIVE_TIME: @inactive_time filled
140 * @STATION_STAT_RX_BYTES: @rx_bytes filled 164 * @STATION_INFO_RX_BYTES: @rx_bytes filled
141 * @STATION_STAT_TX_BYTES: @tx_bytes filled 165 * @STATION_INFO_TX_BYTES: @tx_bytes filled
166 * @STATION_INFO_LLID: @llid filled
167 * @STATION_INFO_PLID: @plid filled
168 * @STATION_INFO_PLINK_STATE: @plink_state filled
142 */ 169 */
143enum station_stats_flags { 170enum station_info_flags {
144 STATION_STAT_INACTIVE_TIME = 1<<0, 171 STATION_INFO_INACTIVE_TIME = 1<<0,
145 STATION_STAT_RX_BYTES = 1<<1, 172 STATION_INFO_RX_BYTES = 1<<1,
146 STATION_STAT_TX_BYTES = 1<<2, 173 STATION_INFO_TX_BYTES = 1<<2,
174 STATION_INFO_LLID = 1<<3,
175 STATION_INFO_PLID = 1<<4,
176 STATION_INFO_PLINK_STATE = 1<<5,
147}; 177};
148 178
149/** 179/**
150 * struct station_stats - station statistics 180 * struct station_info - station information
151 * 181 *
152 * Station information filled by driver for get_station(). 182 * Station information filled by driver for get_station() and dump_station.
153 * 183 *
154 * @filled: bitflag of flags from &enum station_stats_flags 184 * @filled: bitflag of flags from &enum station_info_flags
155 * @inactive_time: time since last station activity (tx/rx) in milliseconds 185 * @inactive_time: time since last station activity (tx/rx) in milliseconds
156 * @rx_bytes: bytes received from this station 186 * @rx_bytes: bytes received from this station
157 * @tx_bytes: bytes transmitted to this station 187 * @tx_bytes: bytes transmitted to this station
188 * @llid: mesh local link id
189 * @plid: mesh peer link id
190 * @plink_state: mesh peer link state
158 */ 191 */
159struct station_stats { 192struct station_info {
160 u32 filled; 193 u32 filled;
161 u32 inactive_time; 194 u32 inactive_time;
162 u32 rx_bytes; 195 u32 rx_bytes;
163 u32 tx_bytes; 196 u32 tx_bytes;
197 u16 llid;
198 u16 plid;
199 u8 plink_state;
200};
201
202/**
203 * enum monitor_flags - monitor flags
204 *
205 * Monitor interface configuration flags. Note that these must be the bits
206 * according to the nl80211 flags.
207 *
208 * @MONITOR_FLAG_FCSFAIL: pass frames with bad FCS
209 * @MONITOR_FLAG_PLCPFAIL: pass frames with bad PLCP
210 * @MONITOR_FLAG_CONTROL: pass control frames
211 * @MONITOR_FLAG_OTHER_BSS: disable BSSID filtering
212 * @MONITOR_FLAG_COOK_FRAMES: report frames after processing
213 */
214enum monitor_flags {
215 MONITOR_FLAG_FCSFAIL = 1<<NL80211_MNTR_FLAG_FCSFAIL,
216 MONITOR_FLAG_PLCPFAIL = 1<<NL80211_MNTR_FLAG_PLCPFAIL,
217 MONITOR_FLAG_CONTROL = 1<<NL80211_MNTR_FLAG_CONTROL,
218 MONITOR_FLAG_OTHER_BSS = 1<<NL80211_MNTR_FLAG_OTHER_BSS,
219 MONITOR_FLAG_COOK_FRAMES = 1<<NL80211_MNTR_FLAG_COOK_FRAMES,
164}; 220};
165 221
222/**
223 * enum mpath_info_flags - mesh path information flags
224 *
225 * Used by the driver to indicate which info in &struct mpath_info it has filled
226 * in during get_station() or dump_station().
227 *
228 * MPATH_INFO_FRAME_QLEN: @frame_qlen filled
229 * MPATH_INFO_DSN: @dsn filled
230 * MPATH_INFO_METRIC: @metric filled
231 * MPATH_INFO_EXPTIME: @exptime filled
232 * MPATH_INFO_DISCOVERY_TIMEOUT: @discovery_timeout filled
233 * MPATH_INFO_DISCOVERY_RETRIES: @discovery_retries filled
234 * MPATH_INFO_FLAGS: @flags filled
235 */
236enum mpath_info_flags {
237 MPATH_INFO_FRAME_QLEN = BIT(0),
238 MPATH_INFO_DSN = BIT(1),
239 MPATH_INFO_METRIC = BIT(2),
240 MPATH_INFO_EXPTIME = BIT(3),
241 MPATH_INFO_DISCOVERY_TIMEOUT = BIT(4),
242 MPATH_INFO_DISCOVERY_RETRIES = BIT(5),
243 MPATH_INFO_FLAGS = BIT(6),
244};
245
246/**
247 * struct mpath_info - mesh path information
248 *
249 * Mesh path information filled by driver for get_mpath() and dump_mpath().
250 *
251 * @filled: bitfield of flags from &enum mpath_info_flags
252 * @frame_qlen: number of queued frames for this destination
253 * @dsn: destination sequence number
254 * @metric: metric (cost) of this mesh path
255 * @exptime: expiration time for the mesh path from now, in msecs
256 * @flags: mesh path flags
257 * @discovery_timeout: total mesh path discovery timeout, in msecs
258 * @discovery_retries: mesh path discovery retries
259 */
260struct mpath_info {
261 u32 filled;
262 u32 frame_qlen;
263 u32 dsn;
264 u32 metric;
265 u32 exptime;
266 u32 discovery_timeout;
267 u8 discovery_retries;
268 u8 flags;
269};
270
271
166/* from net/wireless.h */ 272/* from net/wireless.h */
167struct wiphy; 273struct wiphy;
168 274
@@ -210,13 +316,17 @@ struct wiphy;
210 * @del_station: Remove a station; @mac may be NULL to remove all stations. 316 * @del_station: Remove a station; @mac may be NULL to remove all stations.
211 * 317 *
212 * @change_station: Modify a given station. 318 * @change_station: Modify a given station.
319 *
320 * @set_mesh_cfg: set mesh parameters (by now, just mesh id)
213 */ 321 */
214struct cfg80211_ops { 322struct cfg80211_ops {
215 int (*add_virtual_intf)(struct wiphy *wiphy, char *name, 323 int (*add_virtual_intf)(struct wiphy *wiphy, char *name,
216 enum nl80211_iftype type); 324 enum nl80211_iftype type, u32 *flags,
325 struct vif_params *params);
217 int (*del_virtual_intf)(struct wiphy *wiphy, int ifindex); 326 int (*del_virtual_intf)(struct wiphy *wiphy, int ifindex);
218 int (*change_virtual_intf)(struct wiphy *wiphy, int ifindex, 327 int (*change_virtual_intf)(struct wiphy *wiphy, int ifindex,
219 enum nl80211_iftype type); 328 enum nl80211_iftype type, u32 *flags,
329 struct vif_params *params);
220 330
221 int (*add_key)(struct wiphy *wiphy, struct net_device *netdev, 331 int (*add_key)(struct wiphy *wiphy, struct net_device *netdev,
222 u8 key_index, u8 *mac_addr, 332 u8 key_index, u8 *mac_addr,
@@ -244,7 +354,22 @@ struct cfg80211_ops {
244 int (*change_station)(struct wiphy *wiphy, struct net_device *dev, 354 int (*change_station)(struct wiphy *wiphy, struct net_device *dev,
245 u8 *mac, struct station_parameters *params); 355 u8 *mac, struct station_parameters *params);
246 int (*get_station)(struct wiphy *wiphy, struct net_device *dev, 356 int (*get_station)(struct wiphy *wiphy, struct net_device *dev,
247 u8 *mac, struct station_stats *stats); 357 u8 *mac, struct station_info *sinfo);
358 int (*dump_station)(struct wiphy *wiphy, struct net_device *dev,
359 int idx, u8 *mac, struct station_info *sinfo);
360
361 int (*add_mpath)(struct wiphy *wiphy, struct net_device *dev,
362 u8 *dst, u8 *next_hop);
363 int (*del_mpath)(struct wiphy *wiphy, struct net_device *dev,
364 u8 *dst);
365 int (*change_mpath)(struct wiphy *wiphy, struct net_device *dev,
366 u8 *dst, u8 *next_hop);
367 int (*get_mpath)(struct wiphy *wiphy, struct net_device *dev,
368 u8 *dst, u8 *next_hop,
369 struct mpath_info *pinfo);
370 int (*dump_mpath)(struct wiphy *wiphy, struct net_device *dev,
371 int idx, u8 *dst, u8 *next_hop,
372 struct mpath_info *pinfo);
248}; 373};
249 374
250#endif /* __NET_CFG80211_H */ 375#endif /* __NET_CFG80211_H */
diff --git a/include/net/dst.h b/include/net/dst.h
index ae13370e8484..002500e631f5 100644
--- a/include/net/dst.h
+++ b/include/net/dst.h
@@ -163,15 +163,7 @@ struct dst_entry * dst_clone(struct dst_entry * dst)
163 return dst; 163 return dst;
164} 164}
165 165
166static inline 166extern void dst_release(struct dst_entry *dst);
167void dst_release(struct dst_entry * dst)
168{
169 if (dst) {
170 WARN_ON(atomic_read(&dst->__refcnt) < 1);
171 smp_mb__before_atomic_dec();
172 atomic_dec(&dst->__refcnt);
173 }
174}
175 167
176/* Children define the path of the packet through the 168/* Children define the path of the packet through the
177 * Linux networking. Thus, destinations are stackable. 169 * Linux networking. Thus, destinations are stackable.
diff --git a/include/net/fib_rules.h b/include/net/fib_rules.h
index 34349f9f4331..a5c6ccc5bb19 100644
--- a/include/net/fib_rules.h
+++ b/include/net/fib_rules.h
@@ -87,6 +87,7 @@ static inline void fib_rule_get(struct fib_rule *rule)
87static inline void fib_rule_put_rcu(struct rcu_head *head) 87static inline void fib_rule_put_rcu(struct rcu_head *head)
88{ 88{
89 struct fib_rule *rule = container_of(head, struct fib_rule, rcu); 89 struct fib_rule *rule = container_of(head, struct fib_rule, rcu);
90 release_net(rule->fr_net);
90 kfree(rule); 91 kfree(rule);
91} 92}
92 93
diff --git a/include/net/icmp.h b/include/net/icmp.h
index 9f7ef3c8baef..dddb839ff4b5 100644
--- a/include/net/icmp.h
+++ b/include/net/icmp.h
@@ -48,7 +48,7 @@ struct sk_buff;
48extern void icmp_send(struct sk_buff *skb_in, int type, int code, __be32 info); 48extern void icmp_send(struct sk_buff *skb_in, int type, int code, __be32 info);
49extern int icmp_rcv(struct sk_buff *skb); 49extern int icmp_rcv(struct sk_buff *skb);
50extern int icmp_ioctl(struct sock *sk, int cmd, unsigned long arg); 50extern int icmp_ioctl(struct sock *sk, int cmd, unsigned long arg);
51extern void icmp_init(struct net_proto_family *ops); 51extern int icmp_init(void);
52extern void icmp_out_count(unsigned char type); 52extern void icmp_out_count(unsigned char type);
53 53
54/* Move into dst.h ? */ 54/* Move into dst.h ? */
@@ -65,11 +65,4 @@ static inline struct raw_sock *raw_sk(const struct sock *sk)
65 return (struct raw_sock *)sk; 65 return (struct raw_sock *)sk;
66} 66}
67 67
68extern int sysctl_icmp_echo_ignore_all;
69extern int sysctl_icmp_echo_ignore_broadcasts;
70extern int sysctl_icmp_ignore_bogus_error_responses;
71extern int sysctl_icmp_errors_use_inbound_ifaddr;
72extern int sysctl_icmp_ratelimit;
73extern int sysctl_icmp_ratemask;
74
75#endif /* _ICMP_H */ 68#endif /* _ICMP_H */
diff --git a/include/net/ieee80211.h b/include/net/ieee80211.h
index 285b2adfa648..529816bfbc52 100644
--- a/include/net/ieee80211.h
+++ b/include/net/ieee80211.h
@@ -183,7 +183,6 @@ const char *escape_essid(const char *essid, u8 essid_len);
183#define IEEE80211_DEBUG_RX(f, a...) IEEE80211_DEBUG(IEEE80211_DL_RX, f, ## a) 183#define IEEE80211_DEBUG_RX(f, a...) IEEE80211_DEBUG(IEEE80211_DL_RX, f, ## a)
184#define IEEE80211_DEBUG_QOS(f, a...) IEEE80211_DEBUG(IEEE80211_DL_QOS, f, ## a) 184#define IEEE80211_DEBUG_QOS(f, a...) IEEE80211_DEBUG(IEEE80211_DL_QOS, f, ## a)
185#include <linux/netdevice.h> 185#include <linux/netdevice.h>
186#include <linux/wireless.h>
187#include <linux/if_arp.h> /* ARPHRD_ETHER */ 186#include <linux/if_arp.h> /* ARPHRD_ETHER */
188 187
189#ifndef WIRELESS_SPY 188#ifndef WIRELESS_SPY
diff --git a/include/net/ieee80211softmac.h b/include/net/ieee80211softmac.h
deleted file mode 100644
index 1ef6282fdded..000000000000
--- a/include/net/ieee80211softmac.h
+++ /dev/null
@@ -1,373 +0,0 @@
1/*
2 * ieee80211softmac.h - public interface to the softmac
3 *
4 * Copyright (c) 2005 Johannes Berg <johannes@sipsolutions.net>
5 * Joseph Jezak <josejx@gentoo.org>
6 * Larry Finger <Larry.Finger@lwfinger.net>
7 * Danny van Dyk <kugelfang@gentoo.org>
8 * Michael Buesch <mbuesch@freenet.de>
9 *
10 * This program is free software; you can redistribute it and/or modify it
11 * under the terms of version 2 of the GNU General Public License as
12 * published by the Free Software Foundation.
13 *
14 * This program is distributed in the hope that it will be useful, but WITHOUT
15 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
16 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
17 * more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 *
23 * The full GNU General Public License is included in this distribution in the
24 * file called COPYING.
25 */
26
27#ifndef IEEE80211SOFTMAC_H_
28#define IEEE80211SOFTMAC_H_
29
30#include <linux/kernel.h>
31#include <linux/spinlock.h>
32#include <linux/workqueue.h>
33#include <linux/list.h>
34#include <net/ieee80211.h>
35
36/* Once the API is considered more or less stable,
37 * this should be incremented on API incompatible changes.
38 */
39#define IEEE80211SOFTMAC_API 0
40
41#define IEEE80211SOFTMAC_MAX_RATES_LEN 8
42#define IEEE80211SOFTMAC_MAX_EX_RATES_LEN 255
43
44struct ieee80211softmac_ratesinfo {
45 u8 count;
46 u8 rates[IEEE80211SOFTMAC_MAX_RATES_LEN + IEEE80211SOFTMAC_MAX_EX_RATES_LEN];
47};
48
49/* internal structures */
50struct ieee80211softmac_network;
51struct ieee80211softmac_scaninfo;
52
53struct ieee80211softmac_essid {
54 u8 len;
55 char data[IW_ESSID_MAX_SIZE+1];
56};
57
58struct ieee80211softmac_wpa {
59 char *IE;
60 int IElen;
61 int IEbuflen;
62};
63
64/*
65 * Information about association
66 */
67struct ieee80211softmac_assoc_info {
68
69 struct mutex mutex;
70
71 /*
72 * This is the requested ESSID. It is written
73 * only by the WX handlers.
74 *
75 */
76 struct ieee80211softmac_essid req_essid;
77 /*
78 * the ESSID of the network we're currently
79 * associated (or trying) to. This is
80 * updated to the network's actual ESSID
81 * even if the requested ESSID was 'ANY'
82 */
83 struct ieee80211softmac_essid associate_essid;
84
85 /* BSSID we're trying to associate to */
86 char bssid[ETH_ALEN];
87
88 /* some flags.
89 * static_essid is valid if the essid is constant,
90 * this is for use by the wx handlers only.
91 *
92 * associating is true, if the network has been
93 * auth'ed on and we are in the process of associating.
94 *
95 * bssvalid is true if we found a matching network
96 * and saved it's BSSID into the bssid above.
97 *
98 * bssfixed is used for SIOCSIWAP.
99 */
100 u8 static_essid;
101 u8 short_preamble_available;
102 u8 associating;
103 u8 associated;
104 u8 assoc_wait;
105 u8 bssvalid;
106 u8 bssfixed;
107
108 /* Scan retries remaining */
109 int scan_retry;
110
111 struct delayed_work work;
112 struct delayed_work timeout;
113};
114
115struct ieee80211softmac_bss_info {
116 /* Rates supported by the network */
117 struct ieee80211softmac_ratesinfo supported_rates;
118
119 /* This indicates whether frames can currently be transmitted with
120 * short preamble (only use this variable during TX at CCK rates) */
121 u8 short_preamble:1;
122
123 /* This indicates whether protection (e.g. self-CTS) should be used
124 * when transmitting with OFDM modulation */
125 u8 use_protection:1;
126};
127
128enum {
129 IEEE80211SOFTMAC_AUTH_OPEN_REQUEST = 1,
130 IEEE80211SOFTMAC_AUTH_OPEN_RESPONSE = 2,
131};
132
133enum {
134 IEEE80211SOFTMAC_AUTH_SHARED_REQUEST = 1,
135 IEEE80211SOFTMAC_AUTH_SHARED_CHALLENGE = 2,
136 IEEE80211SOFTMAC_AUTH_SHARED_RESPONSE = 3,
137 IEEE80211SOFTMAC_AUTH_SHARED_PASS = 4,
138};
139
140/* We should make these tunable
141 * AUTH_TIMEOUT seems really long, but that's what it is in BSD */
142#define IEEE80211SOFTMAC_AUTH_TIMEOUT (12 * HZ)
143#define IEEE80211SOFTMAC_AUTH_RETRY_LIMIT 5
144#define IEEE80211SOFTMAC_ASSOC_SCAN_RETRY_LIMIT 3
145
146struct ieee80211softmac_txrates {
147 /* The Bit-Rate to be used for multicast frames. */
148 u8 mcast_rate;
149
150 /* The Bit-Rate to be used for multicast management frames. */
151 u8 mgt_mcast_rate;
152
153 /* The Bit-Rate to be used for any other (normal) data packet. */
154 u8 default_rate;
155 /* The Bit-Rate to be used for default fallback
156 * (If the device supports fallback and hardware-retry)
157 */
158 u8 default_fallback;
159
160 /* This is the rate that the user asked for */
161 u8 user_rate;
162};
163
164/* Bits for txrates_change callback. */
165#define IEEE80211SOFTMAC_TXRATECHG_DEFAULT (1 << 0) /* default_rate */
166#define IEEE80211SOFTMAC_TXRATECHG_DEFAULT_FBACK (1 << 1) /* default_fallback */
167#define IEEE80211SOFTMAC_TXRATECHG_MCAST (1 << 2) /* mcast_rate */
168#define IEEE80211SOFTMAC_TXRATECHG_MGT_MCAST (1 << 3) /* mgt_mcast_rate */
169
170#define IEEE80211SOFTMAC_BSSINFOCHG_RATES (1 << 0) /* supported_rates */
171#define IEEE80211SOFTMAC_BSSINFOCHG_SHORT_PREAMBLE (1 << 1) /* short_preamble */
172#define IEEE80211SOFTMAC_BSSINFOCHG_PROTECTION (1 << 2) /* use_protection */
173
174struct ieee80211softmac_device {
175 /* 802.11 structure for data stuff */
176 struct ieee80211_device *ieee;
177 struct net_device *dev;
178
179 /* only valid if associated, then holds the Association ID */
180 u16 association_id;
181
182 /* the following methods are callbacks that the driver
183 * using this framework has to assign
184 */
185
186 /* always assign these */
187 void (*set_bssid_filter)(struct net_device *dev, const u8 *bssid);
188 void (*set_channel)(struct net_device *dev, u8 channel);
189
190 /* assign if you need it, informational only */
191 void (*link_change)(struct net_device *dev);
192
193 /* If the hardware can do scanning, assign _all_ three of these callbacks.
194 * When the scan finishes, call ieee80211softmac_scan_finished().
195 */
196
197 /* when called, start_scan is guaranteed to not be called again
198 * until you call ieee80211softmac_scan_finished.
199 * Return 0 if scanning could start, error otherwise.
200 * SOFTMAC AUTHORS: don't call this, use ieee80211softmac_start_scan */
201 int (*start_scan)(struct net_device *dev);
202 /* this should block until after ieee80211softmac_scan_finished was called
203 * SOFTMAC AUTHORS: don't call this, use ieee80211softmac_wait_for_scan */
204 void (*wait_for_scan)(struct net_device *dev);
205 /* stop_scan aborts a scan, but is asynchronous.
206 * if you want to wait for it too, use wait_for_scan
207 * SOFTMAC AUTHORS: don't call this, use ieee80211softmac_stop_scan */
208 void (*stop_scan)(struct net_device *dev);
209
210 /* we'll need something about beacons here too, for AP or ad-hoc modes */
211
212 /* Transmission rates to be used by the driver.
213 * The SoftMAC figures out the best possible rates.
214 * The driver just needs to read them.
215 */
216 struct ieee80211softmac_txrates txrates;
217
218 /* If the driver needs to do stuff on TX rate changes, assign this
219 * callback. See IEEE80211SOFTMAC_TXRATECHG for change flags. */
220 void (*txrates_change)(struct net_device *dev,
221 u32 changes);
222
223 /* If the driver needs to do stuff when BSS properties change, assign
224 * this callback. see IEEE80211SOFTMAC_BSSINFOCHG for change flags. */
225 void (*bssinfo_change)(struct net_device *dev,
226 u32 changes);
227
228 /* private stuff follows */
229 /* this lock protects this structure */
230 spinlock_t lock;
231
232 struct workqueue_struct *wq;
233
234 u8 running; /* SoftMAC started? */
235 u8 scanning;
236
237 struct ieee80211softmac_scaninfo *scaninfo;
238 struct ieee80211softmac_assoc_info associnfo;
239 struct ieee80211softmac_bss_info bssinfo;
240
241 struct list_head auth_queue;
242 struct list_head events;
243
244 struct ieee80211softmac_ratesinfo ratesinfo;
245 int txrate_badness;
246
247 /* WPA stuff */
248 struct ieee80211softmac_wpa wpa;
249
250 /* we need to keep a list of network structs we copied */
251 struct list_head network_list;
252
253 /* This must be the last item so that it points to the data
254 * allocated beyond this structure by alloc_ieee80211 */
255 u8 priv[0];
256};
257
258extern void ieee80211softmac_scan_finished(struct ieee80211softmac_device *sm);
259
260static inline void * ieee80211softmac_priv(struct net_device *dev)
261{
262 return ((struct ieee80211softmac_device *)ieee80211_priv(dev))->priv;
263}
264
265extern struct net_device * alloc_ieee80211softmac(int sizeof_priv);
266extern void free_ieee80211softmac(struct net_device *dev);
267
268/* Call this function if you detect a lost TX fragment.
269 * (If the device indicates failure of ACK RX, for example.)
270 * It is wise to call this function if you are able to detect lost packets,
271 * because it contributes to the TX Rates auto adjustment.
272 */
273extern void ieee80211softmac_fragment_lost(struct net_device *dev,
274 u16 wireless_sequence_number);
275/* Call this function before _start to tell the softmac what rates
276 * the hw supports. The rates parameter is copied, so you can
277 * free it right after calling this function.
278 * Note that the rates need to be sorted. */
279extern void ieee80211softmac_set_rates(struct net_device *dev, u8 count, u8 *rates);
280
281/* Finds the highest rate which is:
282 * 1. Present in ri (optionally a basic rate)
283 * 2. Supported by the device
284 * 3. Less than or equal to the user-defined rate
285 */
286extern u8 ieee80211softmac_highest_supported_rate(struct ieee80211softmac_device *mac,
287 struct ieee80211softmac_ratesinfo *ri, int basic_only);
288
289/* Helper function which advises you the rate at which a frame should be
290 * transmitted at. */
291static inline u8 ieee80211softmac_suggest_txrate(struct ieee80211softmac_device *mac,
292 int is_multicast,
293 int is_mgt)
294{
295 struct ieee80211softmac_txrates *txrates = &mac->txrates;
296
297 if (!mac->associnfo.associated)
298 return txrates->mgt_mcast_rate;
299
300 /* We are associated, sending unicast frame */
301 if (!is_multicast)
302 return txrates->default_rate;
303
304 /* We are associated, sending multicast frame */
305 if (is_mgt)
306 return txrates->mgt_mcast_rate;
307 else
308 return txrates->mcast_rate;
309}
310
311/* Helper function which advises you when it is safe to transmit with short
312 * preamble.
313 * You should only call this function when transmitting at CCK rates. */
314static inline int ieee80211softmac_short_preamble_ok(struct ieee80211softmac_device *mac,
315 int is_multicast,
316 int is_mgt)
317{
318 return (is_multicast && is_mgt) ? 0 : mac->bssinfo.short_preamble;
319}
320
321/* Helper function which advises you whether protection (e.g. self-CTS) is
322 * needed. 1 = protection needed, 0 = no protection needed
323 * Only use this function when transmitting with OFDM modulation. */
324static inline int ieee80211softmac_protection_needed(struct ieee80211softmac_device *mac)
325{
326 return mac->bssinfo.use_protection;
327}
328
329/* Start the SoftMAC. Call this after you initialized the device
330 * and it is ready to run.
331 */
332extern void ieee80211softmac_start(struct net_device *dev);
333/* Stop the SoftMAC. Call this before you shutdown the device. */
334extern void ieee80211softmac_stop(struct net_device *dev);
335
336/*
337 * Event system
338 */
339
340/* valid event types */
341#define IEEE80211SOFTMAC_EVENT_ANY -1 /*private use only*/
342#define IEEE80211SOFTMAC_EVENT_SCAN_FINISHED 0
343#define IEEE80211SOFTMAC_EVENT_ASSOCIATED 1
344#define IEEE80211SOFTMAC_EVENT_ASSOCIATE_FAILED 2
345#define IEEE80211SOFTMAC_EVENT_ASSOCIATE_TIMEOUT 3
346#define IEEE80211SOFTMAC_EVENT_AUTHENTICATED 4
347#define IEEE80211SOFTMAC_EVENT_AUTH_FAILED 5
348#define IEEE80211SOFTMAC_EVENT_AUTH_TIMEOUT 6
349#define IEEE80211SOFTMAC_EVENT_ASSOCIATE_NET_NOT_FOUND 7
350#define IEEE80211SOFTMAC_EVENT_DISASSOCIATED 8
351/* keep this updated! */
352#define IEEE80211SOFTMAC_EVENT_LAST 8
353/*
354 * If you want to be notified of certain events, you can call
355 * ieee80211softmac_notify[_atomic] with
356 * - event set to one of the constants below
357 * - fun set to a function pointer of the appropriate type
358 * - context set to the context data you want passed
359 * The return value is 0, or an error.
360 */
361typedef void (*notify_function_ptr)(struct net_device *dev, int event_type, void *context);
362
363#define ieee80211softmac_notify(dev, event, fun, context) ieee80211softmac_notify_gfp(dev, event, fun, context, GFP_KERNEL);
364#define ieee80211softmac_notify_atomic(dev, event, fun, context) ieee80211softmac_notify_gfp(dev, event, fun, context, GFP_ATOMIC);
365
366extern int ieee80211softmac_notify_gfp(struct net_device *dev,
367 int event, notify_function_ptr fun, void *context, gfp_t gfp_mask);
368
369/* To clear pending work (for ifconfig down, etc.) */
370extern void
371ieee80211softmac_clear_pending_work(struct ieee80211softmac_device *sm);
372
373#endif /* IEEE80211SOFTMAC_H_ */
diff --git a/include/net/ieee80211softmac_wx.h b/include/net/ieee80211softmac_wx.h
deleted file mode 100644
index 4ee3ad57283f..000000000000
--- a/include/net/ieee80211softmac_wx.h
+++ /dev/null
@@ -1,99 +0,0 @@
1/*
2 * This file contains the prototypes for the wireless extension
3 * handlers that the softmac API provides. Include this file to
4 * use the wx handlers, you can assign these directly.
5 *
6 * Copyright (c) 2005 Johannes Berg <johannes@sipsolutions.net>
7 * Joseph Jezak <josejx@gentoo.org>
8 * Larry Finger <Larry.Finger@lwfinger.net>
9 * Danny van Dyk <kugelfang@gentoo.org>
10 * Michael Buesch <mbuesch@freenet.de>
11 *
12 * This program is free software; you can redistribute it and/or modify it
13 * under the terms of version 2 of the GNU General Public License as
14 * published by the Free Software Foundation.
15 *
16 * This program is distributed in the hope that it will be useful, but WITHOUT
17 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
19 * more details.
20 *
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
24 *
25 * The full GNU General Public License is included in this distribution in the
26 * file called COPYING.
27 */
28
29#ifndef _IEEE80211SOFTMAC_WX_H
30#define _IEEE80211SOFTMAC_WX_H
31
32#include <net/ieee80211softmac.h>
33#include <net/iw_handler.h>
34
35extern int
36ieee80211softmac_wx_trigger_scan(struct net_device *net_dev,
37 struct iw_request_info *info,
38 union iwreq_data *data,
39 char *extra);
40
41extern int
42ieee80211softmac_wx_get_scan_results(struct net_device *net_dev,
43 struct iw_request_info *info,
44 union iwreq_data *data,
45 char *extra);
46
47extern int
48ieee80211softmac_wx_set_essid(struct net_device *net_dev,
49 struct iw_request_info *info,
50 union iwreq_data *data,
51 char *extra);
52
53extern int
54ieee80211softmac_wx_get_essid(struct net_device *net_dev,
55 struct iw_request_info *info,
56 union iwreq_data *data,
57 char *extra);
58
59extern int
60ieee80211softmac_wx_set_rate(struct net_device *net_dev,
61 struct iw_request_info *info,
62 union iwreq_data *data,
63 char *extra);
64
65extern int
66ieee80211softmac_wx_get_rate(struct net_device *net_dev,
67 struct iw_request_info *info,
68 union iwreq_data *data,
69 char *extra);
70
71extern int
72ieee80211softmac_wx_get_wap(struct net_device *net_dev,
73 struct iw_request_info *info,
74 union iwreq_data *data,
75 char *extra);
76
77extern int
78ieee80211softmac_wx_set_wap(struct net_device *net_dev,
79 struct iw_request_info *info,
80 union iwreq_data *data,
81 char *extra);
82
83extern int
84ieee80211softmac_wx_set_genie(struct net_device *dev,
85 struct iw_request_info *info,
86 union iwreq_data *wrqu,
87 char *extra);
88
89extern int
90ieee80211softmac_wx_get_genie(struct net_device *dev,
91 struct iw_request_info *info,
92 union iwreq_data *wrqu,
93 char *extra);
94extern int
95ieee80211softmac_wx_set_mlme(struct net_device *dev,
96 struct iw_request_info *info,
97 union iwreq_data *wrqu,
98 char *extra);
99#endif /* _IEEE80211SOFTMAC_WX */
diff --git a/include/net/inet_common.h b/include/net/inet_common.h
index 38d5a1e9980d..18c773286b91 100644
--- a/include/net/inet_common.h
+++ b/include/net/inet_common.h
@@ -39,6 +39,17 @@ extern int inet_getname(struct socket *sock,
39extern int inet_ioctl(struct socket *sock, 39extern int inet_ioctl(struct socket *sock,
40 unsigned int cmd, unsigned long arg); 40 unsigned int cmd, unsigned long arg);
41 41
42extern int inet_ctl_sock_create(struct sock **sk,
43 unsigned short family,
44 unsigned short type,
45 unsigned char protocol,
46 struct net *net);
47
48static inline void inet_ctl_sock_destroy(struct sock *sk)
49{
50 sk_release_kernel(sk);
51}
52
42#endif 53#endif
43 54
44 55
diff --git a/include/net/inet_connection_sock.h b/include/net/inet_connection_sock.h
index f00f0573627b..2ff545a56fb5 100644
--- a/include/net/inet_connection_sock.h
+++ b/include/net/inet_connection_sock.h
@@ -327,11 +327,6 @@ extern void inet_csk_listen_stop(struct sock *sk);
327 327
328extern void inet_csk_addr2sockaddr(struct sock *sk, struct sockaddr *uaddr); 328extern void inet_csk_addr2sockaddr(struct sock *sk, struct sockaddr *uaddr);
329 329
330extern int inet_csk_ctl_sock_create(struct socket **sock,
331 unsigned short family,
332 unsigned short type,
333 unsigned char protocol);
334
335extern int inet_csk_compat_getsockopt(struct sock *sk, int level, int optname, 330extern int inet_csk_compat_getsockopt(struct sock *sk, int level, int optname,
336 char __user *optval, int __user *optlen); 331 char __user *optval, int __user *optlen);
337extern int inet_csk_compat_setsockopt(struct sock *sk, int level, int optname, 332extern int inet_csk_compat_setsockopt(struct sock *sk, int level, int optname,
diff --git a/include/net/inet_frag.h b/include/net/inet_frag.h
index 7374251b9787..e081eefd6f47 100644
--- a/include/net/inet_frag.h
+++ b/include/net/inet_frag.h
@@ -25,9 +25,9 @@ struct inet_frag_queue {
25 int meat; 25 int meat;
26 __u8 last_in; /* first/last segment arrived? */ 26 __u8 last_in; /* first/last segment arrived? */
27 27
28#define COMPLETE 4 28#define INET_FRAG_COMPLETE 4
29#define FIRST_IN 2 29#define INET_FRAG_FIRST_IN 2
30#define LAST_IN 1 30#define INET_FRAG_LAST_IN 1
31}; 31};
32 32
33#define INETFRAGS_HASHSZ 64 33#define INETFRAGS_HASHSZ 64
diff --git a/include/net/inet_hashtables.h b/include/net/inet_hashtables.h
index 97dc35ad09be..735b926a3497 100644
--- a/include/net/inet_hashtables.h
+++ b/include/net/inet_hashtables.h
@@ -221,26 +221,7 @@ static inline int inet_sk_listen_hashfn(const struct sock *sk)
221} 221}
222 222
223/* Caller must disable local BH processing. */ 223/* Caller must disable local BH processing. */
224static inline void __inet_inherit_port(struct sock *sk, struct sock *child) 224extern void __inet_inherit_port(struct sock *sk, struct sock *child);
225{
226 struct inet_hashinfo *table = sk->sk_prot->hashinfo;
227 const int bhash = inet_bhashfn(inet_sk(child)->num, table->bhash_size);
228 struct inet_bind_hashbucket *head = &table->bhash[bhash];
229 struct inet_bind_bucket *tb;
230
231 spin_lock(&head->lock);
232 tb = inet_csk(sk)->icsk_bind_hash;
233 sk_add_bind_node(child, &tb->owners);
234 inet_csk(child)->icsk_bind_hash = tb;
235 spin_unlock(&head->lock);
236}
237
238static inline void inet_inherit_port(struct sock *sk, struct sock *child)
239{
240 local_bh_disable();
241 __inet_inherit_port(sk, child);
242 local_bh_enable();
243}
244 225
245extern void inet_put_port(struct sock *sk); 226extern void inet_put_port(struct sock *sk);
246 227
@@ -314,25 +295,25 @@ typedef __u64 __bitwise __addrpair;
314 ((__force __u64)(__be32)(__saddr))); 295 ((__force __u64)(__be32)(__saddr)));
315#endif /* __BIG_ENDIAN */ 296#endif /* __BIG_ENDIAN */
316#define INET_MATCH(__sk, __net, __hash, __cookie, __saddr, __daddr, __ports, __dif)\ 297#define INET_MATCH(__sk, __net, __hash, __cookie, __saddr, __daddr, __ports, __dif)\
317 (((__sk)->sk_hash == (__hash)) && ((__sk)->sk_net == (__net)) && \ 298 (((__sk)->sk_hash == (__hash)) && sock_net((__sk)) == (__net) && \
318 ((*((__addrpair *)&(inet_sk(__sk)->daddr))) == (__cookie)) && \ 299 ((*((__addrpair *)&(inet_sk(__sk)->daddr))) == (__cookie)) && \
319 ((*((__portpair *)&(inet_sk(__sk)->dport))) == (__ports)) && \ 300 ((*((__portpair *)&(inet_sk(__sk)->dport))) == (__ports)) && \
320 (!((__sk)->sk_bound_dev_if) || ((__sk)->sk_bound_dev_if == (__dif)))) 301 (!((__sk)->sk_bound_dev_if) || ((__sk)->sk_bound_dev_if == (__dif))))
321#define INET_TW_MATCH(__sk, __net, __hash, __cookie, __saddr, __daddr, __ports, __dif)\ 302#define INET_TW_MATCH(__sk, __net, __hash, __cookie, __saddr, __daddr, __ports, __dif)\
322 (((__sk)->sk_hash == (__hash)) && ((__sk)->sk_net == (__net)) && \ 303 (((__sk)->sk_hash == (__hash)) && sock_net((__sk)) == (__net) && \
323 ((*((__addrpair *)&(inet_twsk(__sk)->tw_daddr))) == (__cookie)) && \ 304 ((*((__addrpair *)&(inet_twsk(__sk)->tw_daddr))) == (__cookie)) && \
324 ((*((__portpair *)&(inet_twsk(__sk)->tw_dport))) == (__ports)) && \ 305 ((*((__portpair *)&(inet_twsk(__sk)->tw_dport))) == (__ports)) && \
325 (!((__sk)->sk_bound_dev_if) || ((__sk)->sk_bound_dev_if == (__dif)))) 306 (!((__sk)->sk_bound_dev_if) || ((__sk)->sk_bound_dev_if == (__dif))))
326#else /* 32-bit arch */ 307#else /* 32-bit arch */
327#define INET_ADDR_COOKIE(__name, __saddr, __daddr) 308#define INET_ADDR_COOKIE(__name, __saddr, __daddr)
328#define INET_MATCH(__sk, __net, __hash, __cookie, __saddr, __daddr, __ports, __dif) \ 309#define INET_MATCH(__sk, __net, __hash, __cookie, __saddr, __daddr, __ports, __dif) \
329 (((__sk)->sk_hash == (__hash)) && ((__sk)->sk_net == (__net)) && \ 310 (((__sk)->sk_hash == (__hash)) && sock_net((__sk)) == (__net) && \
330 (inet_sk(__sk)->daddr == (__saddr)) && \ 311 (inet_sk(__sk)->daddr == (__saddr)) && \
331 (inet_sk(__sk)->rcv_saddr == (__daddr)) && \ 312 (inet_sk(__sk)->rcv_saddr == (__daddr)) && \
332 ((*((__portpair *)&(inet_sk(__sk)->dport))) == (__ports)) && \ 313 ((*((__portpair *)&(inet_sk(__sk)->dport))) == (__ports)) && \
333 (!((__sk)->sk_bound_dev_if) || ((__sk)->sk_bound_dev_if == (__dif)))) 314 (!((__sk)->sk_bound_dev_if) || ((__sk)->sk_bound_dev_if == (__dif))))
334#define INET_TW_MATCH(__sk, __net, __hash,__cookie, __saddr, __daddr, __ports, __dif) \ 315#define INET_TW_MATCH(__sk, __net, __hash,__cookie, __saddr, __daddr, __ports, __dif) \
335 (((__sk)->sk_hash == (__hash)) && ((__sk)->sk_net == (__net)) && \ 316 (((__sk)->sk_hash == (__hash)) && sock_net((__sk)) == (__net) && \
336 (inet_twsk(__sk)->tw_daddr == (__saddr)) && \ 317 (inet_twsk(__sk)->tw_daddr == (__saddr)) && \
337 (inet_twsk(__sk)->tw_rcv_saddr == (__daddr)) && \ 318 (inet_twsk(__sk)->tw_rcv_saddr == (__daddr)) && \
338 ((*((__portpair *)&(inet_twsk(__sk)->tw_dport))) == (__ports)) && \ 319 ((*((__portpair *)&(inet_twsk(__sk)->tw_dport))) == (__ports)) && \
diff --git a/include/net/inet_sock.h b/include/net/inet_sock.h
index 89cd011edb99..a42cd63d241a 100644
--- a/include/net/inet_sock.h
+++ b/include/net/inet_sock.h
@@ -43,8 +43,7 @@ struct ip_options {
43 unsigned char srr; 43 unsigned char srr;
44 unsigned char rr; 44 unsigned char rr;
45 unsigned char ts; 45 unsigned char ts;
46 unsigned char is_data:1, 46 unsigned char is_strictroute:1,
47 is_strictroute:1,
48 srr_is_hit:1, 47 srr_is_hit:1,
49 is_changed:1, 48 is_changed:1,
50 rr_needaddr:1, 49 rr_needaddr:1,
@@ -137,7 +136,7 @@ struct inet_sock {
137 unsigned int flags; 136 unsigned int flags;
138 unsigned int fragsize; 137 unsigned int fragsize;
139 struct ip_options *opt; 138 struct ip_options *opt;
140 struct rtable *rt; 139 struct dst_entry *dst;
141 int length; /* Total length of all frames */ 140 int length; /* Total length of all frames */
142 __be32 addr; 141 __be32 addr;
143 struct flowi fl; 142 struct flowi fl;
@@ -195,7 +194,7 @@ static inline int inet_sk_ehashfn(const struct sock *sk)
195 194
196static inline int inet_iif(const struct sk_buff *skb) 195static inline int inet_iif(const struct sk_buff *skb)
197{ 196{
198 return ((struct rtable *)skb->dst)->rt_iif; 197 return skb->rtable->rt_iif;
199} 198}
200 199
201#endif /* _INET_SOCK_H */ 200#endif /* _INET_SOCK_H */
diff --git a/include/net/inet_timewait_sock.h b/include/net/inet_timewait_sock.h
index 296547bfb0b7..95c660c9719b 100644
--- a/include/net/inet_timewait_sock.h
+++ b/include/net/inet_timewait_sock.h
@@ -207,4 +207,22 @@ extern void inet_twsk_schedule(struct inet_timewait_sock *tw,
207 const int timeo, const int timewait_len); 207 const int timeo, const int timewait_len);
208extern void inet_twsk_deschedule(struct inet_timewait_sock *tw, 208extern void inet_twsk_deschedule(struct inet_timewait_sock *tw,
209 struct inet_timewait_death_row *twdr); 209 struct inet_timewait_death_row *twdr);
210
211static inline
212struct net *twsk_net(const struct inet_timewait_sock *twsk)
213{
214#ifdef CONFIG_NET_NS
215 return twsk->tw_net;
216#else
217 return &init_net;
218#endif
219}
220
221static inline
222void twsk_net_set(struct inet_timewait_sock *twsk, struct net *net)
223{
224#ifdef CONFIG_NET_NS
225 twsk->tw_net = net;
226#endif
227}
210#endif /* _INET_TIMEWAIT_SOCK_ */ 228#endif /* _INET_TIMEWAIT_SOCK_ */
diff --git a/include/net/ip.h b/include/net/ip.h
index 9f50d4f1f157..6d7bcd5e62d4 100644
--- a/include/net/ip.h
+++ b/include/net/ip.h
@@ -347,10 +347,11 @@ extern int ip_forward(struct sk_buff *skb);
347extern void ip_options_build(struct sk_buff *skb, struct ip_options *opt, __be32 daddr, struct rtable *rt, int is_frag); 347extern void ip_options_build(struct sk_buff *skb, struct ip_options *opt, __be32 daddr, struct rtable *rt, int is_frag);
348extern int ip_options_echo(struct ip_options *dopt, struct sk_buff *skb); 348extern int ip_options_echo(struct ip_options *dopt, struct sk_buff *skb);
349extern void ip_options_fragment(struct sk_buff *skb); 349extern void ip_options_fragment(struct sk_buff *skb);
350extern int ip_options_compile(struct ip_options *opt, struct sk_buff *skb); 350extern int ip_options_compile(struct net *net,
351extern int ip_options_get(struct ip_options **optp, 351 struct ip_options *opt, struct sk_buff *skb);
352extern int ip_options_get(struct net *net, struct ip_options **optp,
352 unsigned char *data, int optlen); 353 unsigned char *data, int optlen);
353extern int ip_options_get_from_user(struct ip_options **optp, 354extern int ip_options_get_from_user(struct net *net, struct ip_options **optp,
354 unsigned char __user *data, int optlen); 355 unsigned char __user *data, int optlen);
355extern void ip_options_undo(struct ip_options * opt); 356extern void ip_options_undo(struct ip_options * opt);
356extern void ip_forward_options(struct sk_buff *skb); 357extern void ip_forward_options(struct sk_buff *skb);
@@ -361,7 +362,8 @@ extern int ip_options_rcv_srr(struct sk_buff *skb);
361 */ 362 */
362 363
363extern void ip_cmsg_recv(struct msghdr *msg, struct sk_buff *skb); 364extern void ip_cmsg_recv(struct msghdr *msg, struct sk_buff *skb);
364extern int ip_cmsg_send(struct msghdr *msg, struct ipcm_cookie *ipc); 365extern int ip_cmsg_send(struct net *net,
366 struct msghdr *msg, struct ipcm_cookie *ipc);
365extern int ip_setsockopt(struct sock *sk, int level, int optname, char __user *optval, int optlen); 367extern int ip_setsockopt(struct sock *sk, int level, int optname, char __user *optval, int optlen);
366extern int ip_getsockopt(struct sock *sk, int level, int optname, char __user *optval, int __user *optlen); 368extern int ip_getsockopt(struct sock *sk, int level, int optname, char __user *optval, int __user *optlen);
367extern int compat_ip_setsockopt(struct sock *sk, int level, 369extern int compat_ip_setsockopt(struct sock *sk, int level,
diff --git a/include/net/ip6_fib.h b/include/net/ip6_fib.h
index 953d6040ff50..7c5c0f79168a 100644
--- a/include/net/ip6_fib.h
+++ b/include/net/ip6_fib.h
@@ -174,17 +174,19 @@ struct fib6_table {
174#define RT6_TABLE_LOCAL RT6_TABLE_MAIN 174#define RT6_TABLE_LOCAL RT6_TABLE_MAIN
175#endif 175#endif
176 176
177typedef struct rt6_info *(*pol_lookup_t)(struct fib6_table *, 177typedef struct rt6_info *(*pol_lookup_t)(struct net *,
178 struct fib6_table *,
178 struct flowi *, int); 179 struct flowi *, int);
179 180
180/* 181/*
181 * exported functions 182 * exported functions
182 */ 183 */
183 184
184extern struct fib6_table * fib6_get_table(u32 id); 185extern struct fib6_table *fib6_get_table(struct net *net, u32 id);
185extern struct fib6_table * fib6_new_table(u32 id); 186extern struct fib6_table *fib6_new_table(struct net *net, u32 id);
186extern struct dst_entry * fib6_rule_lookup(struct flowi *fl, int flags, 187extern struct dst_entry *fib6_rule_lookup(struct net *net,
187 pol_lookup_t lookup); 188 struct flowi *fl, int flags,
189 pol_lookup_t lookup);
188 190
189extern struct fib6_node *fib6_lookup(struct fib6_node *root, 191extern struct fib6_node *fib6_lookup(struct fib6_node *root,
190 struct in6_addr *daddr, 192 struct in6_addr *daddr,
@@ -194,7 +196,8 @@ struct fib6_node *fib6_locate(struct fib6_node *root,
194 struct in6_addr *daddr, int dst_len, 196 struct in6_addr *daddr, int dst_len,
195 struct in6_addr *saddr, int src_len); 197 struct in6_addr *saddr, int src_len);
196 198
197extern void fib6_clean_all(int (*func)(struct rt6_info *, void *arg), 199extern void fib6_clean_all(struct net *net,
200 int (*func)(struct rt6_info *, void *arg),
198 int prune, void *arg); 201 int prune, void *arg);
199 202
200extern int fib6_add(struct fib6_node *root, 203extern int fib6_add(struct fib6_node *root,
@@ -207,7 +210,8 @@ extern int fib6_del(struct rt6_info *rt,
207extern void inet6_rt_notify(int event, struct rt6_info *rt, 210extern void inet6_rt_notify(int event, struct rt6_info *rt,
208 struct nl_info *info); 211 struct nl_info *info);
209 212
210extern void fib6_run_gc(unsigned long dummy); 213extern void fib6_run_gc(unsigned long expires,
214 struct net *net);
211 215
212extern void fib6_gc_cleanup(void); 216extern void fib6_gc_cleanup(void);
213 217
diff --git a/include/net/ip6_route.h b/include/net/ip6_route.h
index f99e4f0f568f..9313491e3dad 100644
--- a/include/net/ip6_route.h
+++ b/include/net/ip6_route.h
@@ -30,60 +30,54 @@ struct route_info {
30#include <linux/ip.h> 30#include <linux/ip.h>
31#include <linux/ipv6.h> 31#include <linux/ipv6.h>
32 32
33#define RT6_LOOKUP_F_IFACE 0x1 33#define RT6_LOOKUP_F_IFACE 0x00000001
34#define RT6_LOOKUP_F_REACHABLE 0x2 34#define RT6_LOOKUP_F_REACHABLE 0x00000002
35#define RT6_LOOKUP_F_HAS_SADDR 0x4 35#define RT6_LOOKUP_F_HAS_SADDR 0x00000004
36#define RT6_LOOKUP_F_SRCPREF_TMP 0x00000008
37#define RT6_LOOKUP_F_SRCPREF_PUBLIC 0x00000010
38#define RT6_LOOKUP_F_SRCPREF_COA 0x00000020
36 39
37extern struct rt6_info ip6_null_entry;
38 40
39#ifdef CONFIG_IPV6_MULTIPLE_TABLES 41#ifdef CONFIG_IPV6_MULTIPLE_TABLES
40extern struct rt6_info ip6_prohibit_entry; 42extern struct rt6_info *ip6_prohibit_entry;
41extern struct rt6_info ip6_blk_hole_entry; 43extern struct rt6_info *ip6_blk_hole_entry;
42#endif 44#endif
43 45
44extern void ip6_route_input(struct sk_buff *skb); 46extern void ip6_route_input(struct sk_buff *skb);
45 47
46extern struct dst_entry * ip6_route_output(struct sock *sk, 48extern struct dst_entry * ip6_route_output(struct net *net,
49 struct sock *sk,
47 struct flowi *fl); 50 struct flowi *fl);
48 51
49extern int ip6_route_init(void); 52extern int ip6_route_init(void);
50extern void ip6_route_cleanup(void); 53extern void ip6_route_cleanup(void);
51 54
52extern int ipv6_route_ioctl(unsigned int cmd, void __user *arg); 55extern int ipv6_route_ioctl(struct net *net,
56 unsigned int cmd,
57 void __user *arg);
53 58
54extern int ip6_route_add(struct fib6_config *cfg); 59extern int ip6_route_add(struct fib6_config *cfg);
55extern int ip6_ins_rt(struct rt6_info *); 60extern int ip6_ins_rt(struct rt6_info *);
56extern int ip6_del_rt(struct rt6_info *); 61extern int ip6_del_rt(struct rt6_info *);
57 62
58extern int ip6_rt_addr_add(struct in6_addr *addr, 63extern struct rt6_info *rt6_lookup(struct net *net,
59 struct net_device *dev, 64 const struct in6_addr *daddr,
60 int anycast); 65 const struct in6_addr *saddr,
61
62extern int ip6_rt_addr_del(struct in6_addr *addr,
63 struct net_device *dev);
64
65extern void rt6_sndmsg(int type, struct in6_addr *dst,
66 struct in6_addr *src,
67 struct in6_addr *gw,
68 struct net_device *dev,
69 int dstlen, int srclen,
70 int metric, __u32 flags);
71
72extern struct rt6_info *rt6_lookup(struct in6_addr *daddr,
73 struct in6_addr *saddr,
74 int oif, int flags); 66 int oif, int flags);
75 67
76extern struct dst_entry *ndisc_dst_alloc(struct net_device *dev, 68extern struct dst_entry *icmp6_dst_alloc(struct net_device *dev,
77 struct neighbour *neigh, 69 struct neighbour *neigh,
78 struct in6_addr *addr, 70 const struct in6_addr *addr);
79 int (*output)(struct sk_buff *)); 71extern int icmp6_dst_gc(int *more);
80extern int ndisc_dst_gc(int *more); 72
81extern void fib6_force_start_gc(void); 73extern void fib6_force_start_gc(struct net *net);
82 74
83extern struct rt6_info *addrconf_dst_alloc(struct inet6_dev *idev, 75extern struct rt6_info *addrconf_dst_alloc(struct inet6_dev *idev,
84 const struct in6_addr *addr, 76 const struct in6_addr *addr,
85 int anycast); 77 int anycast);
86 78
79extern int ip6_dst_hoplimit(struct dst_entry *dst);
80
87/* 81/*
88 * support functions for ND 82 * support functions for ND
89 * 83 *
@@ -94,7 +88,7 @@ extern struct rt6_info * rt6_add_dflt_router(struct in6_addr *gwaddr,
94 struct net_device *dev, 88 struct net_device *dev,
95 unsigned int pref); 89 unsigned int pref);
96 90
97extern void rt6_purge_dflt_routers(void); 91extern void rt6_purge_dflt_routers(struct net *net);
98 92
99extern int rt6_route_rcv(struct net_device *dev, 93extern int rt6_route_rcv(struct net_device *dev,
100 u8 *opt, int len, 94 u8 *opt, int len,
@@ -121,7 +115,7 @@ struct rt6_rtnl_dump_arg
121}; 115};
122 116
123extern int rt6_dump_route(struct rt6_info *rt, void *p_arg); 117extern int rt6_dump_route(struct rt6_info *rt, void *p_arg);
124extern void rt6_ifdown(struct net_device *dev); 118extern void rt6_ifdown(struct net *net, struct net_device *dev);
125extern void rt6_mtu_change(struct net_device *dev, unsigned mtu); 119extern void rt6_mtu_change(struct net_device *dev, unsigned mtu);
126 120
127extern rwlock_t rt6_lock; 121extern rwlock_t rt6_lock;
diff --git a/include/net/ipip.h b/include/net/ipip.h
index 549e132bca9c..633ed4def8e3 100644
--- a/include/net/ipip.h
+++ b/include/net/ipip.h
@@ -24,6 +24,16 @@ struct ip_tunnel
24 int mlink; 24 int mlink;
25 25
26 struct ip_tunnel_parm parms; 26 struct ip_tunnel_parm parms;
27
28 struct ip_tunnel_prl_entry *prl; /* potential router list */
29 unsigned int prl_count; /* # of entries in PRL */
30};
31
32struct ip_tunnel_prl_entry
33{
34 struct ip_tunnel_prl_entry *next;
35 __be32 addr;
36 u16 flags;
27}; 37};
28 38
29#define IPTUNNEL_XMIT() do { \ 39#define IPTUNNEL_XMIT() do { \
diff --git a/include/net/ipv6.h b/include/net/ipv6.h
index c0c019f72ba9..49c48983019f 100644
--- a/include/net/ipv6.h
+++ b/include/net/ipv6.h
@@ -202,6 +202,7 @@ struct ip6_flowlabel
202 u32 owner; 202 u32 owner;
203 unsigned long lastuse; 203 unsigned long lastuse;
204 unsigned long expires; 204 unsigned long expires;
205 struct net *fl_net;
205}; 206};
206 207
207#define IPV6_FLOWINFO_MASK __constant_htonl(0x0FFFFFFF) 208#define IPV6_FLOWINFO_MASK __constant_htonl(0x0FFFFFFF)
@@ -249,15 +250,6 @@ int ip6_frag_mem(struct net *net);
249 250
250#define IPV6_FRAG_TIMEOUT (60*HZ) /* 60 seconds */ 251#define IPV6_FRAG_TIMEOUT (60*HZ) /* 60 seconds */
251 252
252/*
253 * Function prototype for build_xmit
254 */
255
256typedef int (*inet_getfrag_t) (const void *data,
257 struct in6_addr *addr,
258 char *,
259 unsigned int, unsigned int);
260
261extern int __ipv6_addr_type(const struct in6_addr *addr); 253extern int __ipv6_addr_type(const struct in6_addr *addr);
262static inline int ipv6_addr_type(const struct in6_addr *addr) 254static inline int ipv6_addr_type(const struct in6_addr *addr)
263{ 255{
@@ -288,12 +280,10 @@ static inline int
288ipv6_masked_addr_cmp(const struct in6_addr *a1, const struct in6_addr *m, 280ipv6_masked_addr_cmp(const struct in6_addr *a1, const struct in6_addr *m,
289 const struct in6_addr *a2) 281 const struct in6_addr *a2)
290{ 282{
291 unsigned int i; 283 return (!!(((a1->s6_addr32[0] ^ a2->s6_addr32[0]) & m->s6_addr32[0]) |
292 284 ((a1->s6_addr32[1] ^ a2->s6_addr32[1]) & m->s6_addr32[1]) |
293 for (i = 0; i < 4; i++) 285 ((a1->s6_addr32[2] ^ a2->s6_addr32[2]) & m->s6_addr32[2]) |
294 if ((a1->s6_addr32[i] ^ a2->s6_addr32[i]) & m->s6_addr32[i]) 286 ((a1->s6_addr32[3] ^ a2->s6_addr32[3]) & m->s6_addr32[3])));
295 return 1;
296 return 0;
297} 287}
298 288
299static inline void ipv6_addr_copy(struct in6_addr *a1, const struct in6_addr *a2) 289static inline void ipv6_addr_copy(struct in6_addr *a1, const struct in6_addr *a2)
@@ -328,10 +318,10 @@ static inline void ipv6_addr_set(struct in6_addr *addr,
328static inline int ipv6_addr_equal(const struct in6_addr *a1, 318static inline int ipv6_addr_equal(const struct in6_addr *a1,
329 const struct in6_addr *a2) 319 const struct in6_addr *a2)
330{ 320{
331 return (a1->s6_addr32[0] == a2->s6_addr32[0] && 321 return (((a1->s6_addr32[0] ^ a2->s6_addr32[0]) |
332 a1->s6_addr32[1] == a2->s6_addr32[1] && 322 (a1->s6_addr32[1] ^ a2->s6_addr32[1]) |
333 a1->s6_addr32[2] == a2->s6_addr32[2] && 323 (a1->s6_addr32[2] ^ a2->s6_addr32[2]) |
334 a1->s6_addr32[3] == a2->s6_addr32[3]); 324 (a1->s6_addr32[3] ^ a2->s6_addr32[3])) == 0);
335} 325}
336 326
337static inline int __ipv6_prefix_equal(const __be32 *a1, const __be32 *a2, 327static inline int __ipv6_prefix_equal(const __be32 *a1, const __be32 *a2,
@@ -379,8 +369,18 @@ static inline int ipv6_addr_any(const struct in6_addr *a)
379 369
380static inline int ipv6_addr_v4mapped(const struct in6_addr *a) 370static inline int ipv6_addr_v4mapped(const struct in6_addr *a)
381{ 371{
382 return ((a->s6_addr32[0] | a->s6_addr32[1]) == 0 && 372 return ((a->s6_addr32[0] | a->s6_addr32[1] |
383 a->s6_addr32[2] == htonl(0x0000ffff)); 373 (a->s6_addr32[2] ^ htonl(0x0000ffff))) == 0);
374}
375
376/*
377 * Check for a RFC 4843 ORCHID address
378 * (Overlay Routable Cryptographic Hash Identifiers)
379 */
380static inline int ipv6_addr_orchid(const struct in6_addr *a)
381{
382 return ((a->s6_addr32[0] & htonl(0xfffffff0))
383 == htonl(0x20010010));
384} 384}
385 385
386/* 386/*
@@ -451,8 +451,8 @@ extern int ip6_xmit(struct sock *sk,
451extern int ip6_nd_hdr(struct sock *sk, 451extern int ip6_nd_hdr(struct sock *sk,
452 struct sk_buff *skb, 452 struct sk_buff *skb,
453 struct net_device *dev, 453 struct net_device *dev,
454 struct in6_addr *saddr, 454 const struct in6_addr *saddr,
455 struct in6_addr *daddr, 455 const struct in6_addr *daddr,
456 int proto, int len); 456 int proto, int len);
457 457
458extern int ip6_find_1stfragopt(struct sk_buff *skb, u8 **nexthdr); 458extern int ip6_find_1stfragopt(struct sk_buff *skb, u8 **nexthdr);
@@ -499,14 +499,6 @@ extern int ip6_local_out(struct sk_buff *skb);
499 * Extension header (options) processing 499 * Extension header (options) processing
500 */ 500 */
501 501
502extern u8 * ipv6_build_nfrag_opts(struct sk_buff *skb,
503 u8 *prev_hdr,
504 struct ipv6_txoptions *opt,
505 struct in6_addr *daddr,
506 u32 jumbolen);
507extern u8 * ipv6_build_frag_opts(struct sk_buff *skb,
508 u8 *prev_hdr,
509 struct ipv6_txoptions *opt);
510extern void ipv6_push_nfrag_opts(struct sk_buff *skb, 502extern void ipv6_push_nfrag_opts(struct sk_buff *skb,
511 struct ipv6_txoptions *opt, 503 struct ipv6_txoptions *opt,
512 u8 *proto, 504 u8 *proto,
@@ -545,10 +537,6 @@ extern int compat_ipv6_getsockopt(struct sock *sk,
545 char __user *optval, 537 char __user *optval,
546 int __user *optlen); 538 int __user *optlen);
547 539
548extern int ipv6_packet_init(void);
549
550extern void ipv6_packet_cleanup(void);
551
552extern int ip6_datagram_connect(struct sock *sk, 540extern int ip6_datagram_connect(struct sock *sk,
553 struct sockaddr *addr, int addr_len); 541 struct sockaddr *addr, int addr_len);
554 542
@@ -585,14 +573,14 @@ extern int ip6_mc_msfget(struct sock *sk, struct group_filter *gsf,
585 int __user *optlen); 573 int __user *optlen);
586 574
587#ifdef CONFIG_PROC_FS 575#ifdef CONFIG_PROC_FS
588extern int ac6_proc_init(void); 576extern int ac6_proc_init(struct net *net);
589extern void ac6_proc_exit(void); 577extern void ac6_proc_exit(struct net *net);
590extern int raw6_proc_init(void); 578extern int raw6_proc_init(void);
591extern void raw6_proc_exit(void); 579extern void raw6_proc_exit(void);
592extern int tcp6_proc_init(void); 580extern int tcp6_proc_init(struct net *net);
593extern void tcp6_proc_exit(void); 581extern void tcp6_proc_exit(struct net *net);
594extern int udp6_proc_init(void); 582extern int udp6_proc_init(struct net *net);
595extern void udp6_proc_exit(void); 583extern void udp6_proc_exit(struct net *net);
596extern int udplite6_proc_init(void); 584extern int udplite6_proc_init(void);
597extern void udplite6_proc_exit(void); 585extern void udplite6_proc_exit(void);
598extern int ipv6_misc_proc_init(void); 586extern int ipv6_misc_proc_init(void);
@@ -600,17 +588,11 @@ extern void ipv6_misc_proc_exit(void);
600extern int snmp6_register_dev(struct inet6_dev *idev); 588extern int snmp6_register_dev(struct inet6_dev *idev);
601extern int snmp6_unregister_dev(struct inet6_dev *idev); 589extern int snmp6_unregister_dev(struct inet6_dev *idev);
602 590
603extern struct rt6_statistics rt6_stats;
604#else 591#else
605static inline int snmp6_register_dev(struct inet6_dev *idev) 592static inline int ac6_proc_init(struct net *net) { return 0; }
606{ 593static inline void ac6_proc_exit(struct net *net) { }
607 return 0; 594static inline int snmp6_register_dev(struct inet6_dev *idev) { return 0; }
608} 595static inline int snmp6_unregister_dev(struct inet6_dev *idev) { return 0; }
609
610static inline int snmp6_unregister_dev(struct inet6_dev *idev)
611{
612 return 0;
613}
614#endif 596#endif
615 597
616#ifdef CONFIG_SYSCTL 598#ifdef CONFIG_SYSCTL
diff --git a/include/net/irda/irlan_eth.h b/include/net/irda/irlan_eth.h
index 0062347600b9..de5c81691f33 100644
--- a/include/net/irda/irlan_eth.h
+++ b/include/net/irda/irlan_eth.h
@@ -29,5 +29,4 @@ struct net_device *alloc_irlandev(const char *name);
29int irlan_eth_receive(void *instance, void *sap, struct sk_buff *skb); 29int irlan_eth_receive(void *instance, void *sap, struct sk_buff *skb);
30 30
31void irlan_eth_flow_indication( void *instance, void *sap, LOCAL_FLOW flow); 31void irlan_eth_flow_indication( void *instance, void *sap, LOCAL_FLOW flow);
32void irlan_eth_send_gratuitous_arp(struct net_device *dev);
33#endif 32#endif
diff --git a/include/net/llc_if.h b/include/net/llc_if.h
index c608812a8e89..b595a004d31b 100644
--- a/include/net/llc_if.h
+++ b/include/net/llc_if.h
@@ -74,11 +74,6 @@ static inline int llc_mac_null(const u8 *mac)
74 return is_zero_ether_addr(mac); 74 return is_zero_ether_addr(mac);
75} 75}
76 76
77static inline int llc_addrany(const struct llc_addr *addr)
78{
79 return llc_mac_null(addr->mac) && !addr->lsap;
80}
81
82static inline int llc_mac_multicast(const u8 *mac) 77static inline int llc_mac_multicast(const u8 *mac)
83{ 78{
84 return is_multicast_ether_addr(mac); 79 return is_multicast_ether_addr(mac);
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 9083bafb63ca..4a80d74975e8 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -38,7 +38,11 @@
38 * called in hardware interrupt context. The low-level driver must not call any 38 * called in hardware interrupt context. The low-level driver must not call any
39 * other functions in hardware interrupt context. If there is a need for such 39 * other functions in hardware interrupt context. If there is a need for such
40 * call, the low-level driver should first ACK the interrupt and perform the 40 * call, the low-level driver should first ACK the interrupt and perform the
41 * IEEE 802.11 code call after this, e.g. from a scheduled workqueue function. 41 * IEEE 802.11 code call after this, e.g. from a scheduled workqueue or even
42 * tasklet function.
43 *
44 * NOTE: If the driver opts to use the _irqsafe() functions, it may not also
45 * use the non-irqsafe functions!
42 */ 46 */
43 47
44/** 48/**
@@ -69,93 +73,12 @@
69 * not do so then mac80211 may add this under certain circumstances. 73 * not do so then mac80211 may add this under certain circumstances.
70 */ 74 */
71 75
72#define IEEE80211_CHAN_W_SCAN 0x00000001
73#define IEEE80211_CHAN_W_ACTIVE_SCAN 0x00000002
74#define IEEE80211_CHAN_W_IBSS 0x00000004
75
76/* Channel information structure. Low-level driver is expected to fill in chan,
77 * freq, and val fields. Other fields will be filled in by 80211.o based on
78 * hostapd information and low-level driver does not need to use them. The
79 * limits for each channel will be provided in 'struct ieee80211_conf' when
80 * configuring the low-level driver with hw->config callback. If a device has
81 * a default regulatory domain, IEEE80211_HW_DEFAULT_REG_DOMAIN_CONFIGURED
82 * can be set to let the driver configure all fields */
83struct ieee80211_channel {
84 short chan; /* channel number (IEEE 802.11) */
85 short freq; /* frequency in MHz */
86 int val; /* hw specific value for the channel */
87 int flag; /* flag for hostapd use (IEEE80211_CHAN_*) */
88 unsigned char power_level;
89 unsigned char antenna_max;
90};
91
92#define IEEE80211_RATE_ERP 0x00000001
93#define IEEE80211_RATE_BASIC 0x00000002
94#define IEEE80211_RATE_PREAMBLE2 0x00000004
95#define IEEE80211_RATE_SUPPORTED 0x00000010
96#define IEEE80211_RATE_OFDM 0x00000020
97#define IEEE80211_RATE_CCK 0x00000040
98#define IEEE80211_RATE_MANDATORY 0x00000100
99
100#define IEEE80211_RATE_CCK_2 (IEEE80211_RATE_CCK | IEEE80211_RATE_PREAMBLE2)
101#define IEEE80211_RATE_MODULATION(f) \
102 (f & (IEEE80211_RATE_CCK | IEEE80211_RATE_OFDM))
103
104/* Low-level driver should set PREAMBLE2, OFDM and CCK flags.
105 * BASIC, SUPPORTED, ERP, and MANDATORY flags are set in 80211.o based on the
106 * configuration. */
107struct ieee80211_rate {
108 int rate; /* rate in 100 kbps */
109 int val; /* hw specific value for the rate */
110 int flags; /* IEEE80211_RATE_ flags */
111 int val2; /* hw specific value for the rate when using short preamble
112 * (only when IEEE80211_RATE_PREAMBLE2 flag is set, i.e., for
113 * 2, 5.5, and 11 Mbps) */
114 signed char min_rssi_ack;
115 unsigned char min_rssi_ack_delta;
116
117 /* following fields are set by 80211.o and need not be filled by the
118 * low-level driver */
119 int rate_inv; /* inverse of the rate (LCM(all rates) / rate) for
120 * optimizing channel utilization estimates */
121};
122
123/** 76/**
124 * enum ieee80211_phymode - PHY modes 77 * enum ieee80211_notification_type - Low level driver notification
125 * 78 * @IEEE80211_NOTIFY_RE_ASSOC: start the re-association sequence
126 * @MODE_IEEE80211A: 5GHz as defined by 802.11a/802.11h
127 * @MODE_IEEE80211B: 2.4 GHz as defined by 802.11b
128 * @MODE_IEEE80211G: 2.4 GHz as defined by 802.11g (with OFDM),
129 * backwards compatible with 11b mode
130 * @NUM_IEEE80211_MODES: internal
131 */ 79 */
132enum ieee80211_phymode { 80enum ieee80211_notification_types {
133 MODE_IEEE80211A, 81 IEEE80211_NOTIFY_RE_ASSOC,
134 MODE_IEEE80211B,
135 MODE_IEEE80211G,
136
137 /* keep last */
138 NUM_IEEE80211_MODES
139};
140
141/**
142 * struct ieee80211_ht_info - describing STA's HT capabilities
143 *
144 * This structure describes most essential parameters needed
145 * to describe 802.11n HT capabilities for an STA.
146 *
147 * @ht_supported: is HT supported by STA, 0: no, 1: yes
148 * @cap: HT capabilities map as described in 802.11n spec
149 * @ampdu_factor: Maximum A-MPDU length factor
150 * @ampdu_density: Minimum A-MPDU spacing
151 * @supp_mcs_set: Supported MCS set as described in 802.11n spec
152 */
153struct ieee80211_ht_info {
154 u8 ht_supported;
155 u16 cap; /* use IEEE80211_HT_CAP_ */
156 u8 ampdu_factor;
157 u8 ampdu_density;
158 u8 supp_mcs_set[16];
159}; 82};
160 83
161/** 84/**
@@ -175,46 +98,22 @@ struct ieee80211_ht_bss_info {
175}; 98};
176 99
177/** 100/**
178 * struct ieee80211_hw_mode - PHY mode definition
179 *
180 * This structure describes the capabilities supported by the device
181 * in a single PHY mode.
182 *
183 * @list: internal
184 * @channels: pointer to array of supported channels
185 * @rates: pointer to array of supported bitrates
186 * @mode: the PHY mode for this definition
187 * @num_channels: number of supported channels
188 * @num_rates: number of supported bitrates
189 * @ht_info: PHY's 802.11n HT abilities for this mode
190 */
191struct ieee80211_hw_mode {
192 struct list_head list;
193 struct ieee80211_channel *channels;
194 struct ieee80211_rate *rates;
195 enum ieee80211_phymode mode;
196 int num_channels;
197 int num_rates;
198 struct ieee80211_ht_info ht_info;
199};
200
201/**
202 * struct ieee80211_tx_queue_params - transmit queue configuration 101 * struct ieee80211_tx_queue_params - transmit queue configuration
203 * 102 *
204 * The information provided in this structure is required for QoS 103 * The information provided in this structure is required for QoS
205 * transmit queue configuration. 104 * transmit queue configuration. Cf. IEEE 802.11 7.3.2.29.
206 * 105 *
207 * @aifs: arbitration interface space [0..255, -1: use default] 106 * @aifs: arbitration interface space [0..255, -1: use default]
208 * @cw_min: minimum contention window [will be a value of the form 107 * @cw_min: minimum contention window [will be a value of the form
209 * 2^n-1 in the range 1..1023; 0: use default] 108 * 2^n-1 in the range 1..1023; 0: use default]
210 * @cw_max: maximum contention window [like @cw_min] 109 * @cw_max: maximum contention window [like @cw_min]
211 * @burst_time: maximum burst time in units of 0.1ms, 0 meaning disabled 110 * @txop: maximum burst time in units of 32 usecs, 0 meaning disabled
212 */ 111 */
213struct ieee80211_tx_queue_params { 112struct ieee80211_tx_queue_params {
214 int aifs; 113 s16 aifs;
215 int cw_min; 114 u16 cw_min;
216 int cw_max; 115 u16 cw_max;
217 int burst_time; 116 u16 txop;
218}; 117};
219 118
220/** 119/**
@@ -246,6 +145,7 @@ struct ieee80211_tx_queue_stats_data {
246 * @IEEE80211_TX_QUEUE_AFTER_BEACON: transmit queue for frames to be 145 * @IEEE80211_TX_QUEUE_AFTER_BEACON: transmit queue for frames to be
247 * sent after a beacon 146 * sent after a beacon
248 * @IEEE80211_TX_QUEUE_BEACON: transmit queue for beacon frames 147 * @IEEE80211_TX_QUEUE_BEACON: transmit queue for beacon frames
148 * @NUM_TX_DATA_QUEUES_AMPDU: adding more queues for A-MPDU
249 */ 149 */
250enum ieee80211_tx_queue { 150enum ieee80211_tx_queue {
251 IEEE80211_TX_QUEUE_DATA0, 151 IEEE80211_TX_QUEUE_DATA0,
@@ -261,11 +161,12 @@ enum ieee80211_tx_queue {
261 * this struct need to have fixed values. As soon as it is removed, we can 161 * this struct need to have fixed values. As soon as it is removed, we can
262 * fix these entries. */ 162 * fix these entries. */
263 IEEE80211_TX_QUEUE_AFTER_BEACON = 6, 163 IEEE80211_TX_QUEUE_AFTER_BEACON = 6,
264 IEEE80211_TX_QUEUE_BEACON = 7 164 IEEE80211_TX_QUEUE_BEACON = 7,
165 NUM_TX_DATA_QUEUES_AMPDU = 16
265}; 166};
266 167
267struct ieee80211_tx_queue_stats { 168struct ieee80211_tx_queue_stats {
268 struct ieee80211_tx_queue_stats_data data[NUM_TX_DATA_QUEUES]; 169 struct ieee80211_tx_queue_stats_data data[NUM_TX_DATA_QUEUES_AMPDU];
269}; 170};
270 171
271struct ieee80211_low_level_stats { 172struct ieee80211_low_level_stats {
@@ -285,11 +186,13 @@ struct ieee80211_low_level_stats {
285 * also implies a change in the AID. 186 * also implies a change in the AID.
286 * @BSS_CHANGED_ERP_CTS_PROT: CTS protection changed 187 * @BSS_CHANGED_ERP_CTS_PROT: CTS protection changed
287 * @BSS_CHANGED_ERP_PREAMBLE: preamble changed 188 * @BSS_CHANGED_ERP_PREAMBLE: preamble changed
189 * @BSS_CHANGED_HT: 802.11n parameters changed
288 */ 190 */
289enum ieee80211_bss_change { 191enum ieee80211_bss_change {
290 BSS_CHANGED_ASSOC = 1<<0, 192 BSS_CHANGED_ASSOC = 1<<0,
291 BSS_CHANGED_ERP_CTS_PROT = 1<<1, 193 BSS_CHANGED_ERP_CTS_PROT = 1<<1,
292 BSS_CHANGED_ERP_PREAMBLE = 1<<2, 194 BSS_CHANGED_ERP_PREAMBLE = 1<<2,
195 BSS_CHANGED_HT = 1<<4,
293}; 196};
294 197
295/** 198/**
@@ -302,6 +205,12 @@ enum ieee80211_bss_change {
302 * @aid: association ID number, valid only when @assoc is true 205 * @aid: association ID number, valid only when @assoc is true
303 * @use_cts_prot: use CTS protection 206 * @use_cts_prot: use CTS protection
304 * @use_short_preamble: use 802.11b short preamble 207 * @use_short_preamble: use 802.11b short preamble
208 * @timestamp: beacon timestamp
209 * @beacon_int: beacon interval
210 * @assoc_capability: capabbilities taken from assoc resp
211 * @assoc_ht: association in HT mode
212 * @ht_conf: ht capabilities
213 * @ht_bss_conf: ht extended capabilities
305 */ 214 */
306struct ieee80211_bss_conf { 215struct ieee80211_bss_conf {
307 /* association related data */ 216 /* association related data */
@@ -310,6 +219,69 @@ struct ieee80211_bss_conf {
310 /* erp related data */ 219 /* erp related data */
311 bool use_cts_prot; 220 bool use_cts_prot;
312 bool use_short_preamble; 221 bool use_short_preamble;
222 u16 beacon_int;
223 u16 assoc_capability;
224 u64 timestamp;
225 /* ht related data */
226 bool assoc_ht;
227 struct ieee80211_ht_info *ht_conf;
228 struct ieee80211_ht_bss_info *ht_bss_conf;
229};
230
231/**
232 * enum mac80211_tx_control_flags - flags to describe Tx configuration for
233 * the Tx frame
234 *
235 * These flags are used with the @flags member of &ieee80211_tx_control
236 *
237 * @IEEE80211_TXCTL_REQ_TX_STATUS: request TX status callback for this frame.
238 * @IEEE80211_TXCTL_DO_NOT_ENCRYPT: send this frame without encryption;
239 * e.g., for EAPOL frame
240 * @IEEE80211_TXCTL_USE_RTS_CTS: use RTS-CTS before sending frame
241 * @IEEE80211_TXCTL_USE_CTS_PROTECT: use CTS protection for the frame (e.g.,
242 * for combined 802.11g / 802.11b networks)
243 * @IEEE80211_TXCTL_NO_ACK: tell the low level not to wait for an ack
244 * @IEEE80211_TXCTL_RATE_CTRL_PROBE
245 * @EEE80211_TXCTL_CLEAR_PS_FILT: clear powersave filter
246 * for destination station
247 * @IEEE80211_TXCTL_REQUEUE:
248 * @IEEE80211_TXCTL_FIRST_FRAGMENT: this is a first fragment of the frame
249 * @IEEE80211_TXCTL_LONG_RETRY_LIMIT: this frame should be send using the
250 * through set_retry_limit configured long
251 * retry value
252 * @IEEE80211_TXCTL_EAPOL_FRAME: internal to mac80211
253 * @IEEE80211_TXCTL_SEND_AFTER_DTIM: send this frame after DTIM beacon
254 * @IEEE80211_TXCTL_AMPDU: this frame should be sent as part of an A-MPDU
255 * @IEEE80211_TXCTL_OFDM_HT: this frame can be sent in HT OFDM rates. number
256 * of streams when this flag is on can be extracted
257 * from antenna_sel_tx, so if 1 antenna is marked
258 * use SISO, 2 antennas marked use MIMO, n antennas
259 * marked use MIMO_n.
260 * @IEEE80211_TXCTL_GREEN_FIELD: use green field protection for this frame
261 * @IEEE80211_TXCTL_40_MHZ_WIDTH: send this frame using 40 Mhz channel width
262 * @IEEE80211_TXCTL_DUP_DATA: duplicate data frame on both 20 Mhz channels
263 * @IEEE80211_TXCTL_SHORT_GI: send this frame using short guard interval
264 */
265enum mac80211_tx_control_flags {
266 IEEE80211_TXCTL_REQ_TX_STATUS = (1<<0),
267 IEEE80211_TXCTL_DO_NOT_ENCRYPT = (1<<1),
268 IEEE80211_TXCTL_USE_RTS_CTS = (1<<2),
269 IEEE80211_TXCTL_USE_CTS_PROTECT = (1<<3),
270 IEEE80211_TXCTL_NO_ACK = (1<<4),
271 IEEE80211_TXCTL_RATE_CTRL_PROBE = (1<<5),
272 IEEE80211_TXCTL_CLEAR_PS_FILT = (1<<6),
273 IEEE80211_TXCTL_REQUEUE = (1<<7),
274 IEEE80211_TXCTL_FIRST_FRAGMENT = (1<<8),
275 IEEE80211_TXCTL_SHORT_PREAMBLE = (1<<9),
276 IEEE80211_TXCTL_LONG_RETRY_LIMIT = (1<<10),
277 IEEE80211_TXCTL_EAPOL_FRAME = (1<<11),
278 IEEE80211_TXCTL_SEND_AFTER_DTIM = (1<<12),
279 IEEE80211_TXCTL_AMPDU = (1<<13),
280 IEEE80211_TXCTL_OFDM_HT = (1<<14),
281 IEEE80211_TXCTL_GREEN_FIELD = (1<<15),
282 IEEE80211_TXCTL_40_MHZ_WIDTH = (1<<16),
283 IEEE80211_TXCTL_DUP_DATA = (1<<17),
284 IEEE80211_TXCTL_SHORT_GI = (1<<18),
313}; 285};
314 286
315/* Transmit control fields. This data structure is passed to low-level driver 287/* Transmit control fields. This data structure is passed to low-level driver
@@ -318,57 +290,27 @@ struct ieee80211_bss_conf {
318 290
319struct ieee80211_tx_control { 291struct ieee80211_tx_control {
320 struct ieee80211_vif *vif; 292 struct ieee80211_vif *vif;
321 int tx_rate; /* Transmit rate, given as the hw specific value for the 293 struct ieee80211_rate *tx_rate;
322 * rate (from struct ieee80211_rate) */ 294
323 int rts_cts_rate; /* Transmit rate for RTS/CTS frame, given as the hw 295 /* Transmit rate for RTS/CTS frame */
324 * specific value for the rate (from 296 struct ieee80211_rate *rts_cts_rate;
325 * struct ieee80211_rate) */ 297
326 298 /* retry rate for the last retries */
327#define IEEE80211_TXCTL_REQ_TX_STATUS (1<<0)/* request TX status callback for 299 struct ieee80211_rate *alt_retry_rate;
328 * this frame */ 300
329#define IEEE80211_TXCTL_DO_NOT_ENCRYPT (1<<1) /* send this frame without 301 u32 flags; /* tx control flags defined above */
330 * encryption; e.g., for EAPOL
331 * frames */
332#define IEEE80211_TXCTL_USE_RTS_CTS (1<<2) /* use RTS-CTS before sending
333 * frame */
334#define IEEE80211_TXCTL_USE_CTS_PROTECT (1<<3) /* use CTS protection for the
335 * frame (e.g., for combined
336 * 802.11g / 802.11b networks) */
337#define IEEE80211_TXCTL_NO_ACK (1<<4) /* tell the low level not to
338 * wait for an ack */
339#define IEEE80211_TXCTL_RATE_CTRL_PROBE (1<<5)
340#define IEEE80211_TXCTL_CLEAR_DST_MASK (1<<6)
341#define IEEE80211_TXCTL_REQUEUE (1<<7)
342#define IEEE80211_TXCTL_FIRST_FRAGMENT (1<<8) /* this is a first fragment of
343 * the frame */
344#define IEEE80211_TXCTL_LONG_RETRY_LIMIT (1<<10) /* this frame should be send
345 * using the through
346 * set_retry_limit configured
347 * long retry value */
348#define IEEE80211_TXCTL_EAPOL_FRAME (1<<11) /* internal to mac80211 */
349#define IEEE80211_TXCTL_SEND_AFTER_DTIM (1<<12) /* send this frame after DTIM
350 * beacon */
351 u32 flags; /* tx control flags defined
352 * above */
353 u8 key_idx; /* keyidx from hw->set_key(), undefined if 302 u8 key_idx; /* keyidx from hw->set_key(), undefined if
354 * IEEE80211_TXCTL_DO_NOT_ENCRYPT is set */ 303 * IEEE80211_TXCTL_DO_NOT_ENCRYPT is set */
355 u8 retry_limit; /* 1 = only first attempt, 2 = one retry, .. 304 u8 retry_limit; /* 1 = only first attempt, 2 = one retry, ..
356 * This could be used when set_retry_limit 305 * This could be used when set_retry_limit
357 * is not implemented by the driver */ 306 * is not implemented by the driver */
358 u8 power_level; /* per-packet transmit power level, in dBm */ 307 u8 antenna_sel_tx; /* 0 = default/diversity, otherwise bit
359 u8 antenna_sel_tx; /* 0 = default/diversity, 1 = Ant0, 2 = Ant1 */ 308 * position represents antenna number used */
360 u8 icv_len; /* length of the ICV/MIC field in octets */ 309 u8 icv_len; /* length of the ICV/MIC field in octets */
361 u8 iv_len; /* length of the IV field in octets */ 310 u8 iv_len; /* length of the IV field in octets */
362 u8 queue; /* hardware queue to use for this frame; 311 u8 queue; /* hardware queue to use for this frame;
363 * 0 = highest, hw->queues-1 = lowest */ 312 * 0 = highest, hw->queues-1 = lowest */
364 struct ieee80211_rate *rate; /* internal 80211.o rate */ 313 u16 aid; /* Station AID */
365 struct ieee80211_rate *rts_rate; /* internal 80211.o rate
366 * for RTS/CTS */
367 int alt_retry_rate; /* retry rate for the last retries, given as the
368 * hw specific value for the rate (from
369 * struct ieee80211_rate). To be used to limit
370 * packet dropping when probing higher rates, if hw
371 * supports multiple retry rates. -1 = not used */
372 int type; /* internal */ 314 int type; /* internal */
373}; 315};
374 316
@@ -391,7 +333,8 @@ struct ieee80211_tx_control {
391 * @RX_FLAG_FAILED_PLCP_CRC: Set this flag if the PCLP check failed on 333 * @RX_FLAG_FAILED_PLCP_CRC: Set this flag if the PCLP check failed on
392 * the frame. 334 * the frame.
393 * @RX_FLAG_TSFT: The timestamp passed in the RX status (@mactime field) 335 * @RX_FLAG_TSFT: The timestamp passed in the RX status (@mactime field)
394 * is valid. 336 * is valid. This is useful in monitor mode and necessary for beacon frames
337 * to enable IBSS merging.
395 */ 338 */
396enum mac80211_rx_flags { 339enum mac80211_rx_flags {
397 RX_FLAG_MMIC_ERROR = 1<<0, 340 RX_FLAG_MMIC_ERROR = 1<<0,
@@ -410,27 +353,26 @@ enum mac80211_rx_flags {
410 * The low-level driver should provide this information (the subset 353 * The low-level driver should provide this information (the subset
411 * supported by hardware) to the 802.11 code with each received 354 * supported by hardware) to the 802.11 code with each received
412 * frame. 355 * frame.
413 * @mactime: MAC timestamp as defined by 802.11 356 * @mactime: value in microseconds of the 64-bit Time Synchronization Function
357 * (TSF) timer when the first data symbol (MPDU) arrived at the hardware.
358 * @band: the active band when this frame was received
414 * @freq: frequency the radio was tuned to when receiving this frame, in MHz 359 * @freq: frequency the radio was tuned to when receiving this frame, in MHz
415 * @channel: channel the radio was tuned to
416 * @phymode: active PHY mode
417 * @ssi: signal strength when receiving this frame 360 * @ssi: signal strength when receiving this frame
418 * @signal: used as 'qual' in statistics reporting 361 * @signal: used as 'qual' in statistics reporting
419 * @noise: PHY noise when receiving this frame 362 * @noise: PHY noise when receiving this frame
420 * @antenna: antenna used 363 * @antenna: antenna used
421 * @rate: data rate 364 * @rate_idx: index of data rate into band's supported rates
422 * @flag: %RX_FLAG_* 365 * @flag: %RX_FLAG_*
423 */ 366 */
424struct ieee80211_rx_status { 367struct ieee80211_rx_status {
425 u64 mactime; 368 u64 mactime;
369 enum ieee80211_band band;
426 int freq; 370 int freq;
427 int channel;
428 enum ieee80211_phymode phymode;
429 int ssi; 371 int ssi;
430 int signal; 372 int signal;
431 int noise; 373 int noise;
432 int antenna; 374 int antenna;
433 int rate; 375 int rate_idx;
434 int flag; 376 int flag;
435}; 377};
436 378
@@ -441,12 +383,14 @@ struct ieee80211_rx_status {
441 * 383 *
442 * @IEEE80211_TX_STATUS_TX_FILTERED: The frame was not transmitted 384 * @IEEE80211_TX_STATUS_TX_FILTERED: The frame was not transmitted
443 * because the destination STA was in powersave mode. 385 * because the destination STA was in powersave mode.
444 *
445 * @IEEE80211_TX_STATUS_ACK: Frame was acknowledged 386 * @IEEE80211_TX_STATUS_ACK: Frame was acknowledged
387 * @IEEE80211_TX_STATUS_AMPDU: The frame was aggregated, so status
388 * is for the whole aggregation.
446 */ 389 */
447enum ieee80211_tx_status_flags { 390enum ieee80211_tx_status_flags {
448 IEEE80211_TX_STATUS_TX_FILTERED = 1<<0, 391 IEEE80211_TX_STATUS_TX_FILTERED = 1<<0,
449 IEEE80211_TX_STATUS_ACK = 1<<1, 392 IEEE80211_TX_STATUS_ACK = 1<<1,
393 IEEE80211_TX_STATUS_AMPDU = 1<<2,
450}; 394};
451 395
452/** 396/**
@@ -457,24 +401,25 @@ enum ieee80211_tx_status_flags {
457 * 401 *
458 * @control: a copy of the &struct ieee80211_tx_control passed to the driver 402 * @control: a copy of the &struct ieee80211_tx_control passed to the driver
459 * in the tx() callback. 403 * in the tx() callback.
460 *
461 * @flags: transmit status flags, defined above 404 * @flags: transmit status flags, defined above
462 * 405 * @retry_count: number of retries
463 * @ack_signal: signal strength of the ACK frame
464 *
465 * @excessive_retries: set to 1 if the frame was retried many times 406 * @excessive_retries: set to 1 if the frame was retried many times
466 * but not acknowledged 407 * but not acknowledged
467 * 408 * @ampdu_ack_len: number of aggregated frames.
468 * @retry_count: number of retries 409 * relevant only if IEEE80211_TX_STATUS_AMPDU was set.
469 * 410 * @ampdu_ack_map: block ack bit map for the aggregation.
411 * relevant only if IEEE80211_TX_STATUS_AMPDU was set.
412 * @ack_signal: signal strength of the ACK frame
470 * @queue_length: ?? REMOVE 413 * @queue_length: ?? REMOVE
471 * @queue_number: ?? REMOVE 414 * @queue_number: ?? REMOVE
472 */ 415 */
473struct ieee80211_tx_status { 416struct ieee80211_tx_status {
474 struct ieee80211_tx_control control; 417 struct ieee80211_tx_control control;
475 u8 flags; 418 u8 flags;
476 bool excessive_retries;
477 u8 retry_count; 419 u8 retry_count;
420 bool excessive_retries;
421 u8 ampdu_ack_len;
422 u64 ampdu_ack_map;
478 int ack_signal; 423 int ack_signal;
479 int queue_length; 424 int queue_length;
480 int queue_number; 425 int queue_number;
@@ -502,41 +447,29 @@ enum ieee80211_conf_flags {
502 * 447 *
503 * @radio_enabled: when zero, driver is required to switch off the radio. 448 * @radio_enabled: when zero, driver is required to switch off the radio.
504 * TODO make a flag 449 * TODO make a flag
505 * @channel: IEEE 802.11 channel number
506 * @freq: frequency in MHz
507 * @channel_val: hardware specific channel value for the channel
508 * @phymode: PHY mode to activate (REMOVE)
509 * @chan: channel to switch to, pointer to the channel information
510 * @mode: pointer to mode definition
511 * @regulatory_domain: ??
512 * @beacon_int: beacon interval (TODO make interface config) 450 * @beacon_int: beacon interval (TODO make interface config)
513 * @flags: configuration flags defined above 451 * @flags: configuration flags defined above
514 * @power_level: transmit power limit for current regulatory domain in dBm 452 * @power_level: requested transmit power (in dBm)
515 * @antenna_max: maximum antenna gain 453 * @max_antenna_gain: maximum antenna gain (in dBi)
516 * @antenna_sel_tx: transmit antenna selection, 0: default/diversity, 454 * @antenna_sel_tx: transmit antenna selection, 0: default/diversity,
517 * 1/2: antenna 0/1 455 * 1/2: antenna 0/1
518 * @antenna_sel_rx: receive antenna selection, like @antenna_sel_tx 456 * @antenna_sel_rx: receive antenna selection, like @antenna_sel_tx
519 * @ht_conf: describes current self configuration of 802.11n HT capabilies 457 * @ht_conf: describes current self configuration of 802.11n HT capabilies
520 * @ht_bss_conf: describes current BSS configuration of 802.11n HT parameters 458 * @ht_bss_conf: describes current BSS configuration of 802.11n HT parameters
459 * @channel: the channel to tune to
521 */ 460 */
522struct ieee80211_conf { 461struct ieee80211_conf {
523 int channel; /* IEEE 802.11 channel number */
524 int freq; /* MHz */
525 int channel_val; /* hw specific value for the channel */
526
527 enum ieee80211_phymode phymode;
528 struct ieee80211_channel *chan;
529 struct ieee80211_hw_mode *mode;
530 unsigned int regulatory_domain;
531 int radio_enabled; 462 int radio_enabled;
532 463
533 int beacon_int; 464 int beacon_int;
534 u32 flags; 465 u32 flags;
535 u8 power_level; 466 int power_level;
536 u8 antenna_max; 467 int max_antenna_gain;
537 u8 antenna_sel_tx; 468 u8 antenna_sel_tx;
538 u8 antenna_sel_rx; 469 u8 antenna_sel_rx;
539 470
471 struct ieee80211_channel *channel;
472
540 struct ieee80211_ht_info ht_conf; 473 struct ieee80211_ht_info ht_conf;
541 struct ieee80211_ht_bss_info ht_bss_conf; 474 struct ieee80211_ht_bss_info ht_bss_conf;
542}; 475};
@@ -555,12 +488,14 @@ struct ieee80211_conf {
555 * @IEEE80211_IF_TYPE_WDS: interface in WDS mode. 488 * @IEEE80211_IF_TYPE_WDS: interface in WDS mode.
556 * @IEEE80211_IF_TYPE_VLAN: VLAN interface bound to an AP, drivers 489 * @IEEE80211_IF_TYPE_VLAN: VLAN interface bound to an AP, drivers
557 * will never see this type. 490 * will never see this type.
491 * @IEEE80211_IF_TYPE_MESH_POINT: 802.11s mesh point
558 */ 492 */
559enum ieee80211_if_types { 493enum ieee80211_if_types {
560 IEEE80211_IF_TYPE_INVALID, 494 IEEE80211_IF_TYPE_INVALID,
561 IEEE80211_IF_TYPE_AP, 495 IEEE80211_IF_TYPE_AP,
562 IEEE80211_IF_TYPE_STA, 496 IEEE80211_IF_TYPE_STA,
563 IEEE80211_IF_TYPE_IBSS, 497 IEEE80211_IF_TYPE_IBSS,
498 IEEE80211_IF_TYPE_MESH_POINT,
564 IEEE80211_IF_TYPE_MNTR, 499 IEEE80211_IF_TYPE_MNTR,
565 IEEE80211_IF_TYPE_WDS, 500 IEEE80211_IF_TYPE_WDS,
566 IEEE80211_IF_TYPE_VLAN, 501 IEEE80211_IF_TYPE_VLAN,
@@ -582,6 +517,14 @@ struct ieee80211_vif {
582 u8 drv_priv[0] __attribute__((__aligned__(sizeof(void *)))); 517 u8 drv_priv[0] __attribute__((__aligned__(sizeof(void *))));
583}; 518};
584 519
520static inline bool ieee80211_vif_is_mesh(struct ieee80211_vif *vif)
521{
522#ifdef CONFIG_MAC80211_MESH
523 return vif->type == IEEE80211_IF_TYPE_MESH_POINT;
524#endif
525 return false;
526}
527
585/** 528/**
586 * struct ieee80211_if_init_conf - initial configuration of an interface 529 * struct ieee80211_if_init_conf - initial configuration of an interface
587 * 530 *
@@ -725,6 +668,21 @@ enum sta_notify_cmd {
725}; 668};
726 669
727/** 670/**
671 * enum ieee80211_tkip_key_type - get tkip key
672 *
673 * Used by drivers which need to get a tkip key for skb. Some drivers need a
674 * phase 1 key, others need a phase 2 key. A single function allows the driver
675 * to get the key, this enum indicates what type of key is required.
676 *
677 * @IEEE80211_TKIP_P1_KEY: the driver needs a phase 1 key
678 * @IEEE80211_TKIP_P2_KEY: the driver needs a phase 2 key
679 */
680enum ieee80211_tkip_key_type {
681 IEEE80211_TKIP_P1_KEY,
682 IEEE80211_TKIP_P2_KEY,
683};
684
685/**
728 * enum ieee80211_hw_flags - hardware flags 686 * enum ieee80211_hw_flags - hardware flags
729 * 687 *
730 * These flags are used to indicate hardware capabilities to 688 * These flags are used to indicate hardware capabilities to
@@ -757,15 +715,19 @@ enum sta_notify_cmd {
757 * %IEEE80211_HW_HOST_GEN_BEACON_TEMPLATE is also not set because 715 * %IEEE80211_HW_HOST_GEN_BEACON_TEMPLATE is also not set because
758 * otherwise the stack will not know when the DTIM beacon was sent. 716 * otherwise the stack will not know when the DTIM beacon was sent.
759 * 717 *
760 * @IEEE80211_HW_DEFAULT_REG_DOMAIN_CONFIGURED: 718 * @IEEE80211_HW_2GHZ_SHORT_SLOT_INCAPABLE:
761 * Channels are already configured to the default regulatory domain 719 * Hardware is not capable of short slot operation on the 2.4 GHz band.
762 * specified in the device's EEPROM 720 *
721 * @IEEE80211_HW_2GHZ_SHORT_PREAMBLE_INCAPABLE:
722 * Hardware is not capable of receiving frames with short preamble on
723 * the 2.4 GHz band.
763 */ 724 */
764enum ieee80211_hw_flags { 725enum ieee80211_hw_flags {
765 IEEE80211_HW_HOST_GEN_BEACON_TEMPLATE = 1<<0, 726 IEEE80211_HW_HOST_GEN_BEACON_TEMPLATE = 1<<0,
766 IEEE80211_HW_RX_INCLUDES_FCS = 1<<1, 727 IEEE80211_HW_RX_INCLUDES_FCS = 1<<1,
767 IEEE80211_HW_HOST_BROADCAST_PS_BUFFERING = 1<<2, 728 IEEE80211_HW_HOST_BROADCAST_PS_BUFFERING = 1<<2,
768 IEEE80211_HW_DEFAULT_REG_DOMAIN_CONFIGURED = 1<<3, 729 IEEE80211_HW_2GHZ_SHORT_SLOT_INCAPABLE = 1<<3,
730 IEEE80211_HW_2GHZ_SHORT_PREAMBLE_INCAPABLE = 1<<4,
769}; 731};
770 732
771/** 733/**
@@ -777,7 +739,8 @@ enum ieee80211_hw_flags {
777 * @wiphy: This points to the &struct wiphy allocated for this 739 * @wiphy: This points to the &struct wiphy allocated for this
778 * 802.11 PHY. You must fill in the @perm_addr and @dev 740 * 802.11 PHY. You must fill in the @perm_addr and @dev
779 * members of this structure using SET_IEEE80211_DEV() 741 * members of this structure using SET_IEEE80211_DEV()
780 * and SET_IEEE80211_PERM_ADDR(). 742 * and SET_IEEE80211_PERM_ADDR(). Additionally, all supported
743 * bands (with channels, bitrates) are registered here.
781 * 744 *
782 * @conf: &struct ieee80211_conf, device configuration, don't use. 745 * @conf: &struct ieee80211_conf, device configuration, don't use.
783 * 746 *
@@ -888,6 +851,16 @@ static inline void SET_IEEE80211_PERM_ADDR(struct ieee80211_hw *hw, u8 *addr)
888 * parameter is guaranteed to be valid until another call to set_key() 851 * parameter is guaranteed to be valid until another call to set_key()
889 * removes it, but it can only be used as a cookie to differentiate 852 * removes it, but it can only be used as a cookie to differentiate
890 * keys. 853 * keys.
854 *
855 * In TKIP some HW need to be provided a phase 1 key, for RX decryption
856 * acceleration (i.e. iwlwifi). Those drivers should provide update_tkip_key
857 * handler.
858 * The update_tkip_key() call updates the driver with the new phase 1 key.
859 * This happens everytime the iv16 wraps around (every 65536 packets). The
860 * set_key() call will happen only once for each key (unless the AP did
861 * rekeying), it will not include a valid phase 1 key. The valid phase 1 key is
862 * provided by udpate_tkip_key only. The trigger that makes mac80211 call this
863 * handler is software decryption with wrap around of iv16.
891 */ 864 */
892 865
893/** 866/**
@@ -913,8 +886,18 @@ static inline void SET_IEEE80211_PERM_ADDR(struct ieee80211_hw *hw, u8 *addr)
913 * parameter to see whether multicast frames should be accepted 886 * parameter to see whether multicast frames should be accepted
914 * or dropped. 887 * or dropped.
915 * 888 *
916 * All unsupported flags in @total_flags must be cleared, i.e. you 889 * All unsupported flags in @total_flags must be cleared.
917 * should clear all bits except those you honoured. 890 * Hardware does not support a flag if it is incapable of _passing_
891 * the frame to the stack. Otherwise the driver must ignore
892 * the flag, but not clear it.
893 * You must _only_ clear the flag (announce no support for the
894 * flag to mac80211) if you are not able to pass the packet type
895 * to the stack (so the hardware always filters it).
896 * So for example, you should clear @FIF_CONTROL, if your hardware
897 * always filters control frames. If your hardware always passes
898 * control frames to the kernel and is incapable of filtering them,
899 * you do _not_ clear the @FIF_CONTROL flag.
900 * This rule applies to all other FIF flags as well.
918 */ 901 */
919 902
920/** 903/**
@@ -967,10 +950,14 @@ enum ieee80211_filter_flags {
967 * &struct ieee80211_ops to indicate which action is needed. 950 * &struct ieee80211_ops to indicate which action is needed.
968 * @IEEE80211_AMPDU_RX_START: start Rx aggregation 951 * @IEEE80211_AMPDU_RX_START: start Rx aggregation
969 * @IEEE80211_AMPDU_RX_STOP: stop Rx aggregation 952 * @IEEE80211_AMPDU_RX_STOP: stop Rx aggregation
953 * @IEEE80211_AMPDU_TX_START: start Tx aggregation
954 * @IEEE80211_AMPDU_TX_STOP: stop Tx aggregation
970 */ 955 */
971enum ieee80211_ampdu_mlme_action { 956enum ieee80211_ampdu_mlme_action {
972 IEEE80211_AMPDU_RX_START, 957 IEEE80211_AMPDU_RX_START,
973 IEEE80211_AMPDU_RX_STOP, 958 IEEE80211_AMPDU_RX_STOP,
959 IEEE80211_AMPDU_TX_START,
960 IEEE80211_AMPDU_TX_STOP,
974}; 961};
975 962
976/** 963/**
@@ -1033,8 +1020,7 @@ enum ieee80211_ampdu_mlme_action {
1033 * level driver (e.g. assoc/disassoc status, erp parameters). 1020 * level driver (e.g. assoc/disassoc status, erp parameters).
1034 * This function should not be used if no BSS has been set, unless 1021 * This function should not be used if no BSS has been set, unless
1035 * for association indication. The @changed parameter indicates which 1022 * for association indication. The @changed parameter indicates which
1036 * of the bss parameters has changed when a call is made. This callback 1023 * of the bss parameters has changed when a call is made.
1037 * has to be atomic.
1038 * 1024 *
1039 * @configure_filter: Configure the device's RX filter. 1025 * @configure_filter: Configure the device's RX filter.
1040 * See the section "Frame filtering" for more information. 1026 * See the section "Frame filtering" for more information.
@@ -1050,8 +1036,14 @@ enum ieee80211_ampdu_mlme_action {
1050 * and remove_interface calls, i.e. while the interface with the 1036 * and remove_interface calls, i.e. while the interface with the
1051 * given local_address is enabled. 1037 * given local_address is enabled.
1052 * 1038 *
1039 * @update_tkip_key: See the section "Hardware crypto acceleration"
1040 * This callback will be called in the context of Rx. Called for drivers
1041 * which set IEEE80211_KEY_FLAG_TKIP_REQ_RX_P1_KEY.
1042 *
1053 * @hw_scan: Ask the hardware to service the scan request, no need to start 1043 * @hw_scan: Ask the hardware to service the scan request, no need to start
1054 * the scan state machine in stack. 1044 * the scan state machine in stack. The scan must honour the channel
1045 * configuration done by the regulatory agent in the wiphy's registered
1046 * bands.
1055 * 1047 *
1056 * @get_stats: return low-level statistics 1048 * @get_stats: return low-level statistics
1057 * 1049 *
@@ -1111,7 +1103,8 @@ enum ieee80211_ampdu_mlme_action {
1111 * The RA/TID combination determines the destination and TID we want 1103 * The RA/TID combination determines the destination and TID we want
1112 * the ampdu action to be performed for. The action is defined through 1104 * the ampdu action to be performed for. The action is defined through
1113 * ieee80211_ampdu_mlme_action. Starting sequence number (@ssn) 1105 * ieee80211_ampdu_mlme_action. Starting sequence number (@ssn)
1114 * is the first frame we expect to perform the action on. 1106 * is the first frame we expect to perform the action on. notice
1107 * that TX/RX_STOP can pass NULL for this parameter.
1115 */ 1108 */
1116struct ieee80211_ops { 1109struct ieee80211_ops {
1117 int (*tx)(struct ieee80211_hw *hw, struct sk_buff *skb, 1110 int (*tx)(struct ieee80211_hw *hw, struct sk_buff *skb,
@@ -1138,6 +1131,9 @@ struct ieee80211_ops {
1138 int (*set_key)(struct ieee80211_hw *hw, enum set_key_cmd cmd, 1131 int (*set_key)(struct ieee80211_hw *hw, enum set_key_cmd cmd,
1139 const u8 *local_address, const u8 *address, 1132 const u8 *local_address, const u8 *address,
1140 struct ieee80211_key_conf *key); 1133 struct ieee80211_key_conf *key);
1134 void (*update_tkip_key)(struct ieee80211_hw *hw,
1135 struct ieee80211_key_conf *conf, const u8 *address,
1136 u32 iv32, u16 *phase1key);
1141 int (*hw_scan)(struct ieee80211_hw *hw, u8 *ssid, size_t len); 1137 int (*hw_scan)(struct ieee80211_hw *hw, u8 *ssid, size_t len);
1142 int (*get_stats)(struct ieee80211_hw *hw, 1138 int (*get_stats)(struct ieee80211_hw *hw,
1143 struct ieee80211_low_level_stats *stats); 1139 struct ieee80211_low_level_stats *stats);
@@ -1159,10 +1155,9 @@ struct ieee80211_ops {
1159 struct sk_buff *skb, 1155 struct sk_buff *skb,
1160 struct ieee80211_tx_control *control); 1156 struct ieee80211_tx_control *control);
1161 int (*tx_last_beacon)(struct ieee80211_hw *hw); 1157 int (*tx_last_beacon)(struct ieee80211_hw *hw);
1162 int (*conf_ht)(struct ieee80211_hw *hw, struct ieee80211_conf *conf);
1163 int (*ampdu_action)(struct ieee80211_hw *hw, 1158 int (*ampdu_action)(struct ieee80211_hw *hw,
1164 enum ieee80211_ampdu_mlme_action action, 1159 enum ieee80211_ampdu_mlme_action action,
1165 const u8 *ra, u16 tid, u16 ssn); 1160 const u8 *addr, u16 tid, u16 *ssn);
1166}; 1161};
1167 1162
1168/** 1163/**
@@ -1183,8 +1178,9 @@ struct ieee80211_hw *ieee80211_alloc_hw(size_t priv_data_len,
1183/** 1178/**
1184 * ieee80211_register_hw - Register hardware device 1179 * ieee80211_register_hw - Register hardware device
1185 * 1180 *
1186 * You must call this function before any other functions 1181 * You must call this function before any other functions in
1187 * except ieee80211_register_hwmode. 1182 * mac80211. Note that before a hardware can be registered, you
1183 * need to fill the contained wiphy's information.
1188 * 1184 *
1189 * @hw: the device to register as returned by ieee80211_alloc_hw() 1185 * @hw: the device to register as returned by ieee80211_alloc_hw()
1190 */ 1186 */
@@ -1272,10 +1268,6 @@ static inline char *ieee80211_get_radio_led_name(struct ieee80211_hw *hw)
1272#endif 1268#endif
1273} 1269}
1274 1270
1275/* Register a new hardware PHYMODE capability to the stack. */
1276int ieee80211_register_hwmode(struct ieee80211_hw *hw,
1277 struct ieee80211_hw_mode *mode);
1278
1279/** 1271/**
1280 * ieee80211_unregister_hw - Unregister a hardware device 1272 * ieee80211_unregister_hw - Unregister a hardware device
1281 * 1273 *
@@ -1308,7 +1300,10 @@ void __ieee80211_rx(struct ieee80211_hw *hw, struct sk_buff *skb,
1308 * buffer in @skb must start with an IEEE 802.11 header or a radiotap 1300 * buffer in @skb must start with an IEEE 802.11 header or a radiotap
1309 * header if %RX_FLAG_RADIOTAP is set in the @status flags. 1301 * header if %RX_FLAG_RADIOTAP is set in the @status flags.
1310 * 1302 *
1311 * This function may not be called in IRQ context. 1303 * This function may not be called in IRQ context. Calls to this function
1304 * for a single hardware must be synchronized against each other. Calls
1305 * to this function and ieee80211_rx_irqsafe() may not be mixed for a
1306 * single hardware.
1312 * 1307 *
1313 * @hw: the hardware this frame came in on 1308 * @hw: the hardware this frame came in on
1314 * @skb: the buffer to receive, owned by mac80211 after this call 1309 * @skb: the buffer to receive, owned by mac80211 after this call
@@ -1325,7 +1320,10 @@ static inline void ieee80211_rx(struct ieee80211_hw *hw, struct sk_buff *skb,
1325 * ieee80211_rx_irqsafe - receive frame 1320 * ieee80211_rx_irqsafe - receive frame
1326 * 1321 *
1327 * Like ieee80211_rx() but can be called in IRQ context 1322 * Like ieee80211_rx() but can be called in IRQ context
1328 * (internally defers to a workqueue.) 1323 * (internally defers to a tasklet.)
1324 *
1325 * Calls to this function and ieee80211_rx() may not be mixed for a
1326 * single hardware.
1329 * 1327 *
1330 * @hw: the hardware this frame came in on 1328 * @hw: the hardware this frame came in on
1331 * @skb: the buffer to receive, owned by mac80211 after this call 1329 * @skb: the buffer to receive, owned by mac80211 after this call
@@ -1344,6 +1342,11 @@ void ieee80211_rx_irqsafe(struct ieee80211_hw *hw,
1344 * transmitted. It is permissible to not call this function for 1342 * transmitted. It is permissible to not call this function for
1345 * multicast frames but this can affect statistics. 1343 * multicast frames but this can affect statistics.
1346 * 1344 *
1345 * This function may not be called in IRQ context. Calls to this function
1346 * for a single hardware must be synchronized against each other. Calls
1347 * to this function and ieee80211_tx_status_irqsafe() may not be mixed
1348 * for a single hardware.
1349 *
1347 * @hw: the hardware the frame was transmitted by 1350 * @hw: the hardware the frame was transmitted by
1348 * @skb: the frame that was transmitted, owned by mac80211 after this call 1351 * @skb: the frame that was transmitted, owned by mac80211 after this call
1349 * @status: status information for this frame; the status pointer need not 1352 * @status: status information for this frame; the status pointer need not
@@ -1353,6 +1356,22 @@ void ieee80211_rx_irqsafe(struct ieee80211_hw *hw,
1353void ieee80211_tx_status(struct ieee80211_hw *hw, 1356void ieee80211_tx_status(struct ieee80211_hw *hw,
1354 struct sk_buff *skb, 1357 struct sk_buff *skb,
1355 struct ieee80211_tx_status *status); 1358 struct ieee80211_tx_status *status);
1359
1360/**
1361 * ieee80211_tx_status_irqsafe - irq-safe transmit status callback
1362 *
1363 * Like ieee80211_tx_status() but can be called in IRQ context
1364 * (internally defers to a tasklet.)
1365 *
1366 * Calls to this function and ieee80211_tx_status() may not be mixed for a
1367 * single hardware.
1368 *
1369 * @hw: the hardware the frame was transmitted by
1370 * @skb: the frame that was transmitted, owned by mac80211 after this call
1371 * @status: status information for this frame; the status pointer need not
1372 * be valid after this function returns and is not freed by mac80211,
1373 * it is recommended that it points to a stack area
1374 */
1356void ieee80211_tx_status_irqsafe(struct ieee80211_hw *hw, 1375void ieee80211_tx_status_irqsafe(struct ieee80211_hw *hw,
1357 struct sk_buff *skb, 1376 struct sk_buff *skb,
1358 struct ieee80211_tx_status *status); 1377 struct ieee80211_tx_status *status);
@@ -1449,7 +1468,7 @@ __le16 ieee80211_ctstoself_duration(struct ieee80211_hw *hw,
1449 * @hw: pointer obtained from ieee80211_alloc_hw(). 1468 * @hw: pointer obtained from ieee80211_alloc_hw().
1450 * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf. 1469 * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf.
1451 * @frame_len: the length of the frame. 1470 * @frame_len: the length of the frame.
1452 * @rate: the rate (in 100kbps) at which the frame is going to be transmitted. 1471 * @rate: the rate at which the frame is going to be transmitted.
1453 * 1472 *
1454 * Calculate the duration field of some generic frame, given its 1473 * Calculate the duration field of some generic frame, given its
1455 * length and transmission rate (in 100kbps). 1474 * length and transmission rate (in 100kbps).
@@ -1457,7 +1476,7 @@ __le16 ieee80211_ctstoself_duration(struct ieee80211_hw *hw,
1457__le16 ieee80211_generic_frame_duration(struct ieee80211_hw *hw, 1476__le16 ieee80211_generic_frame_duration(struct ieee80211_hw *hw,
1458 struct ieee80211_vif *vif, 1477 struct ieee80211_vif *vif,
1459 size_t frame_len, 1478 size_t frame_len,
1460 int rate); 1479 struct ieee80211_rate *rate);
1461 1480
1462/** 1481/**
1463 * ieee80211_get_buffered_bc - accessing buffered broadcast and multicast frames 1482 * ieee80211_get_buffered_bc - accessing buffered broadcast and multicast frames
@@ -1507,6 +1526,21 @@ int ieee80211_get_hdrlen_from_skb(const struct sk_buff *skb);
1507int ieee80211_get_hdrlen(u16 fc); 1526int ieee80211_get_hdrlen(u16 fc);
1508 1527
1509/** 1528/**
1529 * ieee80211_get_tkip_key - get a TKIP rc4 for skb
1530 *
1531 * This function computes a TKIP rc4 key for an skb. It computes
1532 * a phase 1 key if needed (iv16 wraps around). This function is to
1533 * be used by drivers which can do HW encryption but need to compute
1534 * to phase 1/2 key in SW.
1535 *
1536 * @keyconf: the parameter passed with the set key
1537 * @skb: the skb for which the key is needed
1538 * @rc4key: a buffer to which the key will be written
1539 */
1540void ieee80211_get_tkip_key(struct ieee80211_key_conf *keyconf,
1541 struct sk_buff *skb,
1542 enum ieee80211_tkip_key_type type, u8 *key);
1543/**
1510 * ieee80211_wake_queue - wake specific queue 1544 * ieee80211_wake_queue - wake specific queue
1511 * @hw: pointer as obtained from ieee80211_alloc_hw(). 1545 * @hw: pointer as obtained from ieee80211_alloc_hw().
1512 * @queue: queue number (counted from zero). 1546 * @queue: queue number (counted from zero).
@@ -1574,4 +1608,92 @@ void ieee80211_iterate_active_interfaces(struct ieee80211_hw *hw,
1574 struct ieee80211_vif *vif), 1608 struct ieee80211_vif *vif),
1575 void *data); 1609 void *data);
1576 1610
1611/**
1612 * ieee80211_start_tx_ba_session - Start a tx Block Ack session.
1613 * @hw: pointer as obtained from ieee80211_alloc_hw().
1614 * @ra: receiver address of the BA session recipient
1615 * @tid: the TID to BA on.
1616 * @return: success if addBA request was sent, failure otherwise
1617 *
1618 * Although mac80211/low level driver/user space application can estimate
1619 * the need to start aggregation on a certain RA/TID, the session level
1620 * will be managed by the mac80211.
1621 */
1622int ieee80211_start_tx_ba_session(struct ieee80211_hw *hw, u8 *ra, u16 tid);
1623
1624/**
1625 * ieee80211_start_tx_ba_cb - low level driver ready to aggregate.
1626 * @hw: pointer as obtained from ieee80211_alloc_hw().
1627 * @ra: receiver address of the BA session recipient.
1628 * @tid: the TID to BA on.
1629 *
1630 * This function must be called by low level driver once it has
1631 * finished with preparations for the BA session.
1632 */
1633void ieee80211_start_tx_ba_cb(struct ieee80211_hw *hw, u8 *ra, u16 tid);
1634
1635/**
1636 * ieee80211_start_tx_ba_cb_irqsafe - low level driver ready to aggregate.
1637 * @hw: pointer as obtained from ieee80211_alloc_hw().
1638 * @ra: receiver address of the BA session recipient.
1639 * @tid: the TID to BA on.
1640 *
1641 * This function must be called by low level driver once it has
1642 * finished with preparations for the BA session.
1643 * This version of the function is irq safe.
1644 */
1645void ieee80211_start_tx_ba_cb_irqsafe(struct ieee80211_hw *hw, const u8 *ra,
1646 u16 tid);
1647
1648/**
1649 * ieee80211_stop_tx_ba_session - Stop a Block Ack session.
1650 * @hw: pointer as obtained from ieee80211_alloc_hw().
1651 * @ra: receiver address of the BA session recipient
1652 * @tid: the TID to stop BA.
1653 * @initiator: if indicates initiator DELBA frame will be sent.
1654 * @return: error if no sta with matching da found, success otherwise
1655 *
1656 * Although mac80211/low level driver/user space application can estimate
1657 * the need to stop aggregation on a certain RA/TID, the session level
1658 * will be managed by the mac80211.
1659 */
1660int ieee80211_stop_tx_ba_session(struct ieee80211_hw *hw,
1661 u8 *ra, u16 tid,
1662 enum ieee80211_back_parties initiator);
1663
1664/**
1665 * ieee80211_stop_tx_ba_cb - low level driver ready to stop aggregate.
1666 * @hw: pointer as obtained from ieee80211_alloc_hw().
1667 * @ra: receiver address of the BA session recipient.
1668 * @tid: the desired TID to BA on.
1669 *
1670 * This function must be called by low level driver once it has
1671 * finished with preparations for the BA session tear down.
1672 */
1673void ieee80211_stop_tx_ba_cb(struct ieee80211_hw *hw, u8 *ra, u8 tid);
1674
1675/**
1676 * ieee80211_stop_tx_ba_cb_irqsafe - low level driver ready to stop aggregate.
1677 * @hw: pointer as obtained from ieee80211_alloc_hw().
1678 * @ra: receiver address of the BA session recipient.
1679 * @tid: the desired TID to BA on.
1680 *
1681 * This function must be called by low level driver once it has
1682 * finished with preparations for the BA session tear down.
1683 * This version of the function is irq safe.
1684 */
1685void ieee80211_stop_tx_ba_cb_irqsafe(struct ieee80211_hw *hw, const u8 *ra,
1686 u16 tid);
1687
1688/**
1689 * ieee80211_notify_mac - low level driver notification
1690 * @hw: pointer as obtained from ieee80211_alloc_hw().
1691 * @notification_types: enum ieee80211_notification_types
1692 *
1693 * This function must be called by low level driver to inform mac80211 of
1694 * low level driver status change or force mac80211 to re-assoc for low
1695 * level driver internal error that require re-assoc.
1696 */
1697void ieee80211_notify_mac(struct ieee80211_hw *hw,
1698 enum ieee80211_notification_types notif_type);
1577#endif /* MAC80211_H */ 1699#endif /* MAC80211_H */
diff --git a/include/net/mip6.h b/include/net/mip6.h
index 63272610a24a..a83ad1982a90 100644
--- a/include/net/mip6.h
+++ b/include/net/mip6.h
@@ -28,9 +28,6 @@
28#include <linux/skbuff.h> 28#include <linux/skbuff.h>
29#include <net/sock.h> 29#include <net/sock.h>
30 30
31#define MIP6_OPT_PAD_1 0
32#define MIP6_OPT_PAD_N 1
33
34/* 31/*
35 * Mobility Header 32 * Mobility Header
36 */ 33 */
diff --git a/include/net/ndisc.h b/include/net/ndisc.h
index 59b70624b056..9c451ff2f4f4 100644
--- a/include/net/ndisc.h
+++ b/include/net/ndisc.h
@@ -12,6 +12,15 @@
12#define NDISC_REDIRECT 137 12#define NDISC_REDIRECT 137
13 13
14/* 14/*
15 * Router type: cross-layer information from link-layer to
16 * IPv6 layer reported by certain link types (e.g., RFC4214).
17 */
18#define NDISC_NODETYPE_UNSPEC 0 /* unspecified (default) */
19#define NDISC_NODETYPE_HOST 1 /* host or unauthorized router */
20#define NDISC_NODETYPE_NODEFAULT 2 /* non-default router */
21#define NDISC_NODETYPE_DEFAULT 3 /* default router */
22
23/*
15 * ndisc options 24 * ndisc options
16 */ 25 */
17 26
@@ -77,7 +86,7 @@ struct nd_opt_hdr {
77} __attribute__((__packed__)); 86} __attribute__((__packed__));
78 87
79 88
80extern int ndisc_init(struct net_proto_family *ops); 89extern int ndisc_init(void);
81 90
82extern void ndisc_cleanup(void); 91extern void ndisc_cleanup(void);
83 92
@@ -85,20 +94,17 @@ extern int ndisc_rcv(struct sk_buff *skb);
85 94
86extern void ndisc_send_ns(struct net_device *dev, 95extern void ndisc_send_ns(struct net_device *dev,
87 struct neighbour *neigh, 96 struct neighbour *neigh,
88 struct in6_addr *solicit, 97 const struct in6_addr *solicit,
89 struct in6_addr *daddr, 98 const struct in6_addr *daddr,
90 struct in6_addr *saddr); 99 const struct in6_addr *saddr);
91 100
92extern void ndisc_send_rs(struct net_device *dev, 101extern void ndisc_send_rs(struct net_device *dev,
93 struct in6_addr *saddr, 102 const struct in6_addr *saddr,
94 struct in6_addr *daddr); 103 const struct in6_addr *daddr);
95
96extern void ndisc_forwarding_on(void);
97extern void ndisc_forwarding_off(void);
98 104
99extern void ndisc_send_redirect(struct sk_buff *skb, 105extern void ndisc_send_redirect(struct sk_buff *skb,
100 struct neighbour *neigh, 106 struct neighbour *neigh,
101 struct in6_addr *target); 107 const struct in6_addr *target);
102 108
103extern int ndisc_mc_map(struct in6_addr *addr, char *buf, struct net_device *dev, int dir); 109extern int ndisc_mc_map(struct in6_addr *addr, char *buf, struct net_device *dev, int dir);
104 110
@@ -107,7 +113,7 @@ extern int ndisc_mc_map(struct in6_addr *addr, char *buf, struct net_device *d
107/* 113/*
108 * IGMP 114 * IGMP
109 */ 115 */
110extern int igmp6_init(struct net_proto_family *ops); 116extern int igmp6_init(void);
111 117
112extern void igmp6_cleanup(void); 118extern void igmp6_cleanup(void);
113 119
@@ -115,7 +121,6 @@ extern int igmp6_event_query(struct sk_buff *skb);
115 121
116extern int igmp6_event_report(struct sk_buff *skb); 122extern int igmp6_event_report(struct sk_buff *skb);
117 123
118extern void igmp6_cleanup(void);
119 124
120#ifdef CONFIG_SYSCTL 125#ifdef CONFIG_SYSCTL
121extern int ndisc_ifinfo_sysctl_change(struct ctl_table *ctl, 126extern int ndisc_ifinfo_sysctl_change(struct ctl_table *ctl,
@@ -129,7 +134,7 @@ extern int ndisc_ifinfo_sysctl_change(struct ctl_table *ctl,
129extern void inet6_ifinfo_notify(int event, 134extern void inet6_ifinfo_notify(int event,
130 struct inet6_dev *idev); 135 struct inet6_dev *idev);
131 136
132static inline struct neighbour * ndisc_get_neigh(struct net_device *dev, struct in6_addr *addr) 137static inline struct neighbour * ndisc_get_neigh(struct net_device *dev, const struct in6_addr *addr)
133{ 138{
134 139
135 if (dev) 140 if (dev)
diff --git a/include/net/neighbour.h b/include/net/neighbour.h
index 64a5f0120b52..dc420fecafb9 100644
--- a/include/net/neighbour.h
+++ b/include/net/neighbour.h
@@ -38,7 +38,9 @@ struct neighbour;
38 38
39struct neigh_parms 39struct neigh_parms
40{ 40{
41#ifdef CONFIG_NET_NS
41 struct net *net; 42 struct net *net;
43#endif
42 struct net_device *dev; 44 struct net_device *dev;
43 struct neigh_parms *next; 45 struct neigh_parms *next;
44 int (*neigh_setup)(struct neighbour *); 46 int (*neigh_setup)(struct neighbour *);
@@ -131,7 +133,9 @@ struct neigh_ops
131struct pneigh_entry 133struct pneigh_entry
132{ 134{
133 struct pneigh_entry *next; 135 struct pneigh_entry *next;
136#ifdef CONFIG_NET_NS
134 struct net *net; 137 struct net *net;
138#endif
135 struct net_device *dev; 139 struct net_device *dev;
136 u8 flags; 140 u8 flags;
137 u8 key[0]; 141 u8 key[0];
@@ -213,6 +217,17 @@ extern struct neighbour *neigh_event_ns(struct neigh_table *tbl,
213 217
214extern struct neigh_parms *neigh_parms_alloc(struct net_device *dev, struct neigh_table *tbl); 218extern struct neigh_parms *neigh_parms_alloc(struct net_device *dev, struct neigh_table *tbl);
215extern void neigh_parms_release(struct neigh_table *tbl, struct neigh_parms *parms); 219extern void neigh_parms_release(struct neigh_table *tbl, struct neigh_parms *parms);
220
221static inline
222struct net *neigh_parms_net(const struct neigh_parms *parms)
223{
224#ifdef CONFIG_NET_NS
225 return parms->net;
226#else
227 return &init_net;
228#endif
229}
230
216extern unsigned long neigh_rand_reach_time(unsigned long base); 231extern unsigned long neigh_rand_reach_time(unsigned long base);
217 232
218extern void pneigh_enqueue(struct neigh_table *tbl, struct neigh_parms *p, 233extern void pneigh_enqueue(struct neigh_table *tbl, struct neigh_parms *p,
@@ -224,6 +239,16 @@ extern struct pneigh_entry *__pneigh_lookup(struct neigh_table *tbl,
224 struct net_device *dev); 239 struct net_device *dev);
225extern int pneigh_delete(struct neigh_table *tbl, struct net *net, const void *key, struct net_device *dev); 240extern int pneigh_delete(struct neigh_table *tbl, struct net *net, const void *key, struct net_device *dev);
226 241
242static inline
243struct net *pneigh_net(const struct pneigh_entry *pneigh)
244{
245#ifdef CONFIG_NET_NS
246 return pneigh->net;
247#else
248 return &init_net;
249#endif
250}
251
227extern void neigh_app_ns(struct neighbour *n); 252extern void neigh_app_ns(struct neighbour *n);
228extern void neigh_for_each(struct neigh_table *tbl, void (*cb)(struct neighbour *, void *), void *cookie); 253extern void neigh_for_each(struct neigh_table *tbl, void (*cb)(struct neighbour *, void *), void *cookie);
229extern void __neigh_for_each_release(struct neigh_table *tbl, int (*cb)(struct neighbour *)); 254extern void __neigh_for_each_release(struct neigh_table *tbl, int (*cb)(struct neighbour *));
@@ -288,12 +313,6 @@ static inline void neigh_confirm(struct neighbour *neigh)
288 neigh->confirmed = jiffies; 313 neigh->confirmed = jiffies;
289} 314}
290 315
291static inline int neigh_is_connected(struct neighbour *neigh)
292{
293 return neigh->nud_state&NUD_CONNECTED;
294}
295
296
297static inline int neigh_event_send(struct neighbour *neigh, struct sk_buff *skb) 316static inline int neigh_event_send(struct neighbour *neigh, struct sk_buff *skb)
298{ 317{
299 neigh->used = jiffies; 318 neigh->used = jiffies;
diff --git a/include/net/net_namespace.h b/include/net/net_namespace.h
index 923f2b8b9096..aa540e6be502 100644
--- a/include/net/net_namespace.h
+++ b/include/net/net_namespace.h
@@ -8,24 +8,29 @@
8#include <linux/workqueue.h> 8#include <linux/workqueue.h>
9#include <linux/list.h> 9#include <linux/list.h>
10 10
11#include <net/netns/core.h>
11#include <net/netns/unix.h> 12#include <net/netns/unix.h>
12#include <net/netns/packet.h> 13#include <net/netns/packet.h>
13#include <net/netns/ipv4.h> 14#include <net/netns/ipv4.h>
14#include <net/netns/ipv6.h> 15#include <net/netns/ipv6.h>
16#include <net/netns/dccp.h>
15#include <net/netns/x_tables.h> 17#include <net/netns/x_tables.h>
16 18
17struct proc_dir_entry; 19struct proc_dir_entry;
18struct net_device; 20struct net_device;
19struct sock; 21struct sock;
20struct ctl_table_header; 22struct ctl_table_header;
23struct net_generic;
21 24
22struct net { 25struct net {
23 atomic_t count; /* To decided when the network 26 atomic_t count; /* To decided when the network
24 * namespace should be freed. 27 * namespace should be freed.
25 */ 28 */
29#ifdef NETNS_REFCNT_DEBUG
26 atomic_t use_count; /* To track references we 30 atomic_t use_count; /* To track references we
27 * destroy on demand 31 * destroy on demand
28 */ 32 */
33#endif
29 struct list_head list; /* list of network namespaces */ 34 struct list_head list; /* list of network namespaces */
30 struct work_struct work; /* work struct for freeing */ 35 struct work_struct work; /* work struct for freeing */
31 36
@@ -46,40 +51,46 @@ struct net {
46 51
47 struct sock *rtnl; /* rtnetlink socket */ 52 struct sock *rtnl; /* rtnetlink socket */
48 53
49 /* core sysctls */ 54 struct netns_core core;
50 struct ctl_table_header *sysctl_core_hdr;
51 int sysctl_somaxconn;
52
53 struct netns_packet packet; 55 struct netns_packet packet;
54 struct netns_unix unx; 56 struct netns_unix unx;
55 struct netns_ipv4 ipv4; 57 struct netns_ipv4 ipv4;
56#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) 58#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
57 struct netns_ipv6 ipv6; 59 struct netns_ipv6 ipv6;
58#endif 60#endif
61#if defined(CONFIG_IP_DCCP) || defined(CONFIG_IP_DCCP_MODULE)
62 struct netns_dccp dccp;
63#endif
59#ifdef CONFIG_NETFILTER 64#ifdef CONFIG_NETFILTER
60 struct netns_xt xt; 65 struct netns_xt xt;
61#endif 66#endif
67 struct net_generic *gen;
62}; 68};
63 69
64#ifdef CONFIG_NET 70
71#include <linux/seq_file_net.h>
72
65/* Init's network namespace */ 73/* Init's network namespace */
66extern struct net init_net; 74extern struct net init_net;
67#define INIT_NET_NS(net_ns) .net_ns = &init_net,
68#else
69#define INIT_NET_NS(net_ns)
70#endif
71
72extern struct list_head net_namespace_list;
73 75
74#ifdef CONFIG_NET 76#ifdef CONFIG_NET
77#define INIT_NET_NS(net_ns) .net_ns = &init_net,
78
75extern struct net *copy_net_ns(unsigned long flags, struct net *net_ns); 79extern struct net *copy_net_ns(unsigned long flags, struct net *net_ns);
76#else 80
81#else /* CONFIG_NET */
82
83#define INIT_NET_NS(net_ns)
84
77static inline struct net *copy_net_ns(unsigned long flags, struct net *net_ns) 85static inline struct net *copy_net_ns(unsigned long flags, struct net *net_ns)
78{ 86{
79 /* There is nothing to copy so this is a noop */ 87 /* There is nothing to copy so this is a noop */
80 return net_ns; 88 return net_ns;
81} 89}
82#endif 90#endif /* CONFIG_NET */
91
92
93extern struct list_head net_namespace_list;
83 94
84#ifdef CONFIG_NET_NS 95#ifdef CONFIG_NET_NS
85extern void __put_net(struct net *net); 96extern void __put_net(struct net *net);
@@ -108,41 +119,59 @@ static inline void put_net(struct net *net)
108 __put_net(net); 119 __put_net(net);
109} 120}
110 121
111static inline struct net *hold_net(struct net *net) 122static inline
123int net_eq(const struct net *net1, const struct net *net2)
124{
125 return net1 == net2;
126}
127#else
128static inline struct net *get_net(struct net *net)
112{ 129{
113 atomic_inc(&net->use_count);
114 return net; 130 return net;
115} 131}
116 132
117static inline void release_net(struct net *net) 133static inline void put_net(struct net *net)
118{ 134{
119 atomic_dec(&net->use_count);
120} 135}
121#else 136
122static inline struct net *get_net(struct net *net) 137static inline struct net *maybe_get_net(struct net *net)
123{ 138{
124 return net; 139 return net;
125} 140}
126 141
127static inline void put_net(struct net *net) 142static inline
143int net_eq(const struct net *net1, const struct net *net2)
128{ 144{
145 return 1;
129} 146}
147#endif
148
130 149
150#ifdef NETNS_REFCNT_DEBUG
131static inline struct net *hold_net(struct net *net) 151static inline struct net *hold_net(struct net *net)
132{ 152{
153 if (net)
154 atomic_inc(&net->use_count);
133 return net; 155 return net;
134} 156}
135 157
136static inline void release_net(struct net *net) 158static inline void release_net(struct net *net)
137{ 159{
160 if (net)
161 atomic_dec(&net->use_count);
138} 162}
139 163#else
140static inline struct net *maybe_get_net(struct net *net) 164static inline struct net *hold_net(struct net *net)
141{ 165{
142 return net; 166 return net;
143} 167}
168
169static inline void release_net(struct net *net)
170{
171}
144#endif 172#endif
145 173
174
146#define for_each_net(VAR) \ 175#define for_each_net(VAR) \
147 list_for_each_entry(VAR, &net_namespace_list, list) 176 list_for_each_entry(VAR, &net_namespace_list, list)
148 177
@@ -166,6 +195,8 @@ extern int register_pernet_subsys(struct pernet_operations *);
166extern void unregister_pernet_subsys(struct pernet_operations *); 195extern void unregister_pernet_subsys(struct pernet_operations *);
167extern int register_pernet_device(struct pernet_operations *); 196extern int register_pernet_device(struct pernet_operations *);
168extern void unregister_pernet_device(struct pernet_operations *); 197extern void unregister_pernet_device(struct pernet_operations *);
198extern int register_pernet_gen_device(int *id, struct pernet_operations *);
199extern void unregister_pernet_gen_device(int id, struct pernet_operations *);
169 200
170struct ctl_path; 201struct ctl_path;
171struct ctl_table; 202struct ctl_table;
diff --git a/include/net/netfilter/nf_conntrack.h b/include/net/netfilter/nf_conntrack.h
index 90b3e7f5df5f..2dbd6c015b94 100644
--- a/include/net/netfilter/nf_conntrack.h
+++ b/include/net/netfilter/nf_conntrack.h
@@ -20,6 +20,7 @@
20#include <asm/atomic.h> 20#include <asm/atomic.h>
21 21
22#include <linux/netfilter/nf_conntrack_tcp.h> 22#include <linux/netfilter/nf_conntrack_tcp.h>
23#include <linux/netfilter/nf_conntrack_dccp.h>
23#include <linux/netfilter/nf_conntrack_sctp.h> 24#include <linux/netfilter/nf_conntrack_sctp.h>
24#include <linux/netfilter/nf_conntrack_proto_gre.h> 25#include <linux/netfilter/nf_conntrack_proto_gre.h>
25#include <net/netfilter/ipv4/nf_conntrack_icmp.h> 26#include <net/netfilter/ipv4/nf_conntrack_icmp.h>
@@ -30,6 +31,7 @@
30/* per conntrack: protocol private data */ 31/* per conntrack: protocol private data */
31union nf_conntrack_proto { 32union nf_conntrack_proto {
32 /* insert conntrack proto private data here */ 33 /* insert conntrack proto private data here */
34 struct nf_ct_dccp dccp;
33 struct ip_ct_sctp sctp; 35 struct ip_ct_sctp sctp;
34 struct ip_ct_tcp tcp; 36 struct ip_ct_tcp tcp;
35 struct ip_ct_icmp icmp; 37 struct ip_ct_icmp icmp;
@@ -46,6 +48,7 @@ union nf_conntrack_expect_proto {
46#include <linux/netfilter/nf_conntrack_pptp.h> 48#include <linux/netfilter/nf_conntrack_pptp.h>
47#include <linux/netfilter/nf_conntrack_h323.h> 49#include <linux/netfilter/nf_conntrack_h323.h>
48#include <linux/netfilter/nf_conntrack_sane.h> 50#include <linux/netfilter/nf_conntrack_sane.h>
51#include <linux/netfilter/nf_conntrack_sip.h>
49 52
50/* per conntrack: application helper private data */ 53/* per conntrack: application helper private data */
51union nf_conntrack_help { 54union nf_conntrack_help {
@@ -54,6 +57,7 @@ union nf_conntrack_help {
54 struct nf_ct_pptp_master ct_pptp_info; 57 struct nf_ct_pptp_master ct_pptp_info;
55 struct nf_ct_h323_master ct_h323_info; 58 struct nf_ct_h323_master ct_h323_info;
56 struct nf_ct_sane_master ct_sane_info; 59 struct nf_ct_sane_master ct_sane_info;
60 struct nf_ct_sip_master ct_sip_info;
57}; 61};
58 62
59#include <linux/types.h> 63#include <linux/types.h>
@@ -61,20 +65,16 @@ union nf_conntrack_help {
61#include <linux/timer.h> 65#include <linux/timer.h>
62 66
63#ifdef CONFIG_NETFILTER_DEBUG 67#ifdef CONFIG_NETFILTER_DEBUG
64#define NF_CT_ASSERT(x) \ 68#define NF_CT_ASSERT(x) WARN_ON(!(x))
65do { \
66 if (!(x)) \
67 /* Wooah! I'm tripping my conntrack in a frenzy of \
68 netplay... */ \
69 printk("NF_CT_ASSERT: %s:%i(%s)\n", \
70 __FILE__, __LINE__, __FUNCTION__); \
71} while(0)
72#else 69#else
73#define NF_CT_ASSERT(x) 70#define NF_CT_ASSERT(x)
74#endif 71#endif
75 72
76struct nf_conntrack_helper; 73struct nf_conntrack_helper;
77 74
75/* Must be kept in sync with the classes defined by helpers */
76#define NF_CT_MAX_EXPECT_CLASSES 3
77
78/* nf_conn feature for connections that have a helper */ 78/* nf_conn feature for connections that have a helper */
79struct nf_conn_help { 79struct nf_conn_help {
80 /* Helper. if any */ 80 /* Helper. if any */
@@ -85,7 +85,7 @@ struct nf_conn_help {
85 struct hlist_head expectations; 85 struct hlist_head expectations;
86 86
87 /* Current number of expected connections */ 87 /* Current number of expected connections */
88 unsigned int expecting; 88 u8 expecting[NF_CT_MAX_EXPECT_CLASSES];
89}; 89};
90 90
91 91
@@ -140,6 +140,16 @@ nf_ct_tuplehash_to_ctrack(const struct nf_conntrack_tuple_hash *hash)
140 tuplehash[hash->tuple.dst.dir]); 140 tuplehash[hash->tuple.dst.dir]);
141} 141}
142 142
143static inline u_int16_t nf_ct_l3num(const struct nf_conn *ct)
144{
145 return ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple.src.l3num;
146}
147
148static inline u_int8_t nf_ct_protonum(const struct nf_conn *ct)
149{
150 return ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple.dst.protonum;
151}
152
143/* get master conntrack via master expectation */ 153/* get master conntrack via master expectation */
144#define master_ct(conntr) (conntr->master) 154#define master_ct(conntr) (conntr->master)
145 155
@@ -184,12 +194,11 @@ extern void nf_conntrack_hash_insert(struct nf_conn *ct);
184 194
185extern void nf_conntrack_flush(void); 195extern void nf_conntrack_flush(void);
186 196
187extern int nf_ct_get_tuplepr(const struct sk_buff *skb, 197extern bool nf_ct_get_tuplepr(const struct sk_buff *skb,
188 unsigned int nhoff, 198 unsigned int nhoff, u_int16_t l3num,
189 u_int16_t l3num, 199 struct nf_conntrack_tuple *tuple);
190 struct nf_conntrack_tuple *tuple); 200extern bool nf_ct_invert_tuplepr(struct nf_conntrack_tuple *inverse,
191extern int nf_ct_invert_tuplepr(struct nf_conntrack_tuple *inverse, 201 const struct nf_conntrack_tuple *orig);
192 const struct nf_conntrack_tuple *orig);
193 202
194extern void __nf_ct_refresh_acct(struct nf_conn *ct, 203extern void __nf_ct_refresh_acct(struct nf_conn *ct,
195 enum ip_conntrack_info ctinfo, 204 enum ip_conntrack_info ctinfo,
diff --git a/include/net/netfilter/nf_conntrack_core.h b/include/net/netfilter/nf_conntrack_core.h
index 9ee26469c759..a81771210934 100644
--- a/include/net/netfilter/nf_conntrack_core.h
+++ b/include/net/netfilter/nf_conntrack_core.h
@@ -30,7 +30,7 @@ extern void nf_conntrack_cleanup(void);
30extern int nf_conntrack_proto_init(void); 30extern int nf_conntrack_proto_init(void);
31extern void nf_conntrack_proto_fini(void); 31extern void nf_conntrack_proto_fini(void);
32 32
33extern int 33extern bool
34nf_ct_get_tuple(const struct sk_buff *skb, 34nf_ct_get_tuple(const struct sk_buff *skb,
35 unsigned int nhoff, 35 unsigned int nhoff,
36 unsigned int dataoff, 36 unsigned int dataoff,
@@ -40,7 +40,7 @@ nf_ct_get_tuple(const struct sk_buff *skb,
40 const struct nf_conntrack_l3proto *l3proto, 40 const struct nf_conntrack_l3proto *l3proto,
41 const struct nf_conntrack_l4proto *l4proto); 41 const struct nf_conntrack_l4proto *l4proto);
42 42
43extern int 43extern bool
44nf_ct_invert_tuple(struct nf_conntrack_tuple *inverse, 44nf_ct_invert_tuple(struct nf_conntrack_tuple *inverse,
45 const struct nf_conntrack_tuple *orig, 45 const struct nf_conntrack_tuple *orig,
46 const struct nf_conntrack_l3proto *l3proto, 46 const struct nf_conntrack_l3proto *l3proto,
diff --git a/include/net/netfilter/nf_conntrack_expect.h b/include/net/netfilter/nf_conntrack_expect.h
index cb608a1b44e5..dfdf4b459475 100644
--- a/include/net/netfilter/nf_conntrack_expect.h
+++ b/include/net/netfilter/nf_conntrack_expect.h
@@ -41,6 +41,9 @@ struct nf_conntrack_expect
41 /* Flags */ 41 /* Flags */
42 unsigned int flags; 42 unsigned int flags;
43 43
44 /* Expectation class */
45 unsigned int class;
46
44#ifdef CONFIG_NF_NAT_NEEDED 47#ifdef CONFIG_NF_NAT_NEEDED
45 __be32 saved_ip; 48 __be32 saved_ip;
46 /* This is the original per-proto part, used to map the 49 /* This is the original per-proto part, used to map the
@@ -53,7 +56,16 @@ struct nf_conntrack_expect
53 struct rcu_head rcu; 56 struct rcu_head rcu;
54}; 57};
55 58
56#define NF_CT_EXPECT_PERMANENT 0x1 59struct nf_conntrack_expect_policy
60{
61 unsigned int max_expected;
62 unsigned int timeout;
63};
64
65#define NF_CT_EXPECT_CLASS_DEFAULT 0
66
67#define NF_CT_EXPECT_PERMANENT 0x1
68#define NF_CT_EXPECT_INACTIVE 0x2
57 69
58int nf_conntrack_expect_init(void); 70int nf_conntrack_expect_init(void);
59void nf_conntrack_expect_fini(void); 71void nf_conntrack_expect_fini(void);
@@ -74,10 +86,10 @@ void nf_ct_unexpect_related(struct nf_conntrack_expect *exp);
74/* Allocate space for an expectation: this is mandatory before calling 86/* Allocate space for an expectation: this is mandatory before calling
75 nf_ct_expect_related. You will have to call put afterwards. */ 87 nf_ct_expect_related. You will have to call put afterwards. */
76struct nf_conntrack_expect *nf_ct_expect_alloc(struct nf_conn *me); 88struct nf_conntrack_expect *nf_ct_expect_alloc(struct nf_conn *me);
77void nf_ct_expect_init(struct nf_conntrack_expect *, int, 89void nf_ct_expect_init(struct nf_conntrack_expect *, unsigned int, int,
78 union nf_inet_addr *, 90 const union nf_inet_addr *,
79 union nf_inet_addr *, 91 const union nf_inet_addr *,
80 u_int8_t, __be16 *, __be16 *); 92 u_int8_t, const __be16 *, const __be16 *);
81void nf_ct_expect_put(struct nf_conntrack_expect *exp); 93void nf_ct_expect_put(struct nf_conntrack_expect *exp);
82int nf_ct_expect_related(struct nf_conntrack_expect *expect); 94int nf_ct_expect_related(struct nf_conntrack_expect *expect);
83 95
diff --git a/include/net/netfilter/nf_conntrack_helper.h b/include/net/netfilter/nf_conntrack_helper.h
index 4ca125e9b3ce..f8060ab5a083 100644
--- a/include/net/netfilter/nf_conntrack_helper.h
+++ b/include/net/netfilter/nf_conntrack_helper.h
@@ -20,9 +20,7 @@ struct nf_conntrack_helper
20 20
21 const char *name; /* name of the module */ 21 const char *name; /* name of the module */
22 struct module *me; /* pointer to self */ 22 struct module *me; /* pointer to self */
23 unsigned int max_expected; /* Maximum number of concurrent 23 const struct nf_conntrack_expect_policy *expect_policy;
24 * expected connections */
25 unsigned int timeout; /* timeout for expecteds */
26 24
27 /* Tuple of things we will help (compared against server response) */ 25 /* Tuple of things we will help (compared against server response) */
28 struct nf_conntrack_tuple tuple; 26 struct nf_conntrack_tuple tuple;
@@ -37,6 +35,7 @@ struct nf_conntrack_helper
37 void (*destroy)(struct nf_conn *ct); 35 void (*destroy)(struct nf_conn *ct);
38 36
39 int (*to_nlattr)(struct sk_buff *skb, const struct nf_conn *ct); 37 int (*to_nlattr)(struct sk_buff *skb, const struct nf_conn *ct);
38 unsigned int expect_class_max;
40}; 39};
41 40
42extern struct nf_conntrack_helper * 41extern struct nf_conntrack_helper *
diff --git a/include/net/netfilter/nf_conntrack_l3proto.h b/include/net/netfilter/nf_conntrack_l3proto.h
index b886e3ae6cad..0378676c3dd8 100644
--- a/include/net/netfilter/nf_conntrack_l3proto.h
+++ b/include/net/netfilter/nf_conntrack_l3proto.h
@@ -28,31 +28,20 @@ struct nf_conntrack_l3proto
28 * Try to fill in the third arg: nhoff is offset of l3 proto 28 * Try to fill in the third arg: nhoff is offset of l3 proto
29 * hdr. Return true if possible. 29 * hdr. Return true if possible.
30 */ 30 */
31 int (*pkt_to_tuple)(const struct sk_buff *skb, unsigned int nhoff, 31 bool (*pkt_to_tuple)(const struct sk_buff *skb, unsigned int nhoff,
32 struct nf_conntrack_tuple *tuple); 32 struct nf_conntrack_tuple *tuple);
33 33
34 /* 34 /*
35 * Invert the per-proto part of the tuple: ie. turn xmit into reply. 35 * Invert the per-proto part of the tuple: ie. turn xmit into reply.
36 * Some packets can't be inverted: return 0 in that case. 36 * Some packets can't be inverted: return 0 in that case.
37 */ 37 */
38 int (*invert_tuple)(struct nf_conntrack_tuple *inverse, 38 bool (*invert_tuple)(struct nf_conntrack_tuple *inverse,
39 const struct nf_conntrack_tuple *orig); 39 const struct nf_conntrack_tuple *orig);
40 40
41 /* Print out the per-protocol part of the tuple. */ 41 /* Print out the per-protocol part of the tuple. */
42 int (*print_tuple)(struct seq_file *s, 42 int (*print_tuple)(struct seq_file *s,
43 const struct nf_conntrack_tuple *); 43 const struct nf_conntrack_tuple *);
44 44
45 /* Returns verdict for packet, or -1 for invalid. */
46 int (*packet)(struct nf_conn *ct,
47 const struct sk_buff *skb,
48 enum ip_conntrack_info ctinfo);
49
50 /*
51 * Called when a new connection for this protocol found;
52 * returns TRUE if it's OK. If so, packet() called next.
53 */
54 int (*new)(struct nf_conn *ct, const struct sk_buff *skb);
55
56 /* 45 /*
57 * Called before tracking. 46 * Called before tracking.
58 * *dataoff: offset of protocol header (TCP, UDP,...) in skb 47 * *dataoff: offset of protocol header (TCP, UDP,...) in skb
diff --git a/include/net/netfilter/nf_conntrack_l4proto.h b/include/net/netfilter/nf_conntrack_l4proto.h
index efc16eccddb1..723df9d1cc35 100644
--- a/include/net/netfilter/nf_conntrack_l4proto.h
+++ b/include/net/netfilter/nf_conntrack_l4proto.h
@@ -25,15 +25,14 @@ struct nf_conntrack_l4proto
25 25
26 /* Try to fill in the third arg: dataoff is offset past network protocol 26 /* Try to fill in the third arg: dataoff is offset past network protocol
27 hdr. Return true if possible. */ 27 hdr. Return true if possible. */
28 int (*pkt_to_tuple)(const struct sk_buff *skb, 28 bool (*pkt_to_tuple)(const struct sk_buff *skb, unsigned int dataoff,
29 unsigned int dataoff, 29 struct nf_conntrack_tuple *tuple);
30 struct nf_conntrack_tuple *tuple);
31 30
32 /* Invert the per-proto part of the tuple: ie. turn xmit into reply. 31 /* Invert the per-proto part of the tuple: ie. turn xmit into reply.
33 * Some packets can't be inverted: return 0 in that case. 32 * Some packets can't be inverted: return 0 in that case.
34 */ 33 */
35 int (*invert_tuple)(struct nf_conntrack_tuple *inverse, 34 bool (*invert_tuple)(struct nf_conntrack_tuple *inverse,
36 const struct nf_conntrack_tuple *orig); 35 const struct nf_conntrack_tuple *orig);
37 36
38 /* Returns verdict for packet, or -1 for invalid. */ 37 /* Returns verdict for packet, or -1 for invalid. */
39 int (*packet)(struct nf_conn *ct, 38 int (*packet)(struct nf_conn *ct,
@@ -45,8 +44,8 @@ struct nf_conntrack_l4proto
45 44
46 /* Called when a new connection for this protocol found; 45 /* Called when a new connection for this protocol found;
47 * returns TRUE if it's OK. If so, packet() called next. */ 46 * returns TRUE if it's OK. If so, packet() called next. */
48 int (*new)(struct nf_conn *ct, const struct sk_buff *skb, 47 bool (*new)(struct nf_conn *ct, const struct sk_buff *skb,
49 unsigned int dataoff); 48 unsigned int dataoff);
50 49
51 /* Called when a conntrack entry is destroyed */ 50 /* Called when a conntrack entry is destroyed */
52 void (*destroy)(struct nf_conn *ct); 51 void (*destroy)(struct nf_conn *ct);
diff --git a/include/net/netfilter/nf_conntrack_tuple.h b/include/net/netfilter/nf_conntrack_tuple.h
index e69ab2e87597..1bb7087833d3 100644
--- a/include/net/netfilter/nf_conntrack_tuple.h
+++ b/include/net/netfilter/nf_conntrack_tuple.h
@@ -41,6 +41,9 @@ union nf_conntrack_man_proto
41 } icmp; 41 } icmp;
42 struct { 42 struct {
43 __be16 port; 43 __be16 port;
44 } dccp;
45 struct {
46 __be16 port;
44 } sctp; 47 } sctp;
45 struct { 48 struct {
46 __be16 key; /* GRE key is 32bit, PPtP only uses 16bit */ 49 __be16 key; /* GRE key is 32bit, PPtP only uses 16bit */
@@ -79,6 +82,9 @@ struct nf_conntrack_tuple
79 } icmp; 82 } icmp;
80 struct { 83 struct {
81 __be16 port; 84 __be16 port;
85 } dccp;
86 struct {
87 __be16 port;
82 } sctp; 88 } sctp;
83 struct { 89 struct {
84 __be16 key; 90 __be16 key;
@@ -113,11 +119,37 @@ struct nf_conntrack_tuple_mask
113 119
114#ifdef __KERNEL__ 120#ifdef __KERNEL__
115 121
116#define NF_CT_DUMP_TUPLE(tp) \ 122static inline void nf_ct_dump_tuple_ip(const struct nf_conntrack_tuple *t)
117pr_debug("tuple %p: %u %u " NIP6_FMT " %hu -> " NIP6_FMT " %hu\n", \ 123{
118 (tp), (tp)->src.l3num, (tp)->dst.protonum, \ 124#ifdef DEBUG
119 NIP6(*(struct in6_addr *)(tp)->src.u3.all), ntohs((tp)->src.u.all), \ 125 printk("tuple %p: %u " NIPQUAD_FMT ":%hu -> " NIPQUAD_FMT ":%hu\n",
120 NIP6(*(struct in6_addr *)(tp)->dst.u3.all), ntohs((tp)->dst.u.all)) 126 t, t->dst.protonum,
127 NIPQUAD(t->src.u3.ip), ntohs(t->src.u.all),
128 NIPQUAD(t->dst.u3.ip), ntohs(t->dst.u.all));
129#endif
130}
131
132static inline void nf_ct_dump_tuple_ipv6(const struct nf_conntrack_tuple *t)
133{
134#ifdef DEBUG
135 printk("tuple %p: %u " NIP6_FMT " %hu -> " NIP6_FMT " %hu\n",
136 t, t->dst.protonum,
137 NIP6(*(struct in6_addr *)t->src.u3.all), ntohs(t->src.u.all),
138 NIP6(*(struct in6_addr *)t->dst.u3.all), ntohs(t->dst.u.all));
139#endif
140}
141
142static inline void nf_ct_dump_tuple(const struct nf_conntrack_tuple *t)
143{
144 switch (t->src.l3num) {
145 case AF_INET:
146 nf_ct_dump_tuple_ip(t);
147 break;
148 case AF_INET6:
149 nf_ct_dump_tuple_ipv6(t);
150 break;
151 }
152}
121 153
122/* If we're the first tuple, it's the original dir. */ 154/* If we're the first tuple, it's the original dir. */
123#define NF_CT_DIRECTION(h) \ 155#define NF_CT_DIRECTION(h) \
@@ -132,70 +164,64 @@ struct nf_conntrack_tuple_hash
132 164
133#endif /* __KERNEL__ */ 165#endif /* __KERNEL__ */
134 166
135static inline int __nf_ct_tuple_src_equal(const struct nf_conntrack_tuple *t1, 167static inline bool __nf_ct_tuple_src_equal(const struct nf_conntrack_tuple *t1,
136 const struct nf_conntrack_tuple *t2) 168 const struct nf_conntrack_tuple *t2)
137{ 169{
138 return (t1->src.u3.all[0] == t2->src.u3.all[0] && 170 return (nf_inet_addr_cmp(&t1->src.u3, &t2->src.u3) &&
139 t1->src.u3.all[1] == t2->src.u3.all[1] &&
140 t1->src.u3.all[2] == t2->src.u3.all[2] &&
141 t1->src.u3.all[3] == t2->src.u3.all[3] &&
142 t1->src.u.all == t2->src.u.all && 171 t1->src.u.all == t2->src.u.all &&
143 t1->src.l3num == t2->src.l3num); 172 t1->src.l3num == t2->src.l3num);
144} 173}
145 174
146static inline int __nf_ct_tuple_dst_equal(const struct nf_conntrack_tuple *t1, 175static inline bool __nf_ct_tuple_dst_equal(const struct nf_conntrack_tuple *t1,
147 const struct nf_conntrack_tuple *t2) 176 const struct nf_conntrack_tuple *t2)
148{ 177{
149 return (t1->dst.u3.all[0] == t2->dst.u3.all[0] && 178 return (nf_inet_addr_cmp(&t1->dst.u3, &t2->dst.u3) &&
150 t1->dst.u3.all[1] == t2->dst.u3.all[1] &&
151 t1->dst.u3.all[2] == t2->dst.u3.all[2] &&
152 t1->dst.u3.all[3] == t2->dst.u3.all[3] &&
153 t1->dst.u.all == t2->dst.u.all && 179 t1->dst.u.all == t2->dst.u.all &&
154 t1->dst.protonum == t2->dst.protonum); 180 t1->dst.protonum == t2->dst.protonum);
155} 181}
156 182
157static inline int nf_ct_tuple_equal(const struct nf_conntrack_tuple *t1, 183static inline bool nf_ct_tuple_equal(const struct nf_conntrack_tuple *t1,
158 const struct nf_conntrack_tuple *t2) 184 const struct nf_conntrack_tuple *t2)
159{ 185{
160 return __nf_ct_tuple_src_equal(t1, t2) && 186 return __nf_ct_tuple_src_equal(t1, t2) &&
161 __nf_ct_tuple_dst_equal(t1, t2); 187 __nf_ct_tuple_dst_equal(t1, t2);
162} 188}
163 189
164static inline int nf_ct_tuple_mask_equal(const struct nf_conntrack_tuple_mask *m1, 190static inline bool
165 const struct nf_conntrack_tuple_mask *m2) 191nf_ct_tuple_mask_equal(const struct nf_conntrack_tuple_mask *m1,
192 const struct nf_conntrack_tuple_mask *m2)
166{ 193{
167 return (m1->src.u3.all[0] == m2->src.u3.all[0] && 194 return (nf_inet_addr_cmp(&m1->src.u3, &m2->src.u3) &&
168 m1->src.u3.all[1] == m2->src.u3.all[1] &&
169 m1->src.u3.all[2] == m2->src.u3.all[2] &&
170 m1->src.u3.all[3] == m2->src.u3.all[3] &&
171 m1->src.u.all == m2->src.u.all); 195 m1->src.u.all == m2->src.u.all);
172} 196}
173 197
174static inline int nf_ct_tuple_src_mask_cmp(const struct nf_conntrack_tuple *t1, 198static inline bool
175 const struct nf_conntrack_tuple *t2, 199nf_ct_tuple_src_mask_cmp(const struct nf_conntrack_tuple *t1,
176 const struct nf_conntrack_tuple_mask *mask) 200 const struct nf_conntrack_tuple *t2,
201 const struct nf_conntrack_tuple_mask *mask)
177{ 202{
178 int count; 203 int count;
179 204
180 for (count = 0; count < NF_CT_TUPLE_L3SIZE; count++) { 205 for (count = 0; count < NF_CT_TUPLE_L3SIZE; count++) {
181 if ((t1->src.u3.all[count] ^ t2->src.u3.all[count]) & 206 if ((t1->src.u3.all[count] ^ t2->src.u3.all[count]) &
182 mask->src.u3.all[count]) 207 mask->src.u3.all[count])
183 return 0; 208 return false;
184 } 209 }
185 210
186 if ((t1->src.u.all ^ t2->src.u.all) & mask->src.u.all) 211 if ((t1->src.u.all ^ t2->src.u.all) & mask->src.u.all)
187 return 0; 212 return false;
188 213
189 if (t1->src.l3num != t2->src.l3num || 214 if (t1->src.l3num != t2->src.l3num ||
190 t1->dst.protonum != t2->dst.protonum) 215 t1->dst.protonum != t2->dst.protonum)
191 return 0; 216 return false;
192 217
193 return 1; 218 return true;
194} 219}
195 220
196static inline int nf_ct_tuple_mask_cmp(const struct nf_conntrack_tuple *t, 221static inline bool
197 const struct nf_conntrack_tuple *tuple, 222nf_ct_tuple_mask_cmp(const struct nf_conntrack_tuple *t,
198 const struct nf_conntrack_tuple_mask *mask) 223 const struct nf_conntrack_tuple *tuple,
224 const struct nf_conntrack_tuple_mask *mask)
199{ 225{
200 return nf_ct_tuple_src_mask_cmp(t, tuple, mask) && 226 return nf_ct_tuple_src_mask_cmp(t, tuple, mask) &&
201 __nf_ct_tuple_dst_equal(t, tuple); 227 __nf_ct_tuple_dst_equal(t, tuple);
diff --git a/include/net/netfilter/nf_nat_helper.h b/include/net/netfilter/nf_nat_helper.h
index 58dd22687949..237a961f40e1 100644
--- a/include/net/netfilter/nf_nat_helper.h
+++ b/include/net/netfilter/nf_nat_helper.h
@@ -24,6 +24,9 @@ extern int nf_nat_mangle_udp_packet(struct sk_buff *skb,
24extern int nf_nat_seq_adjust(struct sk_buff *skb, 24extern int nf_nat_seq_adjust(struct sk_buff *skb,
25 struct nf_conn *ct, 25 struct nf_conn *ct,
26 enum ip_conntrack_info ctinfo); 26 enum ip_conntrack_info ctinfo);
27extern int (*nf_nat_seq_adjust_hook)(struct sk_buff *skb,
28 struct nf_conn *ct,
29 enum ip_conntrack_info ctinfo);
27 30
28/* Setup NAT on this expected conntrack so it follows master, but goes 31/* Setup NAT on this expected conntrack so it follows master, but goes
29 * to port ct->master->saved_proto. */ 32 * to port ct->master->saved_proto. */
diff --git a/include/net/netfilter/nf_nat_protocol.h b/include/net/netfilter/nf_nat_protocol.h
index 4aa0edbb5b96..f3662c4394ef 100644
--- a/include/net/netfilter/nf_nat_protocol.h
+++ b/include/net/netfilter/nf_nat_protocol.h
@@ -8,9 +8,6 @@ struct nf_nat_range;
8 8
9struct nf_nat_protocol 9struct nf_nat_protocol
10{ 10{
11 /* Protocol name */
12 const char *name;
13
14 /* Protocol number. */ 11 /* Protocol number. */
15 unsigned int protonum; 12 unsigned int protonum;
16 13
@@ -18,25 +15,25 @@ struct nf_nat_protocol
18 15
19 /* Translate a packet to the target according to manip type. 16 /* Translate a packet to the target according to manip type.
20 Return true if succeeded. */ 17 Return true if succeeded. */
21 int (*manip_pkt)(struct sk_buff *skb, 18 bool (*manip_pkt)(struct sk_buff *skb,
22 unsigned int iphdroff, 19 unsigned int iphdroff,
23 const struct nf_conntrack_tuple *tuple, 20 const struct nf_conntrack_tuple *tuple,
24 enum nf_nat_manip_type maniptype); 21 enum nf_nat_manip_type maniptype);
25 22
26 /* Is the manipable part of the tuple between min and max incl? */ 23 /* Is the manipable part of the tuple between min and max incl? */
27 int (*in_range)(const struct nf_conntrack_tuple *tuple, 24 bool (*in_range)(const struct nf_conntrack_tuple *tuple,
28 enum nf_nat_manip_type maniptype, 25 enum nf_nat_manip_type maniptype,
29 const union nf_conntrack_man_proto *min, 26 const union nf_conntrack_man_proto *min,
30 const union nf_conntrack_man_proto *max); 27 const union nf_conntrack_man_proto *max);
31 28
32 /* Alter the per-proto part of the tuple (depending on 29 /* Alter the per-proto part of the tuple (depending on
33 maniptype), to give a unique tuple in the given range if 30 maniptype), to give a unique tuple in the given range if
34 possible; return false if not. Per-protocol part of tuple 31 possible; return false if not. Per-protocol part of tuple
35 is initialized to the incoming packet. */ 32 is initialized to the incoming packet. */
36 int (*unique_tuple)(struct nf_conntrack_tuple *tuple, 33 bool (*unique_tuple)(struct nf_conntrack_tuple *tuple,
37 const struct nf_nat_range *range, 34 const struct nf_nat_range *range,
38 enum nf_nat_manip_type maniptype, 35 enum nf_nat_manip_type maniptype,
39 const struct nf_conn *ct); 36 const struct nf_conn *ct);
40 37
41 int (*range_to_nlattr)(struct sk_buff *skb, 38 int (*range_to_nlattr)(struct sk_buff *skb,
42 const struct nf_nat_range *range); 39 const struct nf_nat_range *range);
@@ -62,9 +59,20 @@ extern int init_protocols(void) __init;
62extern void cleanup_protocols(void); 59extern void cleanup_protocols(void);
63extern const struct nf_nat_protocol *find_nat_proto(u_int16_t protonum); 60extern const struct nf_nat_protocol *find_nat_proto(u_int16_t protonum);
64 61
65extern int nf_nat_port_range_to_nlattr(struct sk_buff *skb, 62extern bool nf_nat_proto_in_range(const struct nf_conntrack_tuple *tuple,
66 const struct nf_nat_range *range); 63 enum nf_nat_manip_type maniptype,
67extern int nf_nat_port_nlattr_to_range(struct nlattr *tb[], 64 const union nf_conntrack_man_proto *min,
68 struct nf_nat_range *range); 65 const union nf_conntrack_man_proto *max);
66
67extern bool nf_nat_proto_unique_tuple(struct nf_conntrack_tuple *tuple,
68 const struct nf_nat_range *range,
69 enum nf_nat_manip_type maniptype,
70 const struct nf_conn *ct,
71 u_int16_t *rover);
72
73extern int nf_nat_proto_range_to_nlattr(struct sk_buff *skb,
74 const struct nf_nat_range *range);
75extern int nf_nat_proto_nlattr_to_range(struct nlattr *tb[],
76 struct nf_nat_range *range);
69 77
70#endif /*_NF_NAT_PROTO_H*/ 78#endif /*_NF_NAT_PROTO_H*/
diff --git a/include/net/netfilter/nf_nat_rule.h b/include/net/netfilter/nf_nat_rule.h
index 75d1825031d7..e4a18ae361c6 100644
--- a/include/net/netfilter/nf_nat_rule.h
+++ b/include/net/netfilter/nf_nat_rule.h
@@ -14,7 +14,4 @@ extern int nf_nat_rule_find(struct sk_buff *skb,
14 14
15extern unsigned int 15extern unsigned int
16alloc_null_binding(struct nf_conn *ct, unsigned int hooknum); 16alloc_null_binding(struct nf_conn *ct, unsigned int hooknum);
17
18extern unsigned int
19alloc_null_binding_confirmed(struct nf_conn *ct, unsigned int hooknum);
20#endif /* _NF_NAT_RULE_H */ 17#endif /* _NF_NAT_RULE_H */
diff --git a/include/net/netlabel.h b/include/net/netlabel.h
index 0ca67d73c7ad..5e53a85b5ca1 100644
--- a/include/net/netlabel.h
+++ b/include/net/netlabel.h
@@ -162,7 +162,7 @@ struct netlbl_lsm_secattr_catmap {
162 162
163/** 163/**
164 * struct netlbl_lsm_secattr - NetLabel LSM security attributes 164 * struct netlbl_lsm_secattr - NetLabel LSM security attributes
165 * @flags: indicate which attributes are contained in this structure 165 * @flags: indicate structure attributes, see NETLBL_SECATTR_*
166 * @type: indicate the NLTYPE of the attributes 166 * @type: indicate the NLTYPE of the attributes
167 * @domain: the NetLabel LSM domain 167 * @domain: the NetLabel LSM domain
168 * @cache: NetLabel LSM specific cache 168 * @cache: NetLabel LSM specific cache
@@ -180,17 +180,22 @@ struct netlbl_lsm_secattr_catmap {
180 * NetLabel itself when returning security attributes to the LSM. 180 * NetLabel itself when returning security attributes to the LSM.
181 * 181 *
182 */ 182 */
183struct netlbl_lsm_secattr {
184 u32 flags;
185 /* bitmap values for 'flags' */
183#define NETLBL_SECATTR_NONE 0x00000000 186#define NETLBL_SECATTR_NONE 0x00000000
184#define NETLBL_SECATTR_DOMAIN 0x00000001 187#define NETLBL_SECATTR_DOMAIN 0x00000001
188#define NETLBL_SECATTR_DOMAIN_CPY (NETLBL_SECATTR_DOMAIN | \
189 NETLBL_SECATTR_FREE_DOMAIN)
185#define NETLBL_SECATTR_CACHE 0x00000002 190#define NETLBL_SECATTR_CACHE 0x00000002
186#define NETLBL_SECATTR_MLS_LVL 0x00000004 191#define NETLBL_SECATTR_MLS_LVL 0x00000004
187#define NETLBL_SECATTR_MLS_CAT 0x00000008 192#define NETLBL_SECATTR_MLS_CAT 0x00000008
188#define NETLBL_SECATTR_SECID 0x00000010 193#define NETLBL_SECATTR_SECID 0x00000010
194 /* bitmap meta-values for 'flags' */
195#define NETLBL_SECATTR_FREE_DOMAIN 0x01000000
189#define NETLBL_SECATTR_CACHEABLE (NETLBL_SECATTR_MLS_LVL | \ 196#define NETLBL_SECATTR_CACHEABLE (NETLBL_SECATTR_MLS_LVL | \
190 NETLBL_SECATTR_MLS_CAT | \ 197 NETLBL_SECATTR_MLS_CAT | \
191 NETLBL_SECATTR_SECID) 198 NETLBL_SECATTR_SECID)
192struct netlbl_lsm_secattr {
193 u32 flags;
194 u32 type; 199 u32 type;
195 char *domain; 200 char *domain;
196 struct netlbl_lsm_cache *cache; 201 struct netlbl_lsm_cache *cache;
@@ -303,7 +308,8 @@ static inline void netlbl_secattr_init(struct netlbl_lsm_secattr *secattr)
303 */ 308 */
304static inline void netlbl_secattr_destroy(struct netlbl_lsm_secattr *secattr) 309static inline void netlbl_secattr_destroy(struct netlbl_lsm_secattr *secattr)
305{ 310{
306 kfree(secattr->domain); 311 if (secattr->flags & NETLBL_SECATTR_FREE_DOMAIN)
312 kfree(secattr->domain);
307 if (secattr->flags & NETLBL_SECATTR_CACHE) 313 if (secattr->flags & NETLBL_SECATTR_CACHE)
308 netlbl_secattr_cache_free(secattr->cache); 314 netlbl_secattr_cache_free(secattr->cache);
309 if (secattr->flags & NETLBL_SECATTR_MLS_CAT) 315 if (secattr->flags & NETLBL_SECATTR_MLS_CAT)
diff --git a/include/net/netns/core.h b/include/net/netns/core.h
new file mode 100644
index 000000000000..24d4be76bbd1
--- /dev/null
+++ b/include/net/netns/core.h
@@ -0,0 +1,16 @@
1#ifndef __NETNS_CORE_H__
2#define __NETNS_CORE_H__
3
4struct ctl_table_header;
5struct prot_inuse;
6
7struct netns_core {
8 /* core sysctls */
9 struct ctl_table_header *sysctl_hdr;
10
11 int sysctl_somaxconn;
12
13 struct prot_inuse *inuse;
14};
15
16#endif
diff --git a/include/net/netns/dccp.h b/include/net/netns/dccp.h
new file mode 100644
index 000000000000..98d2a7ce1f71
--- /dev/null
+++ b/include/net/netns/dccp.h
@@ -0,0 +1,11 @@
1#ifndef __NETNS_DCCP_H__
2#define __NETNS_DCCP_H__
3
4struct sock;
5
6struct netns_dccp {
7 struct sock *v4_ctl_sk;
8 struct sock *v6_ctl_sk;
9};
10
11#endif
diff --git a/include/net/netns/generic.h b/include/net/netns/generic.h
new file mode 100644
index 000000000000..0c04fd2a700b
--- /dev/null
+++ b/include/net/netns/generic.h
@@ -0,0 +1,49 @@
1/*
2 * generic net pointers
3 */
4
5#ifndef __NET_GENERIC_H__
6#define __NET_GENERIC_H__
7
8#include <linux/rcupdate.h>
9
10/*
11 * Generic net pointers are to be used by modules to put some private
12 * stuff on the struct net without explicit struct net modification
13 *
14 * The rules are simple:
15 * 1. register the ops with register_pernet_gen_device to get the id
16 * of your private pointer;
17 * 2. call net_assign_generic() to put the private data on the struct
18 * net (most preferably this should be done in the ->init callback
19 * of the ops registered);
20 * 3. do not change this pointer while the net is alive;
21 * 4. do not try to have any private reference on the net_generic object.
22 *
23 * After accomplishing all of the above, the private pointer can be
24 * accessed with the net_generic() call.
25 */
26
27struct net_generic {
28 unsigned int len;
29 struct rcu_head rcu;
30
31 void *ptr[0];
32};
33
34static inline void *net_generic(struct net *net, int id)
35{
36 struct net_generic *ng;
37 void *ptr;
38
39 rcu_read_lock();
40 ng = rcu_dereference(net->gen);
41 BUG_ON(id == 0 || id > ng->len);
42 ptr = ng->ptr[id - 1];
43 rcu_read_unlock();
44
45 return ptr;
46}
47
48extern int net_assign_generic(struct net *net, int id, void *data);
49#endif
diff --git a/include/net/netns/ipv4.h b/include/net/netns/ipv4.h
index a9b4f6086294..34ee348a2cf2 100644
--- a/include/net/netns/ipv4.h
+++ b/include/net/netns/ipv4.h
@@ -17,6 +17,7 @@ struct netns_ipv4 {
17#ifdef CONFIG_SYSCTL 17#ifdef CONFIG_SYSCTL
18 struct ctl_table_header *forw_hdr; 18 struct ctl_table_header *forw_hdr;
19 struct ctl_table_header *frags_hdr; 19 struct ctl_table_header *frags_hdr;
20 struct ctl_table_header *ipv4_hdr;
20#endif 21#endif
21 struct ipv4_devconf *devconf_all; 22 struct ipv4_devconf *devconf_all;
22 struct ipv4_devconf *devconf_dflt; 23 struct ipv4_devconf *devconf_dflt;
@@ -26,6 +27,9 @@ struct netns_ipv4 {
26 struct hlist_head *fib_table_hash; 27 struct hlist_head *fib_table_hash;
27 struct sock *fibnl; 28 struct sock *fibnl;
28 29
30 struct sock **icmp_sk;
31 struct sock *tcp_sock;
32
29 struct netns_frags frags; 33 struct netns_frags frags;
30#ifdef CONFIG_NETFILTER 34#ifdef CONFIG_NETFILTER
31 struct xt_table *iptable_filter; 35 struct xt_table *iptable_filter;
@@ -33,5 +37,12 @@ struct netns_ipv4 {
33 struct xt_table *iptable_raw; 37 struct xt_table *iptable_raw;
34 struct xt_table *arptable_filter; 38 struct xt_table *arptable_filter;
35#endif 39#endif
40
41 int sysctl_icmp_echo_ignore_all;
42 int sysctl_icmp_echo_ignore_broadcasts;
43 int sysctl_icmp_ignore_bogus_error_responses;
44 int sysctl_icmp_ratelimit;
45 int sysctl_icmp_ratemask;
46 int sysctl_icmp_errors_use_inbound_ifaddr;
36}; 47};
37#endif 48#endif
diff --git a/include/net/netns/ipv6.h b/include/net/netns/ipv6.h
index 1dd7de4e4195..ac053be6c256 100644
--- a/include/net/netns/ipv6.h
+++ b/include/net/netns/ipv6.h
@@ -36,5 +36,23 @@ struct netns_ipv6 {
36 struct xt_table *ip6table_mangle; 36 struct xt_table *ip6table_mangle;
37 struct xt_table *ip6table_raw; 37 struct xt_table *ip6table_raw;
38#endif 38#endif
39 struct rt6_info *ip6_null_entry;
40 struct rt6_statistics *rt6_stats;
41 struct timer_list *ip6_fib_timer;
42 struct hlist_head *fib_table_hash;
43 struct fib6_table *fib6_main_tbl;
44 struct dst_ops *ip6_dst_ops;
45 unsigned int ip6_rt_gc_expire;
46 unsigned long ip6_rt_last_gc;
47#ifdef CONFIG_IPV6_MULTIPLE_TABLES
48 struct rt6_info *ip6_prohibit_entry;
49 struct rt6_info *ip6_blk_hole_entry;
50 struct fib6_table *fib6_local_tbl;
51 struct fib_rules_ops *fib6_rules_ops;
52#endif
53 struct sock **icmp_sk;
54 struct sock *ndisc_sk;
55 struct sock *tcp_sk;
56 struct sock *igmp_sk;
39}; 57};
40#endif 58#endif
diff --git a/include/net/pkt_cls.h b/include/net/pkt_cls.h
index d349c66ef828..aa9e282db485 100644
--- a/include/net/pkt_cls.h
+++ b/include/net/pkt_cls.h
@@ -353,7 +353,7 @@ tcf_match_indev(struct sk_buff *skb, char *indev)
353 if (indev[0]) { 353 if (indev[0]) {
354 if (!skb->iif) 354 if (!skb->iif)
355 return 0; 355 return 0;
356 dev = __dev_get_by_index(&init_net, skb->iif); 356 dev = __dev_get_by_index(dev_net(skb->dev), skb->iif);
357 if (!dev || strcmp(indev, dev->name)) 357 if (!dev || strcmp(indev, dev->name))
358 return 0; 358 return 0;
359 } 359 }
diff --git a/include/net/protocol.h b/include/net/protocol.h
index ad8c584233a6..8d024d7cb741 100644
--- a/include/net/protocol.h
+++ b/include/net/protocol.h
@@ -39,7 +39,8 @@ struct net_protocol {
39 int (*gso_send_check)(struct sk_buff *skb); 39 int (*gso_send_check)(struct sk_buff *skb);
40 struct sk_buff *(*gso_segment)(struct sk_buff *skb, 40 struct sk_buff *(*gso_segment)(struct sk_buff *skb,
41 int features); 41 int features);
42 int no_policy; 42 unsigned int no_policy:1,
43 netns_ok:1;
43}; 44};
44 45
45#if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE) 46#if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE)
diff --git a/include/net/raw.h b/include/net/raw.h
index 1828f81fe374..6c14a656357a 100644
--- a/include/net/raw.h
+++ b/include/net/raw.h
@@ -53,7 +53,7 @@ int raw_seq_open(struct inode *ino, struct file *file,
53 53
54#endif 54#endif
55 55
56void raw_hash_sk(struct sock *sk, struct raw_hashinfo *h); 56void raw_hash_sk(struct sock *sk);
57void raw_unhash_sk(struct sock *sk, struct raw_hashinfo *h); 57void raw_unhash_sk(struct sock *sk);
58 58
59#endif /* _RAW_H */ 59#endif /* _RAW_H */
diff --git a/include/net/request_sock.h b/include/net/request_sock.h
index cff4608179c1..b220b5f624de 100644
--- a/include/net/request_sock.h
+++ b/include/net/request_sock.h
@@ -31,8 +31,7 @@ struct request_sock_ops {
31 int obj_size; 31 int obj_size;
32 struct kmem_cache *slab; 32 struct kmem_cache *slab;
33 int (*rtx_syn_ack)(struct sock *sk, 33 int (*rtx_syn_ack)(struct sock *sk,
34 struct request_sock *req, 34 struct request_sock *req);
35 struct dst_entry *dst);
36 void (*send_ack)(struct sk_buff *skb, 35 void (*send_ack)(struct sk_buff *skb,
37 struct request_sock *req); 36 struct request_sock *req);
38 void (*send_reset)(struct sock *sk, 37 void (*send_reset)(struct sock *sk,
@@ -46,7 +45,7 @@ struct request_sock {
46 struct request_sock *dl_next; /* Must be first member! */ 45 struct request_sock *dl_next; /* Must be first member! */
47 u16 mss; 46 u16 mss;
48 u8 retrans; 47 u8 retrans;
49 u8 __pad; 48 u8 cookie_ts; /* syncookie: encode tcpopts in timestamp */
50 /* The following two fields can be easily recomputed I think -AK */ 49 /* The following two fields can be easily recomputed I think -AK */
51 u32 window_clamp; /* window clamp at creation time */ 50 u32 window_clamp; /* window clamp at creation time */
52 u32 rcv_wnd; /* rcv_wnd offered first time */ 51 u32 rcv_wnd; /* rcv_wnd offered first time */
@@ -116,8 +115,8 @@ struct request_sock_queue {
116 struct request_sock *rskq_accept_head; 115 struct request_sock *rskq_accept_head;
117 struct request_sock *rskq_accept_tail; 116 struct request_sock *rskq_accept_tail;
118 rwlock_t syn_wait_lock; 117 rwlock_t syn_wait_lock;
119 u8 rskq_defer_accept; 118 u16 rskq_defer_accept;
120 /* 3 bytes hole, try to pack */ 119 /* 2 bytes hole, try to pack */
121 struct listen_sock *listen_opt; 120 struct listen_sock *listen_opt;
122}; 121};
123 122
diff --git a/include/net/route.h b/include/net/route.h
index eadad5901429..c6338802e8f1 100644
--- a/include/net/route.h
+++ b/include/net/route.h
@@ -34,7 +34,6 @@
34#include <linux/ip.h> 34#include <linux/ip.h>
35#include <linux/cache.h> 35#include <linux/cache.h>
36#include <linux/security.h> 36#include <linux/security.h>
37#include <net/sock.h>
38 37
39#ifndef __KERNEL__ 38#ifndef __KERNEL__
40#warning This file is not supposed to be used outside of kernel. 39#warning This file is not supposed to be used outside of kernel.
@@ -161,7 +160,7 @@ static inline int ip_route_connect(struct rtable **rp, __be32 dst,
161 .dport = dport } } }; 160 .dport = dport } } };
162 161
163 int err; 162 int err;
164 struct net *net = sk->sk_net; 163 struct net *net = sock_net(sk);
165 if (!dst || !src) { 164 if (!dst || !src) {
166 err = __ip_route_output_key(net, rp, &fl); 165 err = __ip_route_output_key(net, rp, &fl);
167 if (err) 166 if (err)
@@ -189,7 +188,7 @@ static inline int ip_route_newports(struct rtable **rp, u8 protocol,
189 ip_rt_put(*rp); 188 ip_rt_put(*rp);
190 *rp = NULL; 189 *rp = NULL;
191 security_sk_classify_flow(sk, &fl); 190 security_sk_classify_flow(sk, &fl);
192 return ip_route_output_flow(sk->sk_net, rp, &fl, sk, 0); 191 return ip_route_output_flow(sock_net(sk), rp, &fl, sk, 0);
193 } 192 }
194 return 0; 193 return 0;
195} 194}
diff --git a/include/net/rtnetlink.h b/include/net/rtnetlink.h
index 793863e09c69..3c1895e54b7f 100644
--- a/include/net/rtnetlink.h
+++ b/include/net/rtnetlink.h
@@ -74,6 +74,7 @@ struct rtnl_link_ops {
74 74
75extern int __rtnl_link_register(struct rtnl_link_ops *ops); 75extern int __rtnl_link_register(struct rtnl_link_ops *ops);
76extern void __rtnl_link_unregister(struct rtnl_link_ops *ops); 76extern void __rtnl_link_unregister(struct rtnl_link_ops *ops);
77extern void rtnl_kill_links(struct net *net, struct rtnl_link_ops *ops);
77 78
78extern int rtnl_link_register(struct rtnl_link_ops *ops); 79extern int rtnl_link_register(struct rtnl_link_ops *ops);
79extern void rtnl_link_unregister(struct rtnl_link_ops *ops); 80extern void rtnl_link_unregister(struct rtnl_link_ops *ops);
diff --git a/include/net/sctp/command.h b/include/net/sctp/command.h
index 35b1e83fb96a..88988ab03d75 100644
--- a/include/net/sctp/command.h
+++ b/include/net/sctp/command.h
@@ -206,12 +206,11 @@ typedef struct {
206int sctp_init_cmd_seq(sctp_cmd_seq_t *seq); 206int sctp_init_cmd_seq(sctp_cmd_seq_t *seq);
207 207
208/* Add a command to an sctp_cmd_seq_t. 208/* Add a command to an sctp_cmd_seq_t.
209 * Return 0 if the command sequence is full.
210 * 209 *
211 * Use the SCTP_* constructors defined by SCTP_ARG_CONSTRUCTOR() above 210 * Use the SCTP_* constructors defined by SCTP_ARG_CONSTRUCTOR() above
212 * to wrap data which goes in the obj argument. 211 * to wrap data which goes in the obj argument.
213 */ 212 */
214int sctp_add_cmd(sctp_cmd_seq_t *seq, sctp_verb_t verb, sctp_arg_t obj); 213void sctp_add_cmd_sf(sctp_cmd_seq_t *seq, sctp_verb_t verb, sctp_arg_t obj);
215 214
216/* Return the next command structure in an sctp_cmd_seq. 215/* Return the next command structure in an sctp_cmd_seq.
217 * Return NULL at the end of the sequence. 216 * Return NULL at the end of the sequence.
diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h
index ea806732b084..90b1e8d23b16 100644
--- a/include/net/sctp/sctp.h
+++ b/include/net/sctp/sctp.h
@@ -368,11 +368,6 @@ void sctp_sysctl_unregister(void);
368#else 368#else
369static inline void sctp_sysctl_register(void) { return; } 369static inline void sctp_sysctl_register(void) { return; }
370static inline void sctp_sysctl_unregister(void) { return; } 370static inline void sctp_sysctl_unregister(void) { return; }
371static inline int sctp_sysctl_jiffies_ms(ctl_table *table, int __user *name, int nlen,
372 void __user *oldval, size_t __user *oldlenp,
373 void __user *newval, size_t newlen) {
374 return -ENOSYS;
375}
376#endif 371#endif
377 372
378/* Size of Supported Address Parameter for 'x' address types. */ 373/* Size of Supported Address Parameter for 'x' address types. */
diff --git a/include/net/sctp/sm.h b/include/net/sctp/sm.h
index ef9e7ed2c82e..24811732bdb2 100644
--- a/include/net/sctp/sm.h
+++ b/include/net/sctp/sm.h
@@ -385,14 +385,6 @@ static inline int ADDIP_SERIAL_gte(__u16 s, __u16 t)
385 return (((s) == (t)) || (((t) - (s)) & ADDIP_SERIAL_SIGN_BIT)); 385 return (((s) == (t)) || (((t) - (s)) & ADDIP_SERIAL_SIGN_BIT));
386} 386}
387 387
388
389/* Run sctp_add_cmd() generating a BUG() if there is a failure. */
390static inline void sctp_add_cmd_sf(sctp_cmd_seq_t *seq, sctp_verb_t verb, sctp_arg_t obj)
391{
392 if (unlikely(!sctp_add_cmd(seq, verb, obj)))
393 BUG();
394}
395
396/* Check VTAG of the packet matches the sender's own tag. */ 388/* Check VTAG of the packet matches the sender's own tag. */
397static inline int 389static inline int
398sctp_vtag_verify(const struct sctp_chunk *chunk, 390sctp_vtag_verify(const struct sctp_chunk *chunk,
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h
index 9c827a749b6f..0ce0443c5b79 100644
--- a/include/net/sctp/structs.h
+++ b/include/net/sctp/structs.h
@@ -637,8 +637,6 @@ struct sctp_datamsg *sctp_datamsg_from_user(struct sctp_association *,
637 struct sctp_sndrcvinfo *, 637 struct sctp_sndrcvinfo *,
638 struct msghdr *, int len); 638 struct msghdr *, int len);
639void sctp_datamsg_put(struct sctp_datamsg *); 639void sctp_datamsg_put(struct sctp_datamsg *);
640void sctp_datamsg_free(struct sctp_datamsg *);
641void sctp_datamsg_track(struct sctp_chunk *);
642void sctp_chunk_fail(struct sctp_chunk *, int error); 640void sctp_chunk_fail(struct sctp_chunk *, int error);
643int sctp_chunk_abandoned(struct sctp_chunk *); 641int sctp_chunk_abandoned(struct sctp_chunk *);
644 642
@@ -1661,6 +1659,9 @@ struct sctp_association {
1661 /* Transport to which SHUTDOWN chunk was last sent. */ 1659 /* Transport to which SHUTDOWN chunk was last sent. */
1662 struct sctp_transport *shutdown_last_sent_to; 1660 struct sctp_transport *shutdown_last_sent_to;
1663 1661
1662 /* How many times have we resent a SHUTDOWN */
1663 int shutdown_retries;
1664
1664 /* Transport to which INIT chunk was last sent. */ 1665 /* Transport to which INIT chunk was last sent. */
1665 struct sctp_transport *init_last_sent_to; 1666 struct sctp_transport *init_last_sent_to;
1666 1667
@@ -1695,6 +1696,11 @@ struct sctp_association {
1695 */ 1696 */
1696 __u16 unack_data; 1697 __u16 unack_data;
1697 1698
1699 /* The total number of data chunks that we've had to retransmit
1700 * as the result of a T3 timer expiration
1701 */
1702 __u32 rtx_data_chunks;
1703
1698 /* This is the association's receive buffer space. This value is used 1704 /* This is the association's receive buffer space. This value is used
1699 * to set a_rwnd field in an INIT or a SACK chunk. 1705 * to set a_rwnd field in an INIT or a SACK chunk.
1700 */ 1706 */
diff --git a/include/net/sock.h b/include/net/sock.h
index fd9876087651..dc42b44c2aa1 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -47,7 +47,6 @@
47#include <linux/module.h> 47#include <linux/module.h>
48#include <linux/lockdep.h> 48#include <linux/lockdep.h>
49#include <linux/netdevice.h> 49#include <linux/netdevice.h>
50#include <linux/pcounter.h>
51#include <linux/skbuff.h> /* struct sk_buff */ 50#include <linux/skbuff.h> /* struct sk_buff */
52#include <linux/mm.h> 51#include <linux/mm.h>
53#include <linux/security.h> 52#include <linux/security.h>
@@ -70,7 +69,11 @@
70#define SOCK_DEBUG(sk, msg...) do { if ((sk) && sock_flag((sk), SOCK_DBG)) \ 69#define SOCK_DEBUG(sk, msg...) do { if ((sk) && sock_flag((sk), SOCK_DBG)) \
71 printk(KERN_DEBUG msg); } while (0) 70 printk(KERN_DEBUG msg); } while (0)
72#else 71#else
73#define SOCK_DEBUG(sk, msg...) do { } while (0) 72/* Validate arguments and do nothing */
73static void inline int __attribute__ ((format (printf, 2, 3)))
74SOCK_DEBUG(struct sock *sk, const char *msg, ...)
75{
76}
74#endif 77#endif
75 78
76/* This is the per-socket lock. The spinlock provides a synchronization 79/* This is the per-socket lock. The spinlock provides a synchronization
@@ -122,7 +125,9 @@ struct sock_common {
122 atomic_t skc_refcnt; 125 atomic_t skc_refcnt;
123 unsigned int skc_hash; 126 unsigned int skc_hash;
124 struct proto *skc_prot; 127 struct proto *skc_prot;
128#ifdef CONFIG_NET_NS
125 struct net *skc_net; 129 struct net *skc_net;
130#endif
126}; 131};
127 132
128/** 133/**
@@ -151,6 +156,7 @@ struct sock_common {
151 * @sk_no_check: %SO_NO_CHECK setting, wether or not checkup packets 156 * @sk_no_check: %SO_NO_CHECK setting, wether or not checkup packets
152 * @sk_route_caps: route capabilities (e.g. %NETIF_F_TSO) 157 * @sk_route_caps: route capabilities (e.g. %NETIF_F_TSO)
153 * @sk_gso_type: GSO type (e.g. %SKB_GSO_TCPV4) 158 * @sk_gso_type: GSO type (e.g. %SKB_GSO_TCPV4)
159 * @sk_gso_max_size: Maximum GSO segment size to build
154 * @sk_lingertime: %SO_LINGER l_linger setting 160 * @sk_lingertime: %SO_LINGER l_linger setting
155 * @sk_backlog: always used with the per-socket spinlock held 161 * @sk_backlog: always used with the per-socket spinlock held
156 * @sk_callback_lock: used with the callbacks in the end of this struct 162 * @sk_callback_lock: used with the callbacks in the end of this struct
@@ -237,6 +243,7 @@ struct sock {
237 gfp_t sk_allocation; 243 gfp_t sk_allocation;
238 int sk_route_caps; 244 int sk_route_caps;
239 int sk_gso_type; 245 int sk_gso_type;
246 unsigned int sk_gso_max_size;
240 int sk_rcvlowat; 247 int sk_rcvlowat;
241 unsigned long sk_flags; 248 unsigned long sk_flags;
242 unsigned long sk_lingertime; 249 unsigned long sk_lingertime;
@@ -498,6 +505,7 @@ extern int sk_wait_data(struct sock *sk, long *timeo);
498struct request_sock_ops; 505struct request_sock_ops;
499struct timewait_sock_ops; 506struct timewait_sock_ops;
500struct inet_hashinfo; 507struct inet_hashinfo;
508struct raw_hashinfo;
501 509
502/* Networking protocol blocks we attach to sockets. 510/* Networking protocol blocks we attach to sockets.
503 * socket layer -> transport layer interface 511 * socket layer -> transport layer interface
@@ -553,7 +561,7 @@ struct proto {
553 561
554 /* Keeping track of sockets in use */ 562 /* Keeping track of sockets in use */
555#ifdef CONFIG_PROC_FS 563#ifdef CONFIG_PROC_FS
556 struct pcounter inuse; 564 unsigned int inuse_idx;
557#endif 565#endif
558 566
559 /* Memory pressure */ 567 /* Memory pressure */
@@ -580,7 +588,11 @@ struct proto {
580 struct request_sock_ops *rsk_prot; 588 struct request_sock_ops *rsk_prot;
581 struct timewait_sock_ops *twsk_prot; 589 struct timewait_sock_ops *twsk_prot;
582 590
583 struct inet_hashinfo *hashinfo; 591 union {
592 struct inet_hashinfo *hashinfo;
593 struct hlist_head *udp_hash;
594 struct raw_hashinfo *raw_hash;
595 } h;
584 596
585 struct module *owner; 597 struct module *owner;
586 598
@@ -622,36 +634,12 @@ static inline void sk_refcnt_debug_release(const struct sock *sk)
622 634
623 635
624#ifdef CONFIG_PROC_FS 636#ifdef CONFIG_PROC_FS
625# define DEFINE_PROTO_INUSE(NAME) DEFINE_PCOUNTER(NAME)
626# define REF_PROTO_INUSE(NAME) PCOUNTER_MEMBER_INITIALIZER(NAME, .inuse)
627/* Called with local bh disabled */ 637/* Called with local bh disabled */
628static inline void sock_prot_inuse_add(struct proto *prot, int inc) 638extern void sock_prot_inuse_add(struct net *net, struct proto *prot, int inc);
629{ 639extern int sock_prot_inuse_get(struct net *net, struct proto *proto);
630 pcounter_add(&prot->inuse, inc);
631}
632static inline int sock_prot_inuse_init(struct proto *proto)
633{
634 return pcounter_alloc(&proto->inuse);
635}
636static inline int sock_prot_inuse_get(struct proto *proto)
637{
638 return pcounter_getval(&proto->inuse);
639}
640static inline void sock_prot_inuse_free(struct proto *proto)
641{
642 pcounter_free(&proto->inuse);
643}
644#else 640#else
645# define DEFINE_PROTO_INUSE(NAME) 641static void inline sock_prot_inuse_add(struct net *net, struct proto *prot,
646# define REF_PROTO_INUSE(NAME) 642 int inc)
647static void inline sock_prot_inuse_add(struct proto *prot, int inc)
648{
649}
650static int inline sock_prot_inuse_init(struct proto *proto)
651{
652 return 0;
653}
654static void inline sock_prot_inuse_free(struct proto *proto)
655{ 643{
656} 644}
657#endif 645#endif
@@ -850,6 +838,7 @@ extern struct sock *sk_alloc(struct net *net, int family,
850 gfp_t priority, 838 gfp_t priority,
851 struct proto *prot); 839 struct proto *prot);
852extern void sk_free(struct sock *sk); 840extern void sk_free(struct sock *sk);
841extern void sk_release_kernel(struct sock *sk);
853extern struct sock *sk_clone(const struct sock *sk, 842extern struct sock *sk_clone(const struct sock *sk,
854 const gfp_t priority); 843 const gfp_t priority);
855 844
@@ -939,41 +928,6 @@ extern void sk_common_release(struct sock *sk);
939extern void sock_init_data(struct socket *sock, struct sock *sk); 928extern void sock_init_data(struct socket *sock, struct sock *sk);
940 929
941/** 930/**
942 * sk_filter - run a packet through a socket filter
943 * @sk: sock associated with &sk_buff
944 * @skb: buffer to filter
945 * @needlock: set to 1 if the sock is not locked by caller.
946 *
947 * Run the filter code and then cut skb->data to correct size returned by
948 * sk_run_filter. If pkt_len is 0 we toss packet. If skb->len is smaller
949 * than pkt_len we keep whole skb->data. This is the socket level
950 * wrapper to sk_run_filter. It returns 0 if the packet should
951 * be accepted or -EPERM if the packet should be tossed.
952 *
953 */
954
955static inline int sk_filter(struct sock *sk, struct sk_buff *skb)
956{
957 int err;
958 struct sk_filter *filter;
959
960 err = security_sock_rcv_skb(sk, skb);
961 if (err)
962 return err;
963
964 rcu_read_lock_bh();
965 filter = rcu_dereference(sk->sk_filter);
966 if (filter) {
967 unsigned int pkt_len = sk_run_filter(skb, filter->insns,
968 filter->len);
969 err = pkt_len ? pskb_trim(skb, pkt_len) : -EPERM;
970 }
971 rcu_read_unlock_bh();
972
973 return err;
974}
975
976/**
977 * sk_filter_release: Release a socket filter 931 * sk_filter_release: Release a socket filter
978 * @sk: socket 932 * @sk: socket
979 * @fp: filter to remove 933 * @fp: filter to remove
@@ -1333,6 +1287,36 @@ static inline void sk_eat_skb(struct sock *sk, struct sk_buff *skb, int copied_e
1333} 1287}
1334#endif 1288#endif
1335 1289
1290static inline
1291struct net *sock_net(const struct sock *sk)
1292{
1293#ifdef CONFIG_NET_NS
1294 return sk->sk_net;
1295#else
1296 return &init_net;
1297#endif
1298}
1299
1300static inline
1301void sock_net_set(struct sock *sk, struct net *net)
1302{
1303#ifdef CONFIG_NET_NS
1304 sk->sk_net = net;
1305#endif
1306}
1307
1308/*
1309 * Kernel sockets, f.e. rtnl or icmp_socket, are a part of a namespace.
1310 * They should not hold a referrence to a namespace in order to allow
1311 * to stop it.
1312 * Sockets after sk_change_net should be released using sk_release_kernel
1313 */
1314static inline void sk_change_net(struct sock *sk, struct net *net)
1315{
1316 put_net(sock_net(sk));
1317 sock_net_set(sk, hold_net(net));
1318}
1319
1336extern void sock_enable_timestamp(struct sock *sk); 1320extern void sock_enable_timestamp(struct sock *sk);
1337extern int sock_get_timestamp(struct sock *, struct timeval __user *); 1321extern int sock_get_timestamp(struct sock *, struct timeval __user *);
1338extern int sock_get_timestampns(struct sock *, struct timespec __user *); 1322extern int sock_get_timestampns(struct sock *, struct timespec __user *);
diff --git a/include/net/tcp.h b/include/net/tcp.h
index 4fd3eb2f8ec2..633147cb6bbc 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -29,6 +29,7 @@
29#include <linux/skbuff.h> 29#include <linux/skbuff.h>
30#include <linux/dmaengine.h> 30#include <linux/dmaengine.h>
31#include <linux/crypto.h> 31#include <linux/crypto.h>
32#include <linux/cryptohash.h>
32 33
33#include <net/inet_connection_sock.h> 34#include <net/inet_connection_sock.h>
34#include <net/inet_timewait_sock.h> 35#include <net/inet_timewait_sock.h>
@@ -138,6 +139,7 @@ extern void tcp_time_wait(struct sock *sk, int state, int timeo);
138#define MAX_TCP_KEEPINTVL 32767 139#define MAX_TCP_KEEPINTVL 32767
139#define MAX_TCP_KEEPCNT 127 140#define MAX_TCP_KEEPCNT 127
140#define MAX_TCP_SYNCNT 127 141#define MAX_TCP_SYNCNT 127
142#define MAX_TCP_ACCEPT_DEFERRED 65535
141 143
142#define TCP_SYNQ_INTERVAL (HZ/5) /* Period of SYNACK timer */ 144#define TCP_SYNQ_INTERVAL (HZ/5) /* Period of SYNACK timer */
143 145
@@ -434,11 +436,20 @@ extern int tcp_disconnect(struct sock *sk, int flags);
434extern void tcp_unhash(struct sock *sk); 436extern void tcp_unhash(struct sock *sk);
435 437
436/* From syncookies.c */ 438/* From syncookies.c */
439extern __u32 syncookie_secret[2][16-4+SHA_DIGEST_WORDS];
437extern struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb, 440extern struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb,
438 struct ip_options *opt); 441 struct ip_options *opt);
439extern __u32 cookie_v4_init_sequence(struct sock *sk, struct sk_buff *skb, 442extern __u32 cookie_v4_init_sequence(struct sock *sk, struct sk_buff *skb,
440 __u16 *mss); 443 __u16 *mss);
441 444
445extern __u32 cookie_init_timestamp(struct request_sock *req);
446extern void cookie_check_timestamp(struct tcp_options_received *tcp_opt);
447
448/* From net/ipv6/syncookies.c */
449extern struct sock *cookie_v6_check(struct sock *sk, struct sk_buff *skb);
450extern __u32 cookie_v6_init_sequence(struct sock *sk, struct sk_buff *skb,
451 __u16 *mss);
452
442/* tcp_output.c */ 453/* tcp_output.c */
443 454
444extern void __tcp_push_pending_frames(struct sock *sk, unsigned int cur_mss, 455extern void __tcp_push_pending_frames(struct sock *sk, unsigned int cur_mss,
@@ -776,11 +787,14 @@ extern void tcp_enter_cwr(struct sock *sk, const int set_ssthresh);
776extern __u32 tcp_init_cwnd(struct tcp_sock *tp, struct dst_entry *dst); 787extern __u32 tcp_init_cwnd(struct tcp_sock *tp, struct dst_entry *dst);
777 788
778/* Slow start with delack produces 3 packets of burst, so that 789/* Slow start with delack produces 3 packets of burst, so that
779 * it is safe "de facto". 790 * it is safe "de facto". This will be the default - same as
791 * the default reordering threshold - but if reordering increases,
792 * we must be able to allow cwnd to burst at least this much in order
793 * to not pull it back when holes are filled.
780 */ 794 */
781static __inline__ __u32 tcp_max_burst(const struct tcp_sock *tp) 795static __inline__ __u32 tcp_max_burst(const struct tcp_sock *tp)
782{ 796{
783 return 3; 797 return tp->reordering;
784} 798}
785 799
786/* Returns end sequence number of the receiver's advertised window */ 800/* Returns end sequence number of the receiver's advertised window */
@@ -950,6 +964,7 @@ static inline void tcp_openreq_init(struct request_sock *req,
950 struct inet_request_sock *ireq = inet_rsk(req); 964 struct inet_request_sock *ireq = inet_rsk(req);
951 965
952 req->rcv_wnd = 0; /* So that tcp_send_synack() knows! */ 966 req->rcv_wnd = 0; /* So that tcp_send_synack() knows! */
967 req->cookie_ts = 0;
953 tcp_rsk(req)->rcv_isn = TCP_SKB_CB(skb)->seq; 968 tcp_rsk(req)->rcv_isn = TCP_SKB_CB(skb)->seq;
954 req->mss = rx_opt->mss_clamp; 969 req->mss = rx_opt->mss_clamp;
955 req->ts_recent = rx_opt->saw_tstamp ? rx_opt->rcv_tsval : 0; 970 req->ts_recent = rx_opt->saw_tstamp ? rx_opt->rcv_tsval : 0;
@@ -1237,7 +1252,7 @@ static inline void tcp_insert_write_queue_after(struct sk_buff *skb,
1237 struct sk_buff *buff, 1252 struct sk_buff *buff,
1238 struct sock *sk) 1253 struct sock *sk)
1239{ 1254{
1240 __skb_append(skb, buff, &sk->sk_write_queue); 1255 __skb_queue_after(&sk->sk_write_queue, skb, buff);
1241} 1256}
1242 1257
1243/* Insert skb between prev and next on the write queue of sk. */ 1258/* Insert skb between prev and next on the write queue of sk. */
@@ -1315,25 +1330,25 @@ enum tcp_seq_states {
1315}; 1330};
1316 1331
1317struct tcp_seq_afinfo { 1332struct tcp_seq_afinfo {
1318 struct module *owner;
1319 char *name; 1333 char *name;
1320 sa_family_t family; 1334 sa_family_t family;
1321 int (*seq_show) (struct seq_file *m, void *v); 1335 struct file_operations seq_fops;
1322 struct file_operations *seq_fops; 1336 struct seq_operations seq_ops;
1323}; 1337};
1324 1338
1325struct tcp_iter_state { 1339struct tcp_iter_state {
1340 struct seq_net_private p;
1326 sa_family_t family; 1341 sa_family_t family;
1327 enum tcp_seq_states state; 1342 enum tcp_seq_states state;
1328 struct sock *syn_wait_sk; 1343 struct sock *syn_wait_sk;
1329 int bucket, sbucket, num, uid; 1344 int bucket, sbucket, num, uid;
1330 struct seq_operations seq_ops;
1331}; 1345};
1332 1346
1333extern int tcp_proc_register(struct tcp_seq_afinfo *afinfo); 1347extern int tcp_proc_register(struct net *net, struct tcp_seq_afinfo *afinfo);
1334extern void tcp_proc_unregister(struct tcp_seq_afinfo *afinfo); 1348extern void tcp_proc_unregister(struct net *net, struct tcp_seq_afinfo *afinfo);
1335 1349
1336extern struct request_sock_ops tcp_request_sock_ops; 1350extern struct request_sock_ops tcp_request_sock_ops;
1351extern struct request_sock_ops tcp6_request_sock_ops;
1337 1352
1338extern int tcp_v4_destroy_sock(struct sock *sk); 1353extern int tcp_v4_destroy_sock(struct sock *sk);
1339 1354
@@ -1375,7 +1390,7 @@ struct tcp_request_sock_ops {
1375#endif 1390#endif
1376}; 1391};
1377 1392
1378extern void tcp_v4_init(struct net_proto_family *ops); 1393extern void tcp_v4_init(void);
1379extern void tcp_init(void); 1394extern void tcp_init(void);
1380 1395
1381#endif /* _TCP_H */ 1396#endif /* _TCP_H */
diff --git a/include/net/tipc/tipc_bearer.h b/include/net/tipc/tipc_bearer.h
index 2151a80cdf30..ee2f304e4919 100644
--- a/include/net/tipc/tipc_bearer.h
+++ b/include/net/tipc/tipc_bearer.h
@@ -99,6 +99,9 @@ struct tipc_bearer {
99 char name[TIPC_MAX_BEARER_NAME]; 99 char name[TIPC_MAX_BEARER_NAME];
100}; 100};
101 101
102/*
103 * TIPC routines available to supported media types
104 */
102 105
103int tipc_register_media(u32 media_type, 106int tipc_register_media(u32 media_type,
104 char *media_name, 107 char *media_name,
@@ -123,6 +126,12 @@ void tipc_continue(struct tipc_bearer *tb_ptr);
123int tipc_enable_bearer(const char *bearer_name, u32 bcast_scope, u32 priority); 126int tipc_enable_bearer(const char *bearer_name, u32 bcast_scope, u32 priority);
124int tipc_disable_bearer(const char *name); 127int tipc_disable_bearer(const char *name);
125 128
129/*
130 * Routines made available to TIPC by supported media types
131 */
132
133int tipc_eth_media_start(void);
134void tipc_eth_media_stop(void);
126 135
127#endif 136#endif
128 137
diff --git a/include/net/tipc/tipc_port.h b/include/net/tipc/tipc_port.h
index cfc4ba46de8f..11105bcc4457 100644
--- a/include/net/tipc/tipc_port.h
+++ b/include/net/tipc/tipc_port.h
@@ -86,13 +86,6 @@ u32 tipc_createport_raw(void *usr_handle,
86 void (*wakeup)(struct tipc_port *), 86 void (*wakeup)(struct tipc_port *),
87 const u32 importance); 87 const u32 importance);
88 88
89/*
90 * tipc_set_msg_option(): port must be locked.
91 */
92int tipc_set_msg_option(struct tipc_port *tp_ptr,
93 const char *opt,
94 const u32 len);
95
96int tipc_reject_msg(struct sk_buff *buf, u32 err); 89int tipc_reject_msg(struct sk_buff *buf, u32 err);
97 90
98int tipc_send_buf_fast(struct sk_buff *buf, u32 destnode); 91int tipc_send_buf_fast(struct sk_buff *buf, u32 destnode);
@@ -103,6 +96,12 @@ struct tipc_port *tipc_get_port(const u32 ref);
103 96
104void *tipc_get_handle(const u32 ref); 97void *tipc_get_handle(const u32 ref);
105 98
99/*
100 * The following routines require that the port be locked on entry
101 */
102
103int tipc_disconnect_port(struct tipc_port *tp_ptr);
104
106 105
107#endif 106#endif
108 107
diff --git a/include/net/udp.h b/include/net/udp.h
index c6669c0a74c7..3e55a99b0ba3 100644
--- a/include/net/udp.h
+++ b/include/net/udp.h
@@ -115,7 +115,7 @@ static inline void udp_lib_unhash(struct sock *sk)
115 write_lock_bh(&udp_hash_lock); 115 write_lock_bh(&udp_hash_lock);
116 if (sk_del_node_init(sk)) { 116 if (sk_del_node_init(sk)) {
117 inet_sk(sk)->num = 0; 117 inet_sk(sk)->num = 0;
118 sock_prot_inuse_add(sk->sk_prot, -1); 118 sock_prot_inuse_add(sock_net(sk), sk->sk_prot, -1);
119 } 119 }
120 write_unlock_bh(&udp_hash_lock); 120 write_unlock_bh(&udp_hash_lock);
121} 121}
@@ -125,6 +125,8 @@ static inline void udp_lib_close(struct sock *sk, long timeout)
125 sk_common_release(sk); 125 sk_common_release(sk);
126} 126}
127 127
128extern int udp_lib_get_port(struct sock *sk, unsigned short snum,
129 int (*)(const struct sock*,const struct sock*));
128 130
129/* net/ipv4/udp.c */ 131/* net/ipv4/udp.c */
130extern int udp_get_port(struct sock *sk, unsigned short snum, 132extern int udp_get_port(struct sock *sk, unsigned short snum,
@@ -183,24 +185,23 @@ DECLARE_SNMP_STAT(struct udp_mib, udplite_stats_in6);
183 185
184/* /proc */ 186/* /proc */
185struct udp_seq_afinfo { 187struct udp_seq_afinfo {
186 struct module *owner;
187 char *name; 188 char *name;
188 sa_family_t family; 189 sa_family_t family;
189 struct hlist_head *hashtable; 190 struct hlist_head *hashtable;
190 int (*seq_show) (struct seq_file *m, void *v); 191 struct file_operations seq_fops;
191 struct file_operations *seq_fops; 192 struct seq_operations seq_ops;
192}; 193};
193 194
194struct udp_iter_state { 195struct udp_iter_state {
196 struct seq_net_private p;
195 sa_family_t family; 197 sa_family_t family;
196 struct hlist_head *hashtable; 198 struct hlist_head *hashtable;
197 int bucket; 199 int bucket;
198 struct seq_operations seq_ops;
199}; 200};
200 201
201#ifdef CONFIG_PROC_FS 202#ifdef CONFIG_PROC_FS
202extern int udp_proc_register(struct udp_seq_afinfo *afinfo); 203extern int udp_proc_register(struct net *net, struct udp_seq_afinfo *afinfo);
203extern void udp_proc_unregister(struct udp_seq_afinfo *afinfo); 204extern void udp_proc_unregister(struct net *net, struct udp_seq_afinfo *afinfo);
204 205
205extern int udp4_proc_init(void); 206extern int udp4_proc_init(void);
206extern void udp4_proc_exit(void); 207extern void udp4_proc_exit(void);
diff --git a/include/net/wireless.h b/include/net/wireless.h
index d30c4ba8fd99..667b4080d30f 100644
--- a/include/net/wireless.h
+++ b/include/net/wireless.h
@@ -13,6 +13,162 @@
13#include <net/cfg80211.h> 13#include <net/cfg80211.h>
14 14
15/** 15/**
16 * enum ieee80211_band - supported frequency bands
17 *
18 * The bands are assigned this way because the supported
19 * bitrates differ in these bands.
20 *
21 * @IEEE80211_BAND_2GHZ: 2.4GHz ISM band
22 * @IEEE80211_BAND_5GHZ: around 5GHz band (4.9-5.7)
23 */
24enum ieee80211_band {
25 IEEE80211_BAND_2GHZ,
26 IEEE80211_BAND_5GHZ,
27
28 /* keep last */
29 IEEE80211_NUM_BANDS
30};
31
32/**
33 * enum ieee80211_channel_flags - channel flags
34 *
35 * Channel flags set by the regulatory control code.
36 *
37 * @IEEE80211_CHAN_DISABLED: This channel is disabled.
38 * @IEEE80211_CHAN_PASSIVE_SCAN: Only passive scanning is permitted
39 * on this channel.
40 * @IEEE80211_CHAN_NO_IBSS: IBSS is not allowed on this channel.
41 * @IEEE80211_CHAN_RADAR: Radar detection is required on this channel.
42 */
43enum ieee80211_channel_flags {
44 IEEE80211_CHAN_DISABLED = 1<<0,
45 IEEE80211_CHAN_PASSIVE_SCAN = 1<<1,
46 IEEE80211_CHAN_NO_IBSS = 1<<2,
47 IEEE80211_CHAN_RADAR = 1<<3,
48};
49
50/**
51 * struct ieee80211_channel - channel definition
52 *
53 * This structure describes a single channel for use
54 * with cfg80211.
55 *
56 * @center_freq: center frequency in MHz
57 * @hw_value: hardware-specific value for the channel
58 * @flags: channel flags from &enum ieee80211_channel_flags.
59 * @orig_flags: channel flags at registration time, used by regulatory
60 * code to support devices with additional restrictions
61 * @band: band this channel belongs to.
62 * @max_antenna_gain: maximum antenna gain in dBi
63 * @max_power: maximum transmission power (in dBm)
64 * @orig_mag: internal use
65 * @orig_mpwr: internal use
66 */
67struct ieee80211_channel {
68 enum ieee80211_band band;
69 u16 center_freq;
70 u16 hw_value;
71 u32 flags;
72 int max_antenna_gain;
73 int max_power;
74 u32 orig_flags;
75 int orig_mag, orig_mpwr;
76};
77
78/**
79 * enum ieee80211_rate_flags - rate flags
80 *
81 * Hardware/specification flags for rates. These are structured
82 * in a way that allows using the same bitrate structure for
83 * different bands/PHY modes.
84 *
85 * @IEEE80211_RATE_SHORT_PREAMBLE: Hardware can send with short
86 * preamble on this bitrate; only relevant in 2.4GHz band and
87 * with CCK rates.
88 * @IEEE80211_RATE_MANDATORY_A: This bitrate is a mandatory rate
89 * when used with 802.11a (on the 5 GHz band); filled by the
90 * core code when registering the wiphy.
91 * @IEEE80211_RATE_MANDATORY_B: This bitrate is a mandatory rate
92 * when used with 802.11b (on the 2.4 GHz band); filled by the
93 * core code when registering the wiphy.
94 * @IEEE80211_RATE_MANDATORY_G: This bitrate is a mandatory rate
95 * when used with 802.11g (on the 2.4 GHz band); filled by the
96 * core code when registering the wiphy.
97 * @IEEE80211_RATE_ERP_G: This is an ERP rate in 802.11g mode.
98 */
99enum ieee80211_rate_flags {
100 IEEE80211_RATE_SHORT_PREAMBLE = 1<<0,
101 IEEE80211_RATE_MANDATORY_A = 1<<1,
102 IEEE80211_RATE_MANDATORY_B = 1<<2,
103 IEEE80211_RATE_MANDATORY_G = 1<<3,
104 IEEE80211_RATE_ERP_G = 1<<4,
105};
106
107/**
108 * struct ieee80211_rate - bitrate definition
109 *
110 * This structure describes a bitrate that an 802.11 PHY can
111 * operate with. The two values @hw_value and @hw_value_short
112 * are only for driver use when pointers to this structure are
113 * passed around.
114 *
115 * @flags: rate-specific flags
116 * @bitrate: bitrate in units of 100 Kbps
117 * @hw_value: driver/hardware value for this rate
118 * @hw_value_short: driver/hardware value for this rate when
119 * short preamble is used
120 */
121struct ieee80211_rate {
122 u32 flags;
123 u16 bitrate;
124 u16 hw_value, hw_value_short;
125};
126
127/**
128 * struct ieee80211_ht_info - describing STA's HT capabilities
129 *
130 * This structure describes most essential parameters needed
131 * to describe 802.11n HT capabilities for an STA.
132 *
133 * @ht_supported: is HT supported by STA, 0: no, 1: yes
134 * @cap: HT capabilities map as described in 802.11n spec
135 * @ampdu_factor: Maximum A-MPDU length factor
136 * @ampdu_density: Minimum A-MPDU spacing
137 * @supp_mcs_set: Supported MCS set as described in 802.11n spec
138 */
139struct ieee80211_ht_info {
140 u16 cap; /* use IEEE80211_HT_CAP_ */
141 u8 ht_supported;
142 u8 ampdu_factor;
143 u8 ampdu_density;
144 u8 supp_mcs_set[16];
145};
146
147/**
148 * struct ieee80211_supported_band - frequency band definition
149 *
150 * This structure describes a frequency band a wiphy
151 * is able to operate in.
152 *
153 * @channels: Array of channels the hardware can operate in
154 * in this band.
155 * @band: the band this structure represents
156 * @n_channels: Number of channels in @channels
157 * @bitrates: Array of bitrates the hardware can operate with
158 * in this band. Must be sorted to give a valid "supported
159 * rates" IE, i.e. CCK rates first, then OFDM.
160 * @n_bitrates: Number of bitrates in @bitrates
161 */
162struct ieee80211_supported_band {
163 struct ieee80211_channel *channels;
164 struct ieee80211_rate *bitrates;
165 enum ieee80211_band band;
166 int n_channels;
167 int n_bitrates;
168 struct ieee80211_ht_info ht_info;
169};
170
171/**
16 * struct wiphy - wireless hardware description 172 * struct wiphy - wireless hardware description
17 * @idx: the wiphy index assigned to this item 173 * @idx: the wiphy index assigned to this item
18 * @class_dev: the class device representing /sys/class/ieee80211/<wiphy-name> 174 * @class_dev: the class device representing /sys/class/ieee80211/<wiphy-name>
@@ -30,6 +186,8 @@ struct wiphy {
30 * help determine whether you own this wiphy or not. */ 186 * help determine whether you own this wiphy or not. */
31 void *privid; 187 void *privid;
32 188
189 struct ieee80211_supported_band *bands[IEEE80211_NUM_BANDS];
190
33 /* fields below are read-only, assigned by cfg80211 */ 191 /* fields below are read-only, assigned by cfg80211 */
34 192
35 /* the item in /sys/class/ieee80211/ points to this, 193 /* the item in /sys/class/ieee80211/ points to this,
@@ -136,4 +294,32 @@ extern void wiphy_unregister(struct wiphy *wiphy);
136 */ 294 */
137extern void wiphy_free(struct wiphy *wiphy); 295extern void wiphy_free(struct wiphy *wiphy);
138 296
297/**
298 * ieee80211_channel_to_frequency - convert channel number to frequency
299 */
300extern int ieee80211_channel_to_frequency(int chan);
301
302/**
303 * ieee80211_frequency_to_channel - convert frequency to channel number
304 */
305extern int ieee80211_frequency_to_channel(int freq);
306
307/*
308 * Name indirection necessary because the ieee80211 code also has
309 * a function named "ieee80211_get_channel", so if you include
310 * cfg80211's header file you get cfg80211's version, if you try
311 * to include both header files you'll (rightfully!) get a symbol
312 * clash.
313 */
314extern struct ieee80211_channel *__ieee80211_get_channel(struct wiphy *wiphy,
315 int freq);
316
317/**
318 * ieee80211_get_channel - get channel struct from wiphy for specified frequency
319 */
320static inline struct ieee80211_channel *
321ieee80211_get_channel(struct wiphy *wiphy, int freq)
322{
323 return __ieee80211_get_channel(wiphy, freq);
324}
139#endif /* __NET_WIRELESS_H */ 325#endif /* __NET_WIRELESS_H */
diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index 0d255ae008b6..b56b6a10fe5e 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -121,6 +121,7 @@ extern struct mutex xfrm_cfg_mutex;
121struct xfrm_state 121struct xfrm_state
122{ 122{
123 /* Note: bydst is re-used during gc */ 123 /* Note: bydst is re-used during gc */
124 struct list_head all;
124 struct hlist_node bydst; 125 struct hlist_node bydst;
125 struct hlist_node bysrc; 126 struct hlist_node bysrc;
126 struct hlist_node byspi; 127 struct hlist_node byspi;
@@ -446,6 +447,7 @@ struct xfrm_tmpl
446struct xfrm_policy 447struct xfrm_policy
447{ 448{
448 struct xfrm_policy *next; 449 struct xfrm_policy *next;
450 struct list_head bytype;
449 struct hlist_node bydst; 451 struct hlist_node bydst;
450 struct hlist_node byidx; 452 struct hlist_node byidx;
451 453
@@ -1071,6 +1073,23 @@ xfrm_address_t *xfrm_flowi_saddr(struct flowi *fl, unsigned short family)
1071 return NULL; 1073 return NULL;
1072} 1074}
1073 1075
1076static __inline__
1077void xfrm_flowi_addr_get(struct flowi *fl,
1078 xfrm_address_t *saddr, xfrm_address_t *daddr,
1079 unsigned short family)
1080{
1081 switch(family) {
1082 case AF_INET:
1083 memcpy(&saddr->a4, &fl->fl4_src, sizeof(saddr->a4));
1084 memcpy(&daddr->a4, &fl->fl4_dst, sizeof(daddr->a4));
1085 break;
1086 case AF_INET6:
1087 ipv6_addr_copy((struct in6_addr *)&saddr->a6, &fl->fl6_src);
1088 ipv6_addr_copy((struct in6_addr *)&daddr->a6, &fl->fl6_dst);
1089 break;
1090 }
1091}
1092
1074static __inline__ int 1093static __inline__ int
1075__xfrm4_state_addr_check(struct xfrm_state *x, 1094__xfrm4_state_addr_check(struct xfrm_state *x,
1076 xfrm_address_t *daddr, xfrm_address_t *saddr) 1095 xfrm_address_t *daddr, xfrm_address_t *saddr)
@@ -1188,6 +1207,18 @@ struct xfrm6_tunnel {
1188 int priority; 1207 int priority;
1189}; 1208};
1190 1209
1210struct xfrm_state_walk {
1211 struct xfrm_state *state;
1212 int count;
1213 u8 proto;
1214};
1215
1216struct xfrm_policy_walk {
1217 struct xfrm_policy *policy;
1218 int count;
1219 u8 type, cur_type;
1220};
1221
1191extern void xfrm_init(void); 1222extern void xfrm_init(void);
1192extern void xfrm4_init(void); 1223extern void xfrm4_init(void);
1193extern void xfrm_state_init(void); 1224extern void xfrm_state_init(void);
@@ -1212,7 +1243,23 @@ static inline void xfrm6_fini(void)
1212extern int xfrm_proc_init(void); 1243extern int xfrm_proc_init(void);
1213#endif 1244#endif
1214 1245
1215extern int xfrm_state_walk(u8 proto, int (*func)(struct xfrm_state *, int, void*), void *); 1246static inline void xfrm_state_walk_init(struct xfrm_state_walk *walk, u8 proto)
1247{
1248 walk->proto = proto;
1249 walk->state = NULL;
1250 walk->count = 0;
1251}
1252
1253static inline void xfrm_state_walk_done(struct xfrm_state_walk *walk)
1254{
1255 if (walk->state != NULL) {
1256 xfrm_state_put(walk->state);
1257 walk->state = NULL;
1258 }
1259}
1260
1261extern int xfrm_state_walk(struct xfrm_state_walk *walk,
1262 int (*func)(struct xfrm_state *, int, void*), void *);
1216extern struct xfrm_state *xfrm_state_alloc(void); 1263extern struct xfrm_state *xfrm_state_alloc(void);
1217extern struct xfrm_state *xfrm_state_find(xfrm_address_t *daddr, xfrm_address_t *saddr, 1264extern struct xfrm_state *xfrm_state_find(xfrm_address_t *daddr, xfrm_address_t *saddr,
1218 struct flowi *fl, struct xfrm_tmpl *tmpl, 1265 struct flowi *fl, struct xfrm_tmpl *tmpl,
@@ -1335,7 +1382,25 @@ static inline int xfrm4_udp_encap_rcv(struct sock *sk, struct sk_buff *skb)
1335#endif 1382#endif
1336 1383
1337struct xfrm_policy *xfrm_policy_alloc(gfp_t gfp); 1384struct xfrm_policy *xfrm_policy_alloc(gfp_t gfp);
1338extern int xfrm_policy_walk(u8 type, int (*func)(struct xfrm_policy *, int, int, void*), void *); 1385
1386static inline void xfrm_policy_walk_init(struct xfrm_policy_walk *walk, u8 type)
1387{
1388 walk->cur_type = XFRM_POLICY_TYPE_MAIN;
1389 walk->type = type;
1390 walk->policy = NULL;
1391 walk->count = 0;
1392}
1393
1394static inline void xfrm_policy_walk_done(struct xfrm_policy_walk *walk)
1395{
1396 if (walk->policy != NULL) {
1397 xfrm_pol_put(walk->policy);
1398 walk->policy = NULL;
1399 }
1400}
1401
1402extern int xfrm_policy_walk(struct xfrm_policy_walk *walk,
1403 int (*func)(struct xfrm_policy *, int, int, void*), void *);
1339int xfrm_policy_insert(int dir, struct xfrm_policy *policy, int excl); 1404int xfrm_policy_insert(int dir, struct xfrm_policy *policy, int excl);
1340struct xfrm_policy *xfrm_policy_bysel_ctx(u8 type, int dir, 1405struct xfrm_policy *xfrm_policy_bysel_ctx(u8 type, int dir,
1341 struct xfrm_selector *sel, 1406 struct xfrm_selector *sel,
diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h
index 95bf4bac44cb..2dcbecce3f61 100644
--- a/include/rdma/ib_verbs.h
+++ b/include/rdma/ib_verbs.h
@@ -1051,7 +1051,7 @@ struct ib_device {
1051 struct ib_dma_mapping_ops *dma_ops; 1051 struct ib_dma_mapping_ops *dma_ops;
1052 1052
1053 struct module *owner; 1053 struct module *owner;
1054 struct class_device class_dev; 1054 struct device dev;
1055 struct kobject *ports_parent; 1055 struct kobject *ports_parent;
1056 struct list_head port_list; 1056 struct list_head port_list;
1057 1057
diff --git a/include/scsi/iscsi_proto.h b/include/scsi/iscsi_proto.h
index 5ffec8ad6964..e0593bfae622 100644
--- a/include/scsi/iscsi_proto.h
+++ b/include/scsi/iscsi_proto.h
@@ -112,6 +112,7 @@ struct iscsi_ahs_hdr {
112 112
113#define ISCSI_AHSTYPE_CDB 1 113#define ISCSI_AHSTYPE_CDB 1
114#define ISCSI_AHSTYPE_RLENGTH 2 114#define ISCSI_AHSTYPE_RLENGTH 2
115#define ISCSI_CDB_SIZE 16
115 116
116/* iSCSI PDU Header */ 117/* iSCSI PDU Header */
117struct iscsi_cmd { 118struct iscsi_cmd {
@@ -125,7 +126,7 @@ struct iscsi_cmd {
125 __be32 data_length; 126 __be32 data_length;
126 __be32 cmdsn; 127 __be32 cmdsn;
127 __be32 exp_statsn; 128 __be32 exp_statsn;
128 uint8_t cdb[16]; /* SCSI Command Block */ 129 uint8_t cdb[ISCSI_CDB_SIZE]; /* SCSI Command Block */
129 /* Additional Data (Command Dependent) */ 130 /* Additional Data (Command Dependent) */
130}; 131};
131 132
@@ -154,7 +155,8 @@ struct iscsi_ecdb_ahdr {
154 __be16 ahslength; /* CDB length - 15, including reserved byte */ 155 __be16 ahslength; /* CDB length - 15, including reserved byte */
155 uint8_t ahstype; 156 uint8_t ahstype;
156 uint8_t reserved; 157 uint8_t reserved;
157 uint8_t ecdb[260 - 16]; /* 4-byte aligned extended CDB spillover */ 158 /* 4-byte aligned extended CDB spillover */
159 uint8_t ecdb[260 - ISCSI_CDB_SIZE];
158}; 160};
159 161
160/* SCSI Response Header */ 162/* SCSI Response Header */
diff --git a/include/scsi/libsas.h b/include/scsi/libsas.h
index 39e1cac24bb7..e78d3b62d8ec 100644
--- a/include/scsi/libsas.h
+++ b/include/scsi/libsas.h
@@ -32,7 +32,6 @@
32#include <scsi/sas.h> 32#include <scsi/sas.h>
33#include <linux/libata.h> 33#include <linux/libata.h>
34#include <linux/list.h> 34#include <linux/list.h>
35#include <asm/semaphore.h>
36#include <scsi/scsi_device.h> 35#include <scsi/scsi_device.h>
37#include <scsi/scsi_cmnd.h> 36#include <scsi/scsi_cmnd.h>
38#include <scsi/scsi_transport_sas.h> 37#include <scsi/scsi_transport_sas.h>
@@ -677,4 +676,6 @@ extern void sas_ssp_task_response(struct device *dev, struct sas_task *task,
677 struct ssp_response_iu *iu); 676 struct ssp_response_iu *iu);
678struct sas_phy *sas_find_local_phy(struct domain_device *dev); 677struct sas_phy *sas_find_local_phy(struct domain_device *dev);
679 678
679int sas_request_addr(struct Scsi_Host *shost, u8 *addr);
680
680#endif /* _SASLIB_H_ */ 681#endif /* _SASLIB_H_ */
diff --git a/include/scsi/sas_ata.h b/include/scsi/sas_ata.h
index dd5edc915417..c583193ae929 100644
--- a/include/scsi/sas_ata.h
+++ b/include/scsi/sas_ata.h
@@ -47,12 +47,12 @@ static inline int dev_is_sata(struct domain_device *dev)
47{ 47{
48 return 0; 48 return 0;
49} 49}
50int sas_ata_init_host_and_port(struct domain_device *found_dev, 50static inline int sas_ata_init_host_and_port(struct domain_device *found_dev,
51 struct scsi_target *starget) 51 struct scsi_target *starget)
52{ 52{
53 return 0; 53 return 0;
54} 54}
55void sas_ata_task_abort(struct sas_task *task) 55static inline void sas_ata_task_abort(struct sas_task *task)
56{ 56{
57} 57}
58#endif 58#endif
diff --git a/include/scsi/scsi_cmnd.h b/include/scsi/scsi_cmnd.h
index de28aab820b0..8d20e60a94b7 100644
--- a/include/scsi/scsi_cmnd.h
+++ b/include/scsi/scsi_cmnd.h
@@ -130,6 +130,9 @@ extern void scsi_release_buffers(struct scsi_cmnd *cmd);
130extern int scsi_dma_map(struct scsi_cmnd *cmd); 130extern int scsi_dma_map(struct scsi_cmnd *cmd);
131extern void scsi_dma_unmap(struct scsi_cmnd *cmd); 131extern void scsi_dma_unmap(struct scsi_cmnd *cmd);
132 132
133struct scsi_cmnd *scsi_allocate_command(gfp_t gfp_mask);
134void scsi_free_command(gfp_t gfp_mask, struct scsi_cmnd *cmd);
135
133static inline unsigned scsi_sg_count(struct scsi_cmnd *cmd) 136static inline unsigned scsi_sg_count(struct scsi_cmnd *cmd)
134{ 137{
135 return cmd->sdb.table.nents; 138 return cmd->sdb.table.nents;
@@ -175,4 +178,18 @@ static inline struct scsi_data_buffer *scsi_out(struct scsi_cmnd *cmd)
175 return &cmd->sdb; 178 return &cmd->sdb;
176} 179}
177 180
181static inline int scsi_sg_copy_from_buffer(struct scsi_cmnd *cmd,
182 void *buf, int buflen)
183{
184 return sg_copy_from_buffer(scsi_sglist(cmd), scsi_sg_count(cmd),
185 buf, buflen);
186}
187
188static inline int scsi_sg_copy_to_buffer(struct scsi_cmnd *cmd,
189 void *buf, int buflen)
190{
191 return sg_copy_to_buffer(scsi_sglist(cmd), scsi_sg_count(cmd),
192 buf, buflen);
193}
194
178#endif /* _SCSI_SCSI_CMND_H */ 195#endif /* _SCSI_SCSI_CMND_H */
diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h
index ab7acbe80960..b8b19e2f57bb 100644
--- a/include/scsi/scsi_device.h
+++ b/include/scsi/scsi_device.h
@@ -156,8 +156,8 @@ struct scsi_device {
156 156
157 int timeout; 157 int timeout;
158 158
159 struct device sdev_gendev; 159 struct device sdev_gendev,
160 struct class_device sdev_classdev; 160 sdev_dev;
161 161
162 struct execute_work ew; /* used to get process context on put */ 162 struct execute_work ew; /* used to get process context on put */
163 163
@@ -167,9 +167,9 @@ struct scsi_device {
167#define to_scsi_device(d) \ 167#define to_scsi_device(d) \
168 container_of(d, struct scsi_device, sdev_gendev) 168 container_of(d, struct scsi_device, sdev_gendev)
169#define class_to_sdev(d) \ 169#define class_to_sdev(d) \
170 container_of(d, struct scsi_device, sdev_classdev) 170 container_of(d, struct scsi_device, sdev_dev)
171#define transport_class_to_sdev(class_dev) \ 171#define transport_class_to_sdev(class_dev) \
172 to_scsi_device(class_dev->dev) 172 to_scsi_device(class_dev->parent)
173 173
174#define sdev_printk(prefix, sdev, fmt, a...) \ 174#define sdev_printk(prefix, sdev, fmt, a...) \
175 dev_printk(prefix, &(sdev)->sdev_gendev, fmt, ##a) 175 dev_printk(prefix, &(sdev)->sdev_gendev, fmt, ##a)
@@ -220,7 +220,7 @@ static inline struct scsi_target *scsi_target(struct scsi_device *sdev)
220 return to_scsi_target(sdev->sdev_gendev.parent); 220 return to_scsi_target(sdev->sdev_gendev.parent);
221} 221}
222#define transport_class_to_starget(class_dev) \ 222#define transport_class_to_starget(class_dev) \
223 to_scsi_target(class_dev->dev) 223 to_scsi_target(class_dev->parent)
224 224
225#define starget_printk(prefix, starget, fmt, a...) \ 225#define starget_printk(prefix, starget, fmt, a...) \
226 dev_printk(prefix, &(starget)->dev, fmt, ##a) 226 dev_printk(prefix, &(starget)->dev, fmt, ##a)
diff --git a/include/scsi/scsi_eh.h b/include/scsi/scsi_eh.h
index 25071d5d9bf8..d3a133b4a072 100644
--- a/include/scsi/scsi_eh.h
+++ b/include/scsi/scsi_eh.h
@@ -57,13 +57,16 @@ extern const u8 * scsi_sense_desc_find(const u8 * sense_buffer, int sb_len,
57 57
58extern int scsi_get_sense_info_fld(const u8 * sense_buffer, int sb_len, 58extern int scsi_get_sense_info_fld(const u8 * sense_buffer, int sb_len,
59 u64 * info_out); 59 u64 * info_out);
60 60
61extern void scsi_build_sense_buffer(int desc, u8 *buf, u8 key, u8 asc, u8 ascq);
62
61/* 63/*
62 * Reset request from external source 64 * Reset request from external source
63 */ 65 */
64#define SCSI_TRY_RESET_DEVICE 1 66#define SCSI_TRY_RESET_DEVICE 1
65#define SCSI_TRY_RESET_BUS 2 67#define SCSI_TRY_RESET_BUS 2
66#define SCSI_TRY_RESET_HOST 3 68#define SCSI_TRY_RESET_HOST 3
69#define SCSI_TRY_RESET_TARGET 4
67 70
68extern int scsi_reset_provider(struct scsi_device *, int); 71extern int scsi_reset_provider(struct scsi_device *, int);
69 72
diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h
index 530ff4c553f8..d967d6dc7a28 100644
--- a/include/scsi/scsi_host.h
+++ b/include/scsi/scsi_host.h
@@ -172,6 +172,7 @@ struct scsi_host_template {
172 */ 172 */
173 int (* eh_abort_handler)(struct scsi_cmnd *); 173 int (* eh_abort_handler)(struct scsi_cmnd *);
174 int (* eh_device_reset_handler)(struct scsi_cmnd *); 174 int (* eh_device_reset_handler)(struct scsi_cmnd *);
175 int (* eh_target_reset_handler)(struct scsi_cmnd *);
175 int (* eh_bus_reset_handler)(struct scsi_cmnd *); 176 int (* eh_bus_reset_handler)(struct scsi_cmnd *);
176 int (* eh_host_reset_handler)(struct scsi_cmnd *); 177 int (* eh_host_reset_handler)(struct scsi_cmnd *);
177 178
@@ -469,7 +470,7 @@ struct scsi_host_template {
469 /* 470 /*
470 * Pointer to the sysfs class properties for this host, NULL terminated. 471 * Pointer to the sysfs class properties for this host, NULL terminated.
471 */ 472 */
472 struct class_device_attribute **shost_attrs; 473 struct device_attribute **shost_attrs;
473 474
474 /* 475 /*
475 * Pointer to the SCSI device properties for this host, NULL terminated. 476 * Pointer to the SCSI device properties for this host, NULL terminated.
@@ -654,8 +655,7 @@ struct Scsi_Host {
654 enum scsi_host_state shost_state; 655 enum scsi_host_state shost_state;
655 656
656 /* ldm bits */ 657 /* ldm bits */
657 struct device shost_gendev; 658 struct device shost_gendev, shost_dev;
658 struct class_device shost_classdev;
659 659
660 /* 660 /*
661 * List of hosts per template. 661 * List of hosts per template.
@@ -682,7 +682,7 @@ struct Scsi_Host {
682}; 682};
683 683
684#define class_to_shost(d) \ 684#define class_to_shost(d) \
685 container_of(d, struct Scsi_Host, shost_classdev) 685 container_of(d, struct Scsi_Host, shost_dev)
686 686
687#define shost_printk(prefix, shost, fmt, a...) \ 687#define shost_printk(prefix, shost, fmt, a...) \
688 dev_printk(prefix, &(shost)->shost_gendev, fmt, ##a) 688 dev_printk(prefix, &(shost)->shost_gendev, fmt, ##a)
diff --git a/include/scsi/scsi_transport.h b/include/scsi/scsi_transport.h
index 0dfef752f0e2..490bd13a634c 100644
--- a/include/scsi/scsi_transport.h
+++ b/include/scsi/scsi_transport.h
@@ -80,7 +80,7 @@ struct scsi_transport_template {
80}; 80};
81 81
82#define transport_class_to_shost(tc) \ 82#define transport_class_to_shost(tc) \
83 dev_to_shost((tc)->dev) 83 dev_to_shost((tc)->parent)
84 84
85 85
86/* Private area maintenance. The driver requested allocations come 86/* Private area maintenance. The driver requested allocations come
diff --git a/include/scsi/scsi_transport_fc.h b/include/scsi/scsi_transport_fc.h
index 4769efd4db24..06f72bab9df0 100644
--- a/include/scsi/scsi_transport_fc.h
+++ b/include/scsi/scsi_transport_fc.h
@@ -163,8 +163,8 @@ enum fc_tgtid_binding_type {
163 163
164 164
165/* Macro for use in defining Virtual Port attributes */ 165/* Macro for use in defining Virtual Port attributes */
166#define FC_VPORT_ATTR(_name,_mode,_show,_store) \ 166#define FC_VPORT_ATTR(_name,_mode,_show,_store) \
167struct class_device_attribute class_device_attr_vport_##_name = \ 167struct device_attribute dev_attr_vport_##_name = \
168 __ATTR(_name,_mode,_show,_store) 168 __ATTR(_name,_mode,_show,_store)
169 169
170 170
@@ -234,8 +234,8 @@ struct fc_vport {
234 234
235#define dev_to_vport(d) \ 235#define dev_to_vport(d) \
236 container_of(d, struct fc_vport, dev) 236 container_of(d, struct fc_vport, dev)
237#define transport_class_to_vport(classdev) \ 237#define transport_class_to_vport(dev) \
238 dev_to_vport(classdev->dev) 238 dev_to_vport(dev->parent)
239#define vport_to_shost(v) \ 239#define vport_to_shost(v) \
240 (v->shost) 240 (v->shost)
241#define vport_to_shost_channel(v) \ 241#define vport_to_shost_channel(v) \
@@ -271,7 +271,7 @@ struct fc_rport_identifiers {
271 271
272/* Macro for use in defining Remote Port attributes */ 272/* Macro for use in defining Remote Port attributes */
273#define FC_RPORT_ATTR(_name,_mode,_show,_store) \ 273#define FC_RPORT_ATTR(_name,_mode,_show,_store) \
274struct class_device_attribute class_device_attr_rport_##_name = \ 274struct device_attribute dev_attr_rport_##_name = \
275 __ATTR(_name,_mode,_show,_store) 275 __ATTR(_name,_mode,_show,_store)
276 276
277 277
@@ -341,8 +341,8 @@ struct fc_rport { /* aka fc_starget_attrs */
341 341
342#define dev_to_rport(d) \ 342#define dev_to_rport(d) \
343 container_of(d, struct fc_rport, dev) 343 container_of(d, struct fc_rport, dev)
344#define transport_class_to_rport(classdev) \ 344#define transport_class_to_rport(dev) \
345 dev_to_rport(classdev->dev) 345 dev_to_rport(dev->parent)
346#define rport_to_shost(r) \ 346#define rport_to_shost(r) \
347 dev_to_shost(r->dev.parent) 347 dev_to_shost(r->dev.parent)
348 348
diff --git a/include/scsi/scsi_transport_sas.h b/include/scsi/scsi_transport_sas.h
index 09125fa95b93..61ad3594aad6 100644
--- a/include/scsi/scsi_transport_sas.h
+++ b/include/scsi/scsi_transport_sas.h
@@ -80,8 +80,8 @@ struct sas_phy {
80 80
81#define dev_to_phy(d) \ 81#define dev_to_phy(d) \
82 container_of((d), struct sas_phy, dev) 82 container_of((d), struct sas_phy, dev)
83#define transport_class_to_phy(cdev) \ 83#define transport_class_to_phy(dev) \
84 dev_to_phy((cdev)->dev) 84 dev_to_phy((dev)->parent)
85#define phy_to_shost(phy) \ 85#define phy_to_shost(phy) \
86 dev_to_shost((phy)->dev.parent) 86 dev_to_shost((phy)->dev.parent)
87 87
@@ -96,8 +96,8 @@ struct sas_rphy {
96 96
97#define dev_to_rphy(d) \ 97#define dev_to_rphy(d) \
98 container_of((d), struct sas_rphy, dev) 98 container_of((d), struct sas_rphy, dev)
99#define transport_class_to_rphy(cdev) \ 99#define transport_class_to_rphy(dev) \
100 dev_to_rphy((cdev)->dev) 100 dev_to_rphy((dev)->parent)
101#define rphy_to_shost(rphy) \ 101#define rphy_to_shost(rphy) \
102 dev_to_shost((rphy)->dev.parent) 102 dev_to_shost((rphy)->dev.parent)
103#define target_to_rphy(targ) \ 103#define target_to_rphy(targ) \
@@ -152,8 +152,8 @@ struct sas_port {
152 152
153#define dev_to_sas_port(d) \ 153#define dev_to_sas_port(d) \
154 container_of((d), struct sas_port, dev) 154 container_of((d), struct sas_port, dev)
155#define transport_class_to_sas_port(cdev) \ 155#define transport_class_to_sas_port(dev) \
156 dev_to_sas_port((cdev)->dev) 156 dev_to_sas_port((dev)->parent)
157 157
158struct sas_phy_linkrates { 158struct sas_phy_linkrates {
159 enum sas_linkrate maximum_linkrate; 159 enum sas_linkrate maximum_linkrate;
diff --git a/include/scsi/sd.h b/include/scsi/sd.h
index 8ea9f7358ac1..4f032d48cb6e 100644
--- a/include/scsi/sd.h
+++ b/include/scsi/sd.h
@@ -34,7 +34,7 @@
34struct scsi_disk { 34struct scsi_disk {
35 struct scsi_driver *driver; /* always &sd_template */ 35 struct scsi_driver *driver; /* always &sd_template */
36 struct scsi_device *device; 36 struct scsi_device *device;
37 struct class_device cdev; 37 struct device dev;
38 struct gendisk *disk; 38 struct gendisk *disk;
39 unsigned int openers; /* protected by BKL for now, yuck */ 39 unsigned int openers; /* protected by BKL for now, yuck */
40 sector_t capacity; /* size in 512-byte sectors */ 40 sector_t capacity; /* size in 512-byte sectors */
@@ -46,7 +46,7 @@ struct scsi_disk {
46 unsigned RCD : 1; /* state of disk RCD bit, unused */ 46 unsigned RCD : 1; /* state of disk RCD bit, unused */
47 unsigned DPOFUA : 1; /* state of disk DPOFUA bit */ 47 unsigned DPOFUA : 1; /* state of disk DPOFUA bit */
48}; 48};
49#define to_scsi_disk(obj) container_of(obj,struct scsi_disk,cdev) 49#define to_scsi_disk(obj) container_of(obj,struct scsi_disk,dev)
50 50
51#define sd_printk(prefix, sdsk, fmt, a...) \ 51#define sd_printk(prefix, sdsk, fmt, a...) \
52 (sdsk)->disk ? \ 52 (sdsk)->disk ? \