aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-07-21 11:19:50 -0400
committerIngo Molnar <mingo@elte.hu>2008-07-21 11:19:50 -0400
commiteb6a12c2428d21a9f3e0f1a50e927d5fd80fc3d0 (patch)
tree5ac6f43899648abeab1d43aad3107f664e7f13d5 /include
parentc4762aba0b1f72659aae9ce37b772ca8bd8f06f4 (diff)
parent14b395e35d1afdd8019d11b92e28041fad591b71 (diff)
Merge branch 'linus' into cpus4096-for-linus
Conflicts: net/sunrpc/svc.c Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include')
-rw-r--r--include/asm-avr32/ioctls.h4
-rw-r--r--include/asm-cris/Kbuild5
-rw-r--r--include/asm-frv/ioctls.h4
-rw-r--r--include/asm-frv/termbits.h5
-rw-r--r--include/asm-ia64/kvm_host.h3
-rw-r--r--include/asm-m68k/amigahw.h4
-rw-r--r--include/asm-m68k/amigaints.h2
-rw-r--r--include/asm-m68k/apollodma.h2
-rw-r--r--include/asm-m68k/dvma.h4
-rw-r--r--include/asm-m68k/fpu.h10
-rw-r--r--include/asm-m68k/irq.h2
-rw-r--r--include/asm-m68k/mac_baboon.h2
-rw-r--r--include/asm-m68k/mac_via.h1
-rw-r--r--include/asm-m68k/machines.h4
-rw-r--r--include/asm-m68k/macintosh.h5
-rw-r--r--include/asm-m68k/md.h2
-rw-r--r--include/asm-m68k/openprom.h1
-rw-r--r--include/asm-m68k/oplib.h3
-rw-r--r--include/asm-m68k/sbus.h5
-rw-r--r--include/asm-m68k/sun3-head.h1
-rw-r--r--include/asm-m68k/tlbflush.h8
-rw-r--r--include/asm-mips/bitops.h6
-rw-r--r--include/asm-mips/bootinfo.h6
-rw-r--r--include/asm-mips/fpu.h2
-rw-r--r--include/asm-mips/mach-rc32434/cpu-feature-overrides.h81
-rw-r--r--include/asm-mips/mach-rc32434/ddr.h141
-rw-r--r--include/asm-mips/mach-rc32434/dma.h103
-rw-r--r--include/asm-mips/mach-rc32434/dma_v.h52
-rw-r--r--include/asm-mips/mach-rc32434/eth.h220
-rw-r--r--include/asm-mips/mach-rc32434/gpio.h126
-rw-r--r--include/asm-mips/mach-rc32434/integ.h59
-rw-r--r--include/asm-mips/mach-rc32434/irq.h8
-rw-r--r--include/asm-mips/mach-rc32434/pci.h481
-rw-r--r--include/asm-mips/mach-rc32434/prom.h44
-rw-r--r--include/asm-mips/mach-rc32434/rb.h81
-rw-r--r--include/asm-mips/mach-rc32434/rc32434.h61
-rw-r--r--include/asm-mips/mach-rc32434/timer.h65
-rw-r--r--include/asm-mips/mach-rc32434/war.h25
-rw-r--r--include/asm-mips/mips-boards/atlas.h80
-rw-r--r--include/asm-mips/mips-boards/atlasint.h109
-rw-r--r--include/asm-mips/mips-boards/maltasmp.h36
-rw-r--r--include/asm-mips/mips-boards/saa9730_uart.h69
-rw-r--r--include/asm-mips/mips-boards/sead.h36
-rw-r--r--include/asm-mips/mips-boards/seadint.h28
-rw-r--r--include/asm-mips/page.h3
-rw-r--r--include/asm-mips/pci.h1
-rw-r--r--include/asm-mips/setup.h2
-rw-r--r--include/asm-mips/txx9/generic.h7
-rw-r--r--include/asm-mips/txx9/rbtx4927.h26
-rw-r--r--include/asm-mips/txx9/rbtx4938.h52
-rw-r--r--include/asm-mips/txx9/tx3927.h19
-rw-r--r--include/asm-mips/txx9/tx4927.h63
-rw-r--r--include/asm-mips/txx9/tx4938.h243
-rw-r--r--include/asm-powerpc/kvm_host.h2
-rw-r--r--include/asm-s390/kvm_host.h36
-rw-r--r--include/asm-x86/kvm.h1
-rw-r--r--include/asm-x86/kvm_host.h69
-rw-r--r--include/asm-x86/kvm_x86_emulate.h11
-rw-r--r--include/linux/brcmphy.h6
-rw-r--r--include/linux/configfs.h7
-rw-r--r--include/linux/cyclades.h13
-rw-r--r--include/linux/dccp.h6
-rw-r--r--include/linux/dm9000.h1
-rw-r--r--include/linux/ethtool.h33
-rw-r--r--include/linux/fs.h4
-rw-r--r--include/linux/generic_serial.h8
-rw-r--r--include/linux/hayesesp.h9
-rw-r--r--include/linux/hdlc.h7
-rw-r--r--include/linux/i2c-id.h8
-rw-r--r--include/linux/ieee80211.h499
-rw-r--r--include/linux/if_bridge.h2
-rw-r--r--include/linux/if_packet.h24
-rw-r--r--include/linux/if_ppp.h2
-rw-r--r--include/linux/if_tun.h34
-rw-r--r--include/linux/if_vlan.h238
-rw-r--r--include/linux/igmp.h1
-rw-r--r--include/linux/ip6_tunnel.h4
-rw-r--r--include/linux/ipv6.h4
-rw-r--r--include/linux/istallion.h6
-rw-r--r--include/linux/kvm.h33
-rw-r--r--include/linux/kvm_host.h11
-rw-r--r--include/linux/lockd/lockd.h8
-rw-r--r--include/linux/mfd/asic3.h185
-rw-r--r--include/linux/mroute.h28
-rw-r--r--include/linux/mroute6.h35
-rw-r--r--include/linux/mv643xx_eth.h65
-rw-r--r--include/linux/net.h4
-rw-r--r--include/linux/netdevice.h330
-rw-r--r--include/linux/netfilter/nfnetlink_conntrack.h10
-rw-r--r--include/linux/netfilter/xt_string.h15
-rw-r--r--include/linux/netfilter_bridge/ebt_ip6.h40
-rw-r--r--include/linux/netfilter_bridge/ebt_log.h3
-rw-r--r--include/linux/netfilter_ipv4.h1
-rw-r--r--include/linux/netfilter_ipv6.h5
-rw-r--r--include/linux/netlink.h2
-rw-r--r--include/linux/nfs4.h3
-rw-r--r--include/linux/nfsd/nfsd.h27
-rw-r--r--include/linux/nfsd/state.h2
-rw-r--r--include/linux/nl80211.h13
-rw-r--r--include/linux/notifier.h1
-rw-r--r--include/linux/pci_ids.h3
-rw-r--r--include/linux/pkt_cls.h1
-rw-r--r--include/linux/pkt_sched.h29
-rw-r--r--include/linux/ppp-comp.h2
-rw-r--r--include/linux/ppp_defs.h2
-rw-r--r--include/linux/rfkill.h46
-rw-r--r--include/linux/rtnetlink.h1
-rw-r--r--include/linux/seq_file_net.h3
-rw-r--r--include/linux/serial_core.h27
-rw-r--r--include/linux/skbuff.h27
-rw-r--r--include/linux/smc911x.h12
-rw-r--r--include/linux/socket.h6
-rw-r--r--include/linux/sonet.h2
-rw-r--r--include/linux/ssb/ssb.h144
-rw-r--r--include/linux/stallion.h6
-rw-r--r--include/linux/sunrpc/auth_gss.h2
-rw-r--r--include/linux/sunrpc/gss_api.h2
-rw-r--r--include/linux/sunrpc/gss_krb5.h3
-rw-r--r--include/linux/sunrpc/svc.h7
-rw-r--r--include/linux/sunrpc/svc_rdma.h36
-rw-r--r--include/linux/sunrpc/svcauth_gss.h3
-rw-r--r--include/linux/tcp.h56
-rw-r--r--include/linux/textsearch.h13
-rw-r--r--include/linux/tipc_config.h10
-rw-r--r--include/linux/tty.h204
-rw-r--r--include/linux/tty_ldisc.h7
-rw-r--r--include/linux/udp.h6
-rw-r--r--include/linux/usb/rndis_host.h3
-rw-r--r--include/linux/videodev2.h14
-rw-r--r--include/linux/wanrouter.h2
-rw-r--r--include/linux/wireless.h30
-rw-r--r--include/media/cx2341x.h7
-rw-r--r--include/media/ir-kbd-i2c.h3
-rw-r--r--include/media/pwc-ioctl.h3
-rw-r--r--include/media/saa7146.h4
-rw-r--r--include/media/sh_mobile_ceu.h12
-rw-r--r--include/media/soc_camera.h16
-rw-r--r--include/media/soc_camera_platform.h15
-rw-r--r--include/media/v4l2-dev.h83
-rw-r--r--include/media/v4l2-i2c-drv-legacy.h1
-rw-r--r--include/media/videobuf-dma-contig.h32
-rw-r--r--include/media/videobuf-dma-sg.h2
-rw-r--r--include/media/videobuf-vmalloc.h2
-rw-r--r--include/net/addrconf.h3
-rw-r--r--include/net/bluetooth/bluetooth.h1
-rw-r--r--include/net/bluetooth/hci.h68
-rw-r--r--include/net/bluetooth/hci_core.h19
-rw-r--r--include/net/bluetooth/rfcomm.h2
-rw-r--r--include/net/compat.h2
-rw-r--r--include/net/dst.h12
-rw-r--r--include/net/fib_rules.h2
-rw-r--r--include/net/garp.h128
-rw-r--r--include/net/icmp.h18
-rw-r--r--include/net/ieee80211.h11
-rw-r--r--include/net/if_inet6.h1
-rw-r--r--include/net/inet6_hashtables.h10
-rw-r--r--include/net/inet_hashtables.h12
-rw-r--r--include/net/inet_sock.h9
-rw-r--r--include/net/inetpeer.h2
-rw-r--r--include/net/ip.h19
-rw-r--r--include/net/ip6_tunnel.h5
-rw-r--r--include/net/ipconfig.h2
-rw-r--r--include/net/ipip.h1
-rw-r--r--include/net/ipv6.h12
-rw-r--r--include/net/irda/irda_device.h2
-rw-r--r--include/net/iw_handler.h151
-rw-r--r--include/net/mac80211.h591
-rw-r--r--include/net/neighbour.h4
-rw-r--r--include/net/net_namespace.h5
-rw-r--r--include/net/netfilter/ipv4/nf_conntrack_ipv4.h2
-rw-r--r--include/net/netfilter/nf_conntrack.h22
-rw-r--r--include/net/netns/hash.h21
-rw-r--r--include/net/netns/ipv4.h5
-rw-r--r--include/net/netns/ipv6.h1
-rw-r--r--include/net/netns/mib.h16
-rw-r--r--include/net/pkt_sched.h14
-rw-r--r--include/net/rose.h2
-rw-r--r--include/net/route.h2
-rw-r--r--include/net/sch_generic.h198
-rw-r--r--include/net/sctp/checksum.h23
-rw-r--r--include/net/sctp/sctp.h4
-rw-r--r--include/net/sctp/structs.h8
-rw-r--r--include/net/sctp/user.h34
-rw-r--r--include/net/snmp.h2
-rw-r--r--include/net/sock.h41
-rw-r--r--include/net/stp.h14
-rw-r--r--include/net/tcp.h65
-rw-r--r--include/net/tipc/tipc_port.h10
-rw-r--r--include/net/transp_v6.h2
-rw-r--r--include/net/udp.h28
-rw-r--r--include/net/wext.h7
-rw-r--r--include/net/wireless.h6
192 files changed, 4704 insertions, 2072 deletions
diff --git a/include/asm-avr32/ioctls.h b/include/asm-avr32/ioctls.h
index 0500426b7186..0cf2c0a4502b 100644
--- a/include/asm-avr32/ioctls.h
+++ b/include/asm-avr32/ioctls.h
@@ -47,6 +47,10 @@
47#define TIOCSBRK 0x5427 /* BSD compatibility */ 47#define TIOCSBRK 0x5427 /* BSD compatibility */
48#define TIOCCBRK 0x5428 /* BSD compatibility */ 48#define TIOCCBRK 0x5428 /* BSD compatibility */
49#define TIOCGSID 0x5429 /* Return the session ID of FD */ 49#define TIOCGSID 0x5429 /* Return the session ID of FD */
50#define TCGETS2 _IOR('T',0x2A, struct termios2)
51#define TCSETS2 _IOW('T',0x2B, struct termios2)
52#define TCSETSW2 _IOW('T',0x2C, struct termios2)
53#define TCSETSF2 _IOW('T',0x2D, struct termios2)
50#define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */ 54#define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
51#define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */ 55#define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */
52 56
diff --git a/include/asm-cris/Kbuild b/include/asm-cris/Kbuild
index 17455459c43f..b7037d80d461 100644
--- a/include/asm-cris/Kbuild
+++ b/include/asm-cris/Kbuild
@@ -1,7 +1,8 @@
1include include/asm-generic/Kbuild.asm 1include include/asm-generic/Kbuild.asm
2 2
3header-$(CONFIG_ETRAX_ARCH_V10) += arch-v10/ 3header-y += arch/
4header-$(CONFIG_ETRAX_ARCH_V32) += arch-v32/ 4header-y += arch-v10/
5header-y += arch-v32/
5 6
6header-y += ethernet.h 7header-y += ethernet.h
7header-y += rtc.h 8header-y += rtc.h
diff --git a/include/asm-frv/ioctls.h b/include/asm-frv/ioctls.h
index 341c7ddef2a3..d0c30e31fbda 100644
--- a/include/asm-frv/ioctls.h
+++ b/include/asm-frv/ioctls.h
@@ -47,6 +47,10 @@
47#define TIOCSBRK 0x5427 /* BSD compatibility */ 47#define TIOCSBRK 0x5427 /* BSD compatibility */
48#define TIOCCBRK 0x5428 /* BSD compatibility */ 48#define TIOCCBRK 0x5428 /* BSD compatibility */
49#define TIOCGSID 0x5429 /* Return the session ID of FD */ 49#define TIOCGSID 0x5429 /* Return the session ID of FD */
50#define TCGETS2 _IOR('T',0x2A, struct termios2)
51#define TCSETS2 _IOW('T',0x2B, struct termios2)
52#define TCSETSW2 _IOW('T',0x2C, struct termios2)
53#define TCSETSF2 _IOW('T',0x2D, struct termios2)
50#define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */ 54#define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
51#define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */ 55#define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */
52 56
diff --git a/include/asm-frv/termbits.h b/include/asm-frv/termbits.h
index 74851b424d4f..5568492b5086 100644
--- a/include/asm-frv/termbits.h
+++ b/include/asm-frv/termbits.h
@@ -141,6 +141,7 @@ struct ktermios {
141#define HUPCL 0002000 141#define HUPCL 0002000
142#define CLOCAL 0004000 142#define CLOCAL 0004000
143#define CBAUDEX 0010000 143#define CBAUDEX 0010000
144#define BOTHER 0010000
144#define B57600 0010001 145#define B57600 0010001
145#define B115200 0010002 146#define B115200 0010002
146#define B230400 0010003 147#define B230400 0010003
@@ -156,11 +157,13 @@ struct ktermios {
156#define B3000000 0010015 157#define B3000000 0010015
157#define B3500000 0010016 158#define B3500000 0010016
158#define B4000000 0010017 159#define B4000000 0010017
159#define CIBAUD 002003600000 /* input baud rate (not used) */ 160#define CIBAUD 002003600000 /* Input baud rate */
160#define CTVB 004000000000 /* VisioBraille Terminal flow control */ 161#define CTVB 004000000000 /* VisioBraille Terminal flow control */
161#define CMSPAR 010000000000 /* mark or space (stick) parity */ 162#define CMSPAR 010000000000 /* mark or space (stick) parity */
162#define CRTSCTS 020000000000 /* flow control */ 163#define CRTSCTS 020000000000 /* flow control */
163 164
165#define IBSHIFT 16 /* Shift from CBAUD to CIBAUD */
166
164/* c_lflag bits */ 167/* c_lflag bits */
165#define ISIG 0000001 168#define ISIG 0000001
166#define ICANON 0000002 169#define ICANON 0000002
diff --git a/include/asm-ia64/kvm_host.h b/include/asm-ia64/kvm_host.h
index c082c208c1f3..1efe513a9941 100644
--- a/include/asm-ia64/kvm_host.h
+++ b/include/asm-ia64/kvm_host.h
@@ -38,6 +38,7 @@
38/* memory slots that does not exposed to userspace */ 38/* memory slots that does not exposed to userspace */
39#define KVM_PRIVATE_MEM_SLOTS 4 39#define KVM_PRIVATE_MEM_SLOTS 4
40 40
41#define KVM_COALESCED_MMIO_PAGE_OFFSET 1
41 42
42/* define exit reasons from vmm to kvm*/ 43/* define exit reasons from vmm to kvm*/
43#define EXIT_REASON_VM_PANIC 0 44#define EXIT_REASON_VM_PANIC 0
@@ -521,4 +522,6 @@ int kvm_emulate_halt(struct kvm_vcpu *vcpu);
521int kvm_pal_emul(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run); 522int kvm_pal_emul(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run);
522void kvm_sal_emul(struct kvm_vcpu *vcpu); 523void kvm_sal_emul(struct kvm_vcpu *vcpu);
523 524
525static inline void kvm_inject_nmi(struct kvm_vcpu *vcpu) {}
526
524#endif 527#endif
diff --git a/include/asm-m68k/amigahw.h b/include/asm-m68k/amigahw.h
index a16fe4e5a28a..5ca5dd951a4a 100644
--- a/include/asm-m68k/amigahw.h
+++ b/include/asm-m68k/amigahw.h
@@ -22,8 +22,6 @@
22 * Different Amiga models 22 * Different Amiga models
23 */ 23 */
24 24
25extern unsigned long amiga_model;
26
27#define AMI_UNKNOWN (0) 25#define AMI_UNKNOWN (0)
28#define AMI_500 (1) 26#define AMI_500 (1)
29#define AMI_500PLUS (2) 27#define AMI_500PLUS (2)
@@ -59,11 +57,9 @@ extern unsigned long amiga_chipset;
59 */ 57 */
60 58
61extern unsigned long amiga_eclock; /* 700 kHz E Peripheral Clock */ 59extern unsigned long amiga_eclock; /* 700 kHz E Peripheral Clock */
62extern unsigned long amiga_masterclock; /* 28 MHz Master Clock */
63extern unsigned long amiga_colorclock; /* 3.5 MHz Color Clock */ 60extern unsigned long amiga_colorclock; /* 3.5 MHz Color Clock */
64extern unsigned long amiga_chip_size; /* Chip RAM Size (bytes) */ 61extern unsigned long amiga_chip_size; /* Chip RAM Size (bytes) */
65extern unsigned char amiga_vblank; /* VBLANK Frequency */ 62extern unsigned char amiga_vblank; /* VBLANK Frequency */
66extern unsigned char amiga_psfreq; /* Power Supply Frequency */
67 63
68 64
69#define AMIGAHW_DECLARE(name) unsigned name : 1 65#define AMIGAHW_DECLARE(name) unsigned name : 1
diff --git a/include/asm-m68k/amigaints.h b/include/asm-m68k/amigaints.h
index 7c8713468fd2..b1bcdb835ab9 100644
--- a/include/asm-m68k/amigaints.h
+++ b/include/asm-m68k/amigaints.h
@@ -98,6 +98,8 @@
98#define CIA_ICR_ALL 0x1f 98#define CIA_ICR_ALL 0x1f
99#define CIA_ICR_SETCLR 0x80 99#define CIA_ICR_SETCLR 0x80
100 100
101extern void amiga_init_IRQ(void);
102
101/* to access the interrupt control registers of CIA's use only 103/* to access the interrupt control registers of CIA's use only
102** these functions, they behave exactly like the amiga os routines 104** these functions, they behave exactly like the amiga os routines
103*/ 105*/
diff --git a/include/asm-m68k/apollodma.h b/include/asm-m68k/apollodma.h
index 6821e3ba32e9..954adc851adb 100644
--- a/include/asm-m68k/apollodma.h
+++ b/include/asm-m68k/apollodma.h
@@ -1,4 +1,4 @@
1/* $Id: dma.h,v 1.7 1992/12/14 00:29:34 root Exp root $ 1/*
2 * linux/include/asm/dma.h: Defines for using and allocating dma channels. 2 * linux/include/asm/dma.h: Defines for using and allocating dma channels.
3 * Written by Hennus Bergman, 1992. 3 * Written by Hennus Bergman, 1992.
4 * High DMA channel support & info by Hannu Savolainen 4 * High DMA channel support & info by Hannu Savolainen
diff --git a/include/asm-m68k/dvma.h b/include/asm-m68k/dvma.h
index e1112de5a5e3..4fff408d0150 100644
--- a/include/asm-m68k/dvma.h
+++ b/include/asm-m68k/dvma.h
@@ -1,4 +1,4 @@
1/* $Id: dvma.h,v 1.4 1999/03/27 20:23:41 tsbogend Exp $ 1/*
2 * include/asm-m68k/dma.h 2 * include/asm-m68k/dma.h
3 * 3 *
4 * Copyright 1995 (C) David S. Miller (davem@caip.rutgers.edu) 4 * Copyright 1995 (C) David S. Miller (davem@caip.rutgers.edu)
@@ -63,8 +63,6 @@ static inline int dvma_map_cpu(unsigned long kaddr, unsigned long vaddr,
63 return 0; 63 return 0;
64} 64}
65 65
66extern unsigned long dvma_page(unsigned long kaddr, unsigned long vaddr);
67
68#else /* Sun3x */ 66#else /* Sun3x */
69 67
70/* sun3x dvma page support */ 68/* sun3x dvma page support */
diff --git a/include/asm-m68k/fpu.h b/include/asm-m68k/fpu.h
index 59701d7b4e78..ffb6b8cfc6d5 100644
--- a/include/asm-m68k/fpu.h
+++ b/include/asm-m68k/fpu.h
@@ -7,15 +7,15 @@
7 */ 7 */
8 8
9#if defined(CONFIG_M68020) || defined(CONFIG_M68030) 9#if defined(CONFIG_M68020) || defined(CONFIG_M68030)
10#define FPSTATESIZE (216/sizeof(unsigned char)) 10#define FPSTATESIZE (216)
11#elif defined(CONFIG_M68040) 11#elif defined(CONFIG_M68040)
12#define FPSTATESIZE (96/sizeof(unsigned char)) 12#define FPSTATESIZE (96)
13#elif defined(CONFIG_M68KFPU_EMU) 13#elif defined(CONFIG_M68KFPU_EMU)
14#define FPSTATESIZE (28/sizeof(unsigned char)) 14#define FPSTATESIZE (28)
15#elif defined(CONFIG_M68060) 15#elif defined(CONFIG_M68060)
16#define FPSTATESIZE (12/sizeof(unsigned char)) 16#define FPSTATESIZE (12)
17#else 17#else
18#define FPSTATESIZE error no_cpu_type_configured 18#define FPSTATESIZE (0)
19#endif 19#endif
20 20
21#endif /* __M68K_FPU_H */ 21#endif /* __M68K_FPU_H */
diff --git a/include/asm-m68k/irq.h b/include/asm-m68k/irq.h
index eb29a5260591..226bfc0f21b1 100644
--- a/include/asm-m68k/irq.h
+++ b/include/asm-m68k/irq.h
@@ -24,7 +24,7 @@
24#elif defined(CONFIG_HP300) 24#elif defined(CONFIG_HP300)
25#define NR_IRQS 8 25#define NR_IRQS 8
26#else 26#else
27#error unknown nr of irqs 27#define NR_IRQS 0
28#endif 28#endif
29 29
30/* 30/*
diff --git a/include/asm-m68k/mac_baboon.h b/include/asm-m68k/mac_baboon.h
index e87850830be8..c2a042b8c349 100644
--- a/include/asm-m68k/mac_baboon.h
+++ b/include/asm-m68k/mac_baboon.h
@@ -29,6 +29,4 @@ struct baboon {
29 */ 29 */
30}; 30};
31 31
32extern volatile struct baboon *baboon;
33
34#endif /* __ASSEMBLY **/ 32#endif /* __ASSEMBLY **/
diff --git a/include/asm-m68k/mac_via.h b/include/asm-m68k/mac_via.h
index 59b758cd16ad..39afb438b656 100644
--- a/include/asm-m68k/mac_via.h
+++ b/include/asm-m68k/mac_via.h
@@ -253,7 +253,6 @@
253 253
254extern volatile __u8 *via1,*via2; 254extern volatile __u8 *via1,*via2;
255extern int rbv_present,via_alt_mapping; 255extern int rbv_present,via_alt_mapping;
256extern __u8 rbv_clear;
257 256
258static inline int rbv_set_video_bpp(int bpp) 257static inline int rbv_set_video_bpp(int bpp)
259{ 258{
diff --git a/include/asm-m68k/machines.h b/include/asm-m68k/machines.h
index da6015a90f24..be667e84f01b 100644
--- a/include/asm-m68k/machines.h
+++ b/include/asm-m68k/machines.h
@@ -1,4 +1,4 @@
1/* $Id: machines.h,v 1.4 1995/11/25 02:31:58 davem Exp $ 1/*
2 * machines.h: Defines for taking apart the machine type value in the 2 * machines.h: Defines for taking apart the machine type value in the
3 * idprom and determining the kind of machine we are on. 3 * idprom and determining the kind of machine we are on.
4 * 4 *
@@ -21,8 +21,6 @@ struct Sun_Machine_Models {
21//#define NUM_SUN_MACHINES 23 21//#define NUM_SUN_MACHINES 23
22#define NUM_SUN_MACHINES 8 22#define NUM_SUN_MACHINES 8
23 23
24extern struct Sun_Machine_Models Sun_Machines[NUM_SUN_MACHINES];
25
26/* The machine type in the idprom area looks like this: 24/* The machine type in the idprom area looks like this:
27 * 25 *
28 * --------------- 26 * ---------------
diff --git a/include/asm-m68k/macintosh.h b/include/asm-m68k/macintosh.h
index 28b0f49ee521..05309f7e3d06 100644
--- a/include/asm-m68k/macintosh.h
+++ b/include/asm-m68k/macintosh.h
@@ -12,8 +12,6 @@ extern void mac_reset(void);
12extern void mac_poweroff(void); 12extern void mac_poweroff(void);
13extern void mac_init_IRQ(void); 13extern void mac_init_IRQ(void);
14extern int mac_irq_pending(unsigned int); 14extern int mac_irq_pending(unsigned int);
15extern void mac_identify(void);
16extern void mac_report_hardware(void);
17 15
18/* 16/*
19 * Floppy driver magic hook - probably shouldnt be here 17 * Floppy driver magic hook - probably shouldnt be here
@@ -21,9 +19,6 @@ extern void mac_report_hardware(void);
21 19
22extern void via1_set_head(int); 20extern void via1_set_head(int);
23 21
24extern void parse_booter(char *ptr);
25extern void print_booter(char *ptr);
26
27/* 22/*
28 * Macintosh Table 23 * Macintosh Table
29 */ 24 */
diff --git a/include/asm-m68k/md.h b/include/asm-m68k/md.h
index 467ea08383e4..d2f78f226f3d 100644
--- a/include/asm-m68k/md.h
+++ b/include/asm-m68k/md.h
@@ -1,4 +1,4 @@
1/* $Id: md.h,v 1.1 1997/12/15 15:12:04 jj Exp $ 1/*
2 * md.h: High speed xor_block operation for RAID4/5 2 * md.h: High speed xor_block operation for RAID4/5
3 * 3 *
4 */ 4 */
diff --git a/include/asm-m68k/openprom.h b/include/asm-m68k/openprom.h
index 869ab9176e9f..d33cdadf78e1 100644
--- a/include/asm-m68k/openprom.h
+++ b/include/asm-m68k/openprom.h
@@ -1,4 +1,3 @@
1/* $Id: openprom.h,v 1.19 1996/09/25 03:51:08 davem Exp $ */
2#ifndef __SPARC_OPENPROM_H 1#ifndef __SPARC_OPENPROM_H
3#define __SPARC_OPENPROM_H 2#define __SPARC_OPENPROM_H
4 3
diff --git a/include/asm-m68k/oplib.h b/include/asm-m68k/oplib.h
index 06caa2d08451..f082d03336bd 100644
--- a/include/asm-m68k/oplib.h
+++ b/include/asm-m68k/oplib.h
@@ -1,4 +1,4 @@
1/* $Id: oplib.h,v 1.12 1996/10/31 06:29:13 davem Exp $ 1/*
2 * oplib.h: Describes the interface and available routines in the 2 * oplib.h: Describes the interface and available routines in the
3 * Linux Prom library. 3 * Linux Prom library.
4 * 4 *
@@ -19,7 +19,6 @@ enum prom_major_version {
19 PROM_V2, /* sun4c and early sun4m V2 prom */ 19 PROM_V2, /* sun4c and early sun4m V2 prom */
20 PROM_V3, /* sun4m and later, up to sun4d/sun4e machines V3 */ 20 PROM_V3, /* sun4m and later, up to sun4d/sun4e machines V3 */
21 PROM_P1275, /* IEEE compliant ISA based Sun PROM, only sun4u */ 21 PROM_P1275, /* IEEE compliant ISA based Sun PROM, only sun4u */
22 PROM_AP1000, /* actually no prom at all */
23}; 22};
24 23
25extern enum prom_major_version prom_vers; 24extern enum prom_major_version prom_vers;
diff --git a/include/asm-m68k/sbus.h b/include/asm-m68k/sbus.h
index 3b25c0040aa6..bfe3ba147f2e 100644
--- a/include/asm-m68k/sbus.h
+++ b/include/asm-m68k/sbus.h
@@ -12,11 +12,6 @@ struct sbus_dev {
12 } reg_addrs[1]; 12 } reg_addrs[1];
13}; 13};
14 14
15extern void *sparc_alloc_io (u32, void *, int, char *, u32, int);
16#define sparc_alloc_io(a,b,c,d,e,f) (a)
17
18#define ARCH_SUN4 0
19
20/* sbus IO functions stolen from include/asm-sparc/io.h for the serial driver */ 15/* sbus IO functions stolen from include/asm-sparc/io.h for the serial driver */
21/* No SBUS on the Sun3, kludge -- sam */ 16/* No SBUS on the Sun3, kludge -- sam */
22 17
diff --git a/include/asm-m68k/sun3-head.h b/include/asm-m68k/sun3-head.h
index e74f384e269f..05af2f18b3bd 100644
--- a/include/asm-m68k/sun3-head.h
+++ b/include/asm-m68k/sun3-head.h
@@ -1,4 +1,3 @@
1/* $Id: head.h,v 1.32 1996/12/04 00:12:48 ecd Exp $ */
2#ifndef __SUN3_HEAD_H 1#ifndef __SUN3_HEAD_H
3#define __SUN3_HEAD_H 2#define __SUN3_HEAD_H
4 3
diff --git a/include/asm-m68k/tlbflush.h b/include/asm-m68k/tlbflush.h
index 17707ec315e2..acb6bf21a321 100644
--- a/include/asm-m68k/tlbflush.h
+++ b/include/asm-m68k/tlbflush.h
@@ -16,7 +16,7 @@ static inline void flush_tlb_kernel_page(void *addr)
16 ".chip 68k" 16 ".chip 68k"
17 : : "a" (addr)); 17 : : "a" (addr));
18 set_fs(old_fs); 18 set_fs(old_fs);
19 } else 19 } else if (CPU_IS_020_OR_030)
20 __asm__ __volatile__("pflush #4,#4,(%0)" : : "a" (addr)); 20 __asm__ __volatile__("pflush #4,#4,(%0)" : : "a" (addr));
21} 21}
22 22
@@ -29,7 +29,7 @@ static inline void __flush_tlb(void)
29 __asm__ __volatile__(".chip 68040\n\t" 29 __asm__ __volatile__(".chip 68040\n\t"
30 "pflushan\n\t" 30 "pflushan\n\t"
31 ".chip 68k"); 31 ".chip 68k");
32 else 32 else if (CPU_IS_020_OR_030)
33 __asm__ __volatile__("pflush #0,#4"); 33 __asm__ __volatile__("pflush #0,#4");
34} 34}
35 35
@@ -45,7 +45,7 @@ static inline void __flush_tlb_one(unsigned long addr)
45{ 45{
46 if (CPU_IS_040_OR_060) 46 if (CPU_IS_040_OR_060)
47 __flush_tlb040_one(addr); 47 __flush_tlb040_one(addr);
48 else 48 else if (CPU_IS_020_OR_030)
49 __asm__ __volatile__("pflush #0,#4,(%0)" : : "a" (addr)); 49 __asm__ __volatile__("pflush #0,#4,(%0)" : : "a" (addr));
50} 50}
51 51
@@ -60,7 +60,7 @@ static inline void flush_tlb_all(void)
60 __asm__ __volatile__(".chip 68040\n\t" 60 __asm__ __volatile__(".chip 68040\n\t"
61 "pflusha\n\t" 61 "pflusha\n\t"
62 ".chip 68k"); 62 ".chip 68k");
63 else 63 else if (CPU_IS_020_OR_030)
64 __asm__ __volatile__("pflusha"); 64 __asm__ __volatile__("pflusha");
65} 65}
66 66
diff --git a/include/asm-mips/bitops.h b/include/asm-mips/bitops.h
index 9a7274ba6a0b..49df8c4c9d25 100644
--- a/include/asm-mips/bitops.h
+++ b/include/asm-mips/bitops.h
@@ -82,7 +82,7 @@ static inline void set_bit(unsigned long nr, volatile unsigned long *addr)
82 "2: b 1b \n" 82 "2: b 1b \n"
83 " .previous \n" 83 " .previous \n"
84 : "=&r" (temp), "=m" (*m) 84 : "=&r" (temp), "=m" (*m)
85 : "i" (bit), "m" (*m), "r" (~0)); 85 : "ir" (bit), "m" (*m), "r" (~0));
86#endif /* CONFIG_CPU_MIPSR2 */ 86#endif /* CONFIG_CPU_MIPSR2 */
87 } else if (cpu_has_llsc) { 87 } else if (cpu_has_llsc) {
88 __asm__ __volatile__( 88 __asm__ __volatile__(
@@ -147,7 +147,7 @@ static inline void clear_bit(unsigned long nr, volatile unsigned long *addr)
147 "2: b 1b \n" 147 "2: b 1b \n"
148 " .previous \n" 148 " .previous \n"
149 : "=&r" (temp), "=m" (*m) 149 : "=&r" (temp), "=m" (*m)
150 : "i" (bit), "m" (*m)); 150 : "ir" (bit), "m" (*m));
151#endif /* CONFIG_CPU_MIPSR2 */ 151#endif /* CONFIG_CPU_MIPSR2 */
152 } else if (cpu_has_llsc) { 152 } else if (cpu_has_llsc) {
153 __asm__ __volatile__( 153 __asm__ __volatile__(
@@ -428,7 +428,7 @@ static inline int test_and_clear_bit(unsigned long nr,
428 "2: b 1b \n" 428 "2: b 1b \n"
429 " .previous \n" 429 " .previous \n"
430 : "=&r" (temp), "=m" (*m), "=&r" (res) 430 : "=&r" (temp), "=m" (*m), "=&r" (res)
431 : "i" (bit), "m" (*m) 431 : "ir" (bit), "m" (*m)
432 : "memory"); 432 : "memory");
433#endif 433#endif
434 } else if (cpu_has_llsc) { 434 } else if (cpu_has_llsc) {
diff --git a/include/asm-mips/bootinfo.h b/include/asm-mips/bootinfo.h
index d39e143b4a3c..610fe3af7a03 100644
--- a/include/asm-mips/bootinfo.h
+++ b/include/asm-mips/bootinfo.h
@@ -51,6 +51,12 @@
51#define MACH_MSP7120_FPGA 5 /* PMC-Sierra MSP7120 Emulation */ 51#define MACH_MSP7120_FPGA 5 /* PMC-Sierra MSP7120 Emulation */
52#define MACH_MSP_OTHER 255 /* PMC-Sierra unknown board type */ 52#define MACH_MSP_OTHER 255 /* PMC-Sierra unknown board type */
53 53
54/*
55 * Valid machtype for group Mikrotik
56 */
57#define MACH_MIKROTIK_RB532 0 /* Mikrotik RouterBoard 532 */
58#define MACH_MIKROTIK_RB532A 1 /* Mikrotik RouterBoard 532A */
59
54#define CL_SIZE COMMAND_LINE_SIZE 60#define CL_SIZE COMMAND_LINE_SIZE
55 61
56extern char *system_type; 62extern char *system_type;
diff --git a/include/asm-mips/fpu.h b/include/asm-mips/fpu.h
index e59d4c039661..8a3ef247659a 100644
--- a/include/asm-mips/fpu.h
+++ b/include/asm-mips/fpu.h
@@ -35,6 +35,8 @@ extern asmlinkage int (*save_fp_context32)(struct sigcontext32 __user *sc);
35extern asmlinkage int (*restore_fp_context32)(struct sigcontext32 __user *sc); 35extern asmlinkage int (*restore_fp_context32)(struct sigcontext32 __user *sc);
36 36
37extern void fpu_emulator_init_fpu(void); 37extern void fpu_emulator_init_fpu(void);
38extern int fpu_emulator_save_context(struct sigcontext __user *sc);
39extern int fpu_emulator_restore_context(struct sigcontext __user *sc);
38extern void _init_fpu(void); 40extern void _init_fpu(void);
39extern void _save_fp(struct task_struct *); 41extern void _save_fp(struct task_struct *);
40extern void _restore_fp(struct task_struct *); 42extern void _restore_fp(struct task_struct *);
diff --git a/include/asm-mips/mach-rc32434/cpu-feature-overrides.h b/include/asm-mips/mach-rc32434/cpu-feature-overrides.h
new file mode 100644
index 000000000000..f3bc7efa2608
--- /dev/null
+++ b/include/asm-mips/mach-rc32434/cpu-feature-overrides.h
@@ -0,0 +1,81 @@
1/*
2 * IDT RC32434 specific CPU feature overrides
3 *
4 * Copyright (C) 2008 Florian Fainelli <florian@openwrt.org>
5 *
6 * This file was derived from: include/asm-mips/cpu-features.h
7 * Copyright (C) 2003, 2004 Ralf Baechle
8 * Copyright (C) 2004 Maciej W. Rozycki
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 2
13 * of the License, or (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
22 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
23 * Boston, MA 02110-1301, USA.
24 */
25#ifndef __ASM_MACH_RC32434_CPU_FEATURE_OVERRIDES_H
26#define __ASM_MACH_RC32434_CPU_FEATURE_OVERRIDES_H
27
28/*
29 * The IDT RC32434 SOC has a built-in MIPS 4Kc core.
30 */
31#define cpu_has_tlb 1
32#define cpu_has_4kex 1
33#define cpu_has_3k_cache 0
34#define cpu_has_4k_cache 1
35#define cpu_has_tx39_cache 0
36#define cpu_has_sb1_cache 0
37#define cpu_has_fpu 0
38#define cpu_has_32fpr 0
39#define cpu_has_counter 1
40#define cpu_has_watch 1
41#define cpu_has_divec 1
42#define cpu_has_vce 0
43#define cpu_has_cache_cdex_p 0
44#define cpu_has_cache_cdex_s 0
45#define cpu_has_prefetch 1
46#define cpu_has_mcheck 1
47#define cpu_has_ejtag 1
48#define cpu_has_llsc 1
49
50#define cpu_has_mips16 0
51#define cpu_has_mdmx 0
52#define cpu_has_mips3d 0
53#define cpu_has_smartmips 0
54
55#define cpu_has_vtag_icache 0
56/* #define cpu_has_dc_aliases ? */
57/* #define cpu_has_ic_fills_f_dc ? */
58/* #define cpu_has_pindexed_dcache ? */
59
60/* #define cpu_icache_snoops_remote_store ? */
61
62#define cpu_has_mips32r1 1
63#define cpu_has_mips32r2 0
64#define cpu_has_mips64r1 0
65#define cpu_has_mips64r2 0
66
67#define cpu_has_dsp 0
68#define cpu_has_mipsmt 0
69
70/* #define cpu_has_nofpuex ? */
71#define cpu_has_64bits 0
72#define cpu_has_64bit_zero_reg 0
73#define cpu_has_64bit_gp_regs 0
74#define cpu_has_64bit_addresses 0
75
76#define cpu_has_inclusive_pcaches 0
77
78#define cpu_dcache_line_size() 16
79#define cpu_icache_line_size() 16
80
81#endif /* __ASM_MACH_RC32434_CPU_FEATURE_OVERRIDES_H */
diff --git a/include/asm-mips/mach-rc32434/ddr.h b/include/asm-mips/mach-rc32434/ddr.h
new file mode 100644
index 000000000000..291e2cf9dde0
--- /dev/null
+++ b/include/asm-mips/mach-rc32434/ddr.h
@@ -0,0 +1,141 @@
1/*
2 * Definitions for the DDR registers
3 *
4 * Copyright 2002 Ryan Holm <ryan.holmQVist@idt.com>
5 * Copyright 2008 Florian Fainelli <florian@openwrt.org>
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 as published by the
9 * Free Software Foundation; either version 2 of the License, or (at your
10 * option) any later version.
11 *
12 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
13 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
14 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
15 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
16 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
17 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
18 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
19 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
20 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
21 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
22 *
23 * You should have received a copy of the GNU General Public License along
24 * with this program; if not, write to the Free Software Foundation, Inc.,
25 * 675 Mass Ave, Cambridge, MA 02139, USA.
26 *
27 */
28
29#ifndef _ASM_RC32434_DDR_H_
30#define _ASM_RC32434_DDR_H_
31
32#include <asm/mach-rc32434/rb.h>
33
34/* DDR register structure */
35struct ddr_ram {
36 u32 ddrbase;
37 u32 ddrmask;
38 u32 res1;
39 u32 res2;
40 u32 ddrc;
41 u32 ddrabase;
42 u32 ddramask;
43 u32 ddramap;
44 u32 ddrcust;
45 u32 ddrrdc;
46 u32 ddrspare;
47};
48
49#define DDR0_PHYS_ADDR 0x18018000
50
51/* DDR banks masks */
52#define DDR_MASK 0xffff0000
53#define DDR0_BASE_MSK DDR_MASK
54#define DDR1_BASE_MSK DDR_MASK
55
56/* DDR bank0 registers */
57#define RC32434_DDR0_ATA_BIT 5
58#define RC32434_DDR0_ATA_MSK 0x000000E0
59#define RC32434_DDR0_DBW_BIT 8
60#define RC32434_DDR0_DBW_MSK 0x00000100
61#define RC32434_DDR0_WR_BIT 9
62#define RC32434_DDR0_WR_MSK 0x00000600
63#define RC32434_DDR0_PS_BIT 11
64#define RC32434_DDR0_PS_MSK 0x00001800
65#define RC32434_DDR0_DTYPE_BIT 13
66#define RC32434_DDR0_DTYPE_MSK 0x0000e000
67#define RC32434_DDR0_RFC_BIT 16
68#define RC32434_DDR0_RFC_MSK 0x000f0000
69#define RC32434_DDR0_RP_BIT 20
70#define RC32434_DDR0_RP_MSK 0x00300000
71#define RC32434_DDR0_AP_BIT 22
72#define RC32434_DDR0_AP_MSK 0x00400000
73#define RC32434_DDR0_RCD_BIT 23
74#define RC32434_DDR0_RCD_MSK 0x01800000
75#define RC32434_DDR0_CL_BIT 25
76#define RC32434_DDR0_CL_MSK 0x06000000
77#define RC32434_DDR0_DBM_BIT 27
78#define RC32434_DDR0_DBM_MSK 0x08000000
79#define RC32434_DDR0_SDS_BIT 28
80#define RC32434_DDR0_SDS_MSK 0x10000000
81#define RC32434_DDR0_ATP_BIT 29
82#define RC32434_DDR0_ATP_MSK 0x60000000
83#define RC32434_DDR0_RE_BIT 31
84#define RC32434_DDR0_RE_MSK 0x80000000
85
86/* DDR bank C registers */
87#define RC32434_DDRC_MSK(x) BIT_TO_MASK(x)
88#define RC32434_DDRC_CES_BIT 0
89#define RC32434_DDRC_ACE_BIT 1
90
91/* Custom DDR bank registers */
92#define RC32434_DCST_MSK(x) BIT_TO_MASK(x)
93#define RC32434_DCST_CS_BIT 0
94#define RC32434_DCST_CS_MSK 0x00000003
95#define RC32434_DCST_WE_BIT 2
96#define RC32434_DCST_RAS_BIT 3
97#define RC32434_DCST_CAS_BIT 4
98#define RC32434_DSCT_CKE_BIT 5
99#define RC32434_DSCT_BA_BIT 6
100#define RC32434_DSCT_BA_MSK 0x000000c0
101
102/* DDR QSC registers */
103#define RC32434_QSC_DM_BIT 0
104#define RC32434_QSC_DM_MSK 0x00000003
105#define RC32434_QSC_DQSBS_BIT 2
106#define RC32434_QSC_DQSBS_MSK 0x000000fc
107#define RC32434_QSC_DB_BIT 8
108#define RC32434_QSC_DB_MSK 0x00000100
109#define RC32434_QSC_DBSP_BIT 9
110#define RC32434_QSC_DBSP_MSK 0x01fffe00
111#define RC32434_QSC_BDP_BIT 25
112#define RC32434_QSC_BDP_MSK 0x7e000000
113
114/* DDR LLC registers */
115#define RC32434_LLC_EAO_BIT 0
116#define RC32434_LLC_EAO_MSK 0x00000001
117#define RC32434_LLC_EO_BIT 1
118#define RC32434_LLC_EO_MSK 0x0000003e
119#define RC32434_LLC_FS_BIT 6
120#define RC32434_LLC_FS_MSK 0x000000c0
121#define RC32434_LLC_AS_BIT 8
122#define RC32434_LLC_AS_MSK 0x00000700
123#define RC32434_LLC_SP_BIT 11
124#define RC32434_LLC_SP_MSK 0x001ff800
125
126/* DDR LLFC registers */
127#define RC32434_LLFC_MSK(x) BIT_TO_MASK(x)
128#define RC32434_LLFC_MEN_BIT 0
129#define RC32434_LLFC_EAN_BIT 1
130#define RC32434_LLFC_FF_BIT 2
131
132/* DDR DLLTA registers */
133#define RC32434_DLLTA_ADDR_BIT 2
134#define RC32434_DLLTA_ADDR_MSK 0xfffffffc
135
136/* DDR DLLED registers */
137#define RC32434_DLLED_MSK(x) BIT_TO_MASK(x)
138#define RC32434_DLLED_DBE_BIT 0
139#define RC32434_DLLED_DTE_BIT 1
140
141#endif /* _ASM_RC32434_DDR_H_ */
diff --git a/include/asm-mips/mach-rc32434/dma.h b/include/asm-mips/mach-rc32434/dma.h
new file mode 100644
index 000000000000..5f898b5873f7
--- /dev/null
+++ b/include/asm-mips/mach-rc32434/dma.h
@@ -0,0 +1,103 @@
1/*
2 * Copyright 2002 Integrated Device Technology, Inc.
3 * All rights reserved.
4 *
5 * DMA register definition.
6 *
7 * Author : ryan.holmQVist@idt.com
8 * Date : 20011005
9 */
10
11#ifndef __ASM_RC32434_DMA_H
12#define __ASM_RC32434_DMA_H
13
14#include <asm/mach-rc32434/rb.h>
15
16#define DMA0_BASE_ADDR 0x18040000
17
18/*
19 * DMA descriptor (in physical memory).
20 */
21
22struct dma_desc {
23 u32 control; /* Control. use DMAD_* */
24 u32 ca; /* Current Address. */
25 u32 devcs; /* Device control and status. */
26 u32 link; /* Next descriptor in chain. */
27};
28
29#define DMA_DESC_SIZ sizeof(struct dma_desc)
30#define DMA_DESC_COUNT_BIT 0
31#define DMA_DESC_COUNT_MSK 0x0003ffff
32#define DMA_DESC_DS_BIT 20
33#define DMA_DESC_DS_MSK 0x00300000
34
35#define DMA_DESC_DEV_CMD_BIT 22
36#define DMA_DESC_DEV_CMD_MSK 0x01c00000
37
38/* DMA command sizes */
39#define DMA_DESC_DEV_CMD_BYTE 0
40#define DMA_DESC_DEV_CMD_HLF_WD 1
41#define DMA_DESC_DEV_CMD_WORD 2
42#define DMA_DESC_DEV_CMD_2WORDS 3
43#define DMA_DESC_DEV_CMD_4WORDS 4
44#define DMA_DESC_DEV_CMD_6WORDS 5
45#define DMA_DESC_DEV_CMD_8WORDS 6
46#define DMA_DESC_DEV_CMD_16WORDS 7
47
48/* DMA descriptors interrupts */
49#define DMA_DESC_COF (1 << 25) /* Chain on finished */
50#define DMA_DESC_COD (1 << 26) /* Chain on done */
51#define DMA_DESC_IOF (1 << 27) /* Interrupt on finished */
52#define DMA_DESC_IOD (1 << 28) /* Interrupt on done */
53#define DMA_DESC_TERM (1 << 29) /* Terminated */
54#define DMA_DESC_DONE (1 << 30) /* Done */
55#define DMA_DESC_FINI (1 << 31) /* Finished */
56
57/*
58 * DMA register (within Internal Register Map).
59 */
60
61struct dma_reg {
62 u32 dmac; /* Control. */
63 u32 dmas; /* Status. */
64 u32 dmasm; /* Mask. */
65 u32 dmadptr; /* Descriptor pointer. */
66 u32 dmandptr; /* Next descriptor pointer. */
67};
68
69/* DMA channels specific registers */
70#define DMA_CHAN_RUN_BIT (1 << 0)
71#define DMA_CHAN_DONE_BIT (1 << 1)
72#define DMA_CHAN_MODE_BIT (1 << 2)
73#define DMA_CHAN_MODE_MSK 0x0000000c
74#define DMA_CHAN_MODE_AUTO 0
75#define DMA_CHAN_MODE_BURST 1
76#define DMA_CHAN_MODE_XFRT 2
77#define DMA_CHAN_MODE_RSVD 3
78#define DMA_CHAN_ACT_BIT (1 << 4)
79
80/* DMA status registers */
81#define DMA_STAT_FINI (1 << 0)
82#define DMA_STAT_DONE (1 << 1)
83#define DMA_STAT_CHAIN (1 << 2)
84#define DMA_STAT_ERR (1 << 3)
85#define DMA_STAT_HALT (1 << 4)
86
87/*
88 * DMA channel definitions
89 */
90
91#define DMA_CHAN_ETH_RCV 0
92#define DMA_CHAN_ETH_XMT 1
93#define DMA_CHAN_MEM_TO_FIFO 2
94#define DMA_CHAN_FIFO_TO_MEM 3
95#define DMA_CHAN_PCI_TO_MEM 4
96#define DMA_CHAN_MEM_TO_PCI 5
97#define DMA_CHAN_COUNT 6
98
99struct dma_channel {
100 struct dma_reg ch[DMA_CHAN_COUNT];
101};
102
103#endif /* __ASM_RC32434_DMA_H */
diff --git a/include/asm-mips/mach-rc32434/dma_v.h b/include/asm-mips/mach-rc32434/dma_v.h
new file mode 100644
index 000000000000..173a9f9146cd
--- /dev/null
+++ b/include/asm-mips/mach-rc32434/dma_v.h
@@ -0,0 +1,52 @@
1/*
2 * Copyright 2002 Integrated Device Technology, Inc.
3 * All rights reserved.
4 *
5 * DMA register definition.
6 *
7 * Author : ryan.holmQVist@idt.com
8 * Date : 20011005
9 */
10
11#ifndef _ASM_RC32434_DMA_V_H_
12#define _ASM_RC32434_DMA_V_H_
13
14#include <asm/mach-rc32434/dma.h>
15#include <asm/mach-rc32434/rc32434.h>
16
17#define DMA_CHAN_OFFSET 0x14
18#define IS_DMA_USED(X) (((X) & \
19 (DMA_DESC_FINI | DMA_DESC_DONE | DMA_DESC_TERM)) \
20 != 0)
21#define DMA_COUNT(count) ((count) & DMA_DESC_COUNT_MSK)
22
23#define DMA_HALT_TIMEOUT 500
24
25static inline int rc32434_halt_dma(struct dma_reg *ch)
26{
27 int timeout = 1;
28 if (__raw_readl(&ch->dmac) & DMA_CHAN_RUN_BIT) {
29 __raw_writel(0, &ch->dmac);
30 for (timeout = DMA_HALT_TIMEOUT; timeout > 0; timeout--) {
31 if (__raw_readl(&ch->dmas) & DMA_STAT_HALT) {
32 __raw_writel(0, &ch->dmas);
33 break;
34 }
35 }
36 }
37
38 return timeout ? 0 : 1;
39}
40
41static inline void rc32434_start_dma(struct dma_reg *ch, u32 dma_addr)
42{
43 __raw_writel(0, &ch->dmandptr);
44 __raw_writel(dma_addr, &ch->dmadptr);
45}
46
47static inline void rc32434_chain_dma(struct dma_reg *ch, u32 dma_addr)
48{
49 __raw_writel(dma_addr, &ch->dmandptr);
50}
51
52#endif /* _ASM_RC32434_DMA_V_H_ */
diff --git a/include/asm-mips/mach-rc32434/eth.h b/include/asm-mips/mach-rc32434/eth.h
new file mode 100644
index 000000000000..a25cbc56173d
--- /dev/null
+++ b/include/asm-mips/mach-rc32434/eth.h
@@ -0,0 +1,220 @@
1/*
2 * Definitions for the Ethernet registers
3 *
4 * Copyright 2002 Allend Stichter <allen.stichter@idt.com>
5 * Copyright 2008 Florian Fainelli <florian@openwrt.org>
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 as published by the
9 * Free Software Foundation; either version 2 of the License, or (at your
10 * option) any later version.
11 *
12 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
13 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
14 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
15 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
16 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
17 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
18 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
19 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
20 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
21 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
22 *
23 * You should have received a copy of the GNU General Public License along
24 * with this program; if not, write to the Free Software Foundation, Inc.,
25 * 675 Mass Ave, Cambridge, MA 02139, USA.
26 *
27 */
28
29#ifndef __ASM_RC32434_ETH_H
30#define __ASM_RC32434_ETH_H
31
32
33#define ETH0_BASE_ADDR 0x18060000
34
35struct eth_regs {
36 u32 ethintfc;
37 u32 ethfifott;
38 u32 etharc;
39 u32 ethhash0;
40 u32 ethhash1;
41 u32 ethu0[4]; /* Reserved. */
42 u32 ethpfs;
43 u32 ethmcp;
44 u32 eth_u1[10]; /* Reserved. */
45 u32 ethspare;
46 u32 eth_u2[42]; /* Reserved. */
47 u32 ethsal0;
48 u32 ethsah0;
49 u32 ethsal1;
50 u32 ethsah1;
51 u32 ethsal2;
52 u32 ethsah2;
53 u32 ethsal3;
54 u32 ethsah3;
55 u32 ethrbc;
56 u32 ethrpc;
57 u32 ethrupc;
58 u32 ethrfc;
59 u32 ethtbc;
60 u32 ethgpf;
61 u32 eth_u9[50]; /* Reserved. */
62 u32 ethmac1;
63 u32 ethmac2;
64 u32 ethipgt;
65 u32 ethipgr;
66 u32 ethclrt;
67 u32 ethmaxf;
68 u32 eth_u10; /* Reserved. */
69 u32 ethmtest;
70 u32 miimcfg;
71 u32 miimcmd;
72 u32 miimaddr;
73 u32 miimwtd;
74 u32 miimrdd;
75 u32 miimind;
76 u32 eth_u11; /* Reserved. */
77 u32 eth_u12; /* Reserved. */
78 u32 ethcfsa0;
79 u32 ethcfsa1;
80 u32 ethcfsa2;
81};
82
83/* Ethernet interrupt registers */
84#define ETH_INT_FC_EN (1 << 0)
85#define ETH_INT_FC_ITS (1 << 1)
86#define ETH_INT_FC_RIP (1 << 2)
87#define ETH_INT_FC_JAM (1 << 3)
88#define ETH_INT_FC_OVR (1 << 4)
89#define ETH_INT_FC_UND (1 << 5)
90#define ETH_INT_FC_IOC 0x000000c0
91
92/* Ethernet FIFO registers */
93#define ETH_FIFI_TT_TTH_BIT 0
94#define ETH_FIFO_TT_TTH 0x0000007f
95
96/* Ethernet ARC/multicast registers */
97#define ETH_ARC_PRO (1 << 0)
98#define ETH_ARC_AM (1 << 1)
99#define ETH_ARC_AFM (1 << 2)
100#define ETH_ARC_AB (1 << 3)
101
102/* Ethernet SAL registers */
103#define ETH_SAL_BYTE_5 0x000000ff
104#define ETH_SAL_BYTE_4 0x0000ff00
105#define ETH_SAL_BYTE_3 0x00ff0000
106#define ETH_SAL_BYTE_2 0xff000000
107
108/* Ethernet SAH registers */
109#define ETH_SAH_BYTE1 0x000000ff
110#define ETH_SAH_BYTE0 0x0000ff00
111
112/* Ethernet GPF register */
113#define ETH_GPF_PTV 0x0000ffff
114
115/* Ethernet PFG register */
116#define ETH_PFS_PFD (1 << 0)
117
118/* Ethernet CFSA[0-3] registers */
119#define ETH_CFSA0_CFSA4 0x000000ff
120#define ETH_CFSA0_CFSA5 0x0000ff00
121#define ETH_CFSA1_CFSA2 0x000000ff
122#define ETH_CFSA1_CFSA3 0x0000ff00
123#define ETH_CFSA1_CFSA0 0x000000ff
124#define ETH_CFSA1_CFSA1 0x0000ff00
125
126/* Ethernet MAC1 registers */
127#define ETH_MAC1_RE (1 << 0)
128#define ETH_MAC1_PAF (1 << 1)
129#define ETH_MAC1_RFC (1 << 2)
130#define ETH_MAC1_TFC (1 << 3)
131#define ETH_MAC1_LB (1 << 4)
132#define ETH_MAC1_MR (1 << 31)
133
134/* Ethernet MAC2 registers */
135#define ETH_MAC2_FD (1 << 0)
136#define ETH_MAC2_FLC (1 << 1)
137#define ETH_MAC2_HFE (1 << 2)
138#define ETH_MAC2_DC (1 << 3)
139#define ETH_MAC2_CEN (1 << 4)
140#define ETH_MAC2_PE (1 << 5)
141#define ETH_MAC2_VPE (1 << 6)
142#define ETH_MAC2_APE (1 << 7)
143#define ETH_MAC2_PPE (1 << 8)
144#define ETH_MAC2_LPE (1 << 9)
145#define ETH_MAC2_NB (1 << 12)
146#define ETH_MAC2_BP (1 << 13)
147#define ETH_MAC2_ED (1 << 14)
148
149/* Ethernet IPGT register */
150#define ETH_IPGT 0x0000007f
151
152/* Ethernet IPGR registers */
153#define ETH_IPGR_IPGR2 0x0000007f
154#define ETH_IPGR_IPGR1 0x00007f00
155
156/* Ethernet CLRT registers */
157#define ETH_CLRT_MAX_RET 0x0000000f
158#define ETH_CLRT_COL_WIN 0x00003f00
159
160/* Ethernet MAXF register */
161#define ETH_MAXF 0x0000ffff
162
163/* Ethernet test registers */
164#define ETH_TEST_REG (1 << 2)
165#define ETH_MCP_DIV 0x000000ff
166
167/* MII registers */
168#define ETH_MII_CFG_RSVD 0x0000000c
169#define ETH_MII_CMD_RD (1 << 0)
170#define ETH_MII_CMD_SCN (1 << 1)
171#define ETH_MII_REG_ADDR 0x0000001f
172#define ETH_MII_PHY_ADDR 0x00001f00
173#define ETH_MII_WTD_DATA 0x0000ffff
174#define ETH_MII_RDD_DATA 0x0000ffff
175#define ETH_MII_IND_BSY (1 << 0)
176#define ETH_MII_IND_SCN (1 << 1)
177#define ETH_MII_IND_NV (1 << 2)
178
179/*
180 * Values for the DEVCS field of the Ethernet DMA Rx and Tx descriptors.
181 */
182
183#define ETH_RX_FD (1 << 0)
184#define ETH_RX_LD (1 << 1)
185#define ETH_RX_ROK (1 << 2)
186#define ETH_RX_FM (1 << 3)
187#define ETH_RX_MP (1 << 4)
188#define ETH_RX_BP (1 << 5)
189#define ETH_RX_VLT (1 << 6)
190#define ETH_RX_CF (1 << 7)
191#define ETH_RX_OVR (1 << 8)
192#define ETH_RX_CRC (1 << 9)
193#define ETH_RX_CV (1 << 10)
194#define ETH_RX_DB (1 << 11)
195#define ETH_RX_LE (1 << 12)
196#define ETH_RX_LOR (1 << 13)
197#define ETH_RX_CES (1 << 14)
198#define ETH_RX_LEN_BIT 16
199#define ETH_RX_LEN 0xffff0000
200
201#define ETH_TX_FD (1 << 0)
202#define ETH_TX_LD (1 << 1)
203#define ETH_TX_OEN (1 << 2)
204#define ETH_TX_PEN (1 << 3)
205#define ETH_TX_CEN (1 << 4)
206#define ETH_TX_HEN (1 << 5)
207#define ETH_TX_TOK (1 << 6)
208#define ETH_TX_MP (1 << 7)
209#define ETH_TX_BP (1 << 8)
210#define ETH_TX_UND (1 << 9)
211#define ETH_TX_OF (1 << 10)
212#define ETH_TX_ED (1 << 11)
213#define ETH_TX_EC (1 << 12)
214#define ETH_TX_LC (1 << 13)
215#define ETH_TX_TD (1 << 14)
216#define ETH_TX_CRC (1 << 15)
217#define ETH_TX_LE (1 << 16)
218#define ETH_TX_CC 0x001E0000
219
220#endif /* __ASM_RC32434_ETH_H */
diff --git a/include/asm-mips/mach-rc32434/gpio.h b/include/asm-mips/mach-rc32434/gpio.h
new file mode 100644
index 000000000000..f946f5f45bbb
--- /dev/null
+++ b/include/asm-mips/mach-rc32434/gpio.h
@@ -0,0 +1,126 @@
1/*
2 * Copyright 2002 Integrated Device Technology, Inc.
3 * All rights reserved.
4 *
5 * GPIO register definition.
6 *
7 * Author : ryan.holmQVist@idt.com
8 * Date : 20011005
9 * Copyright (C) 2001, 2002 Ryan Holm <ryan.holmQVist@idt.com>
10 * Copyright (C) 2008 Florian Fainelli <florian@openwrt.org>
11 */
12
13#ifndef _RC32434_GPIO_H_
14#define _RC32434_GPIO_H_
15
16#include <linux/types.h>
17
18struct rb532_gpio_reg {
19 u32 gpiofunc; /* GPIO Function Register
20 * gpiofunc[x]==0 bit = gpio
21 * func[x]==1 bit = altfunc
22 */
23 u32 gpiocfg; /* GPIO Configuration Register
24 * gpiocfg[x]==0 bit = input
25 * gpiocfg[x]==1 bit = output
26 */
27 u32 gpiod; /* GPIO Data Register
28 * gpiod[x] read/write gpio pinX status
29 */
30 u32 gpioilevel; /* GPIO Interrupt Status Register
31 * interrupt level (see gpioistat)
32 */
33 u32 gpioistat; /* Gpio Interrupt Status Register
34 * istat[x] = (gpiod[x] == level[x])
35 * cleared in ISR (STICKY bits)
36 */
37 u32 gpionmien; /* GPIO Non-maskable Interrupt Enable Register */
38};
39
40/* UART GPIO signals */
41#define RC32434_UART0_SOUT (1 << 0)
42#define RC32434_UART0_SIN (1 << 1)
43#define RC32434_UART0_RTS (1 << 2)
44#define RC32434_UART0_CTS (1 << 3)
45
46/* M & P bus GPIO signals */
47#define RC32434_MP_BIT_22 (1 << 4)
48#define RC32434_MP_BIT_23 (1 << 5)
49#define RC32434_MP_BIT_24 (1 << 6)
50#define RC32434_MP_BIT_25 (1 << 7)
51
52/* CPU GPIO signals */
53#define RC32434_CPU_GPIO (1 << 8)
54
55/* Reserved GPIO signals */
56#define RC32434_AF_SPARE_6 (1 << 9)
57#define RC32434_AF_SPARE_4 (1 << 10)
58#define RC32434_AF_SPARE_3 (1 << 11)
59#define RC32434_AF_SPARE_2 (1 << 12)
60
61/* PCI messaging unit */
62#define RC32434_PCI_MSU_GPIO (1 << 13)
63
64
65extern void set_434_reg(unsigned reg_offs, unsigned bit, unsigned len, unsigned val);
66extern unsigned get_434_reg(unsigned reg_offs);
67extern void set_latch_u5(unsigned char or_mask, unsigned char nand_mask);
68extern unsigned char get_latch_u5(void);
69
70extern int rb532_gpio_get_value(unsigned gpio);
71extern void rb532_gpio_set_value(unsigned gpio, int value);
72extern int rb532_gpio_direction_input(unsigned gpio);
73extern int rb532_gpio_direction_output(unsigned gpio, int value);
74extern void rb532_gpio_set_int_level(unsigned gpio, int value);
75extern int rb532_gpio_get_int_level(unsigned gpio);
76extern void rb532_gpio_set_int_status(unsigned gpio, int value);
77extern int rb532_gpio_get_int_status(unsigned gpio);
78
79
80/* Wrappers for the arch-neutral GPIO API */
81
82static inline int gpio_request(unsigned gpio, const char *label)
83{
84 /* Not yet implemented */
85 return 0;
86}
87
88static inline void gpio_free(unsigned gpio)
89{
90 /* Not yet implemented */
91}
92
93static inline int gpio_direction_input(unsigned gpio)
94{
95 return rb532_gpio_direction_input(gpio);
96}
97
98static inline int gpio_direction_output(unsigned gpio, int value)
99{
100 return rb532_gpio_direction_output(gpio, value);
101}
102
103static inline int gpio_get_value(unsigned gpio)
104{
105 return rb532_gpio_get_value(gpio);
106}
107
108static inline void gpio_set_value(unsigned gpio, int value)
109{
110 rb532_gpio_set_value(gpio, value);
111}
112
113static inline int gpio_to_irq(unsigned gpio)
114{
115 return gpio;
116}
117
118static inline int irq_to_gpio(unsigned irq)
119{
120 return irq;
121}
122
123/* For cansleep */
124#include <asm-generic/gpio.h>
125
126#endif /* _RC32434_GPIO_H_ */
diff --git a/include/asm-mips/mach-rc32434/integ.h b/include/asm-mips/mach-rc32434/integ.h
new file mode 100644
index 000000000000..fa65bc3d8807
--- /dev/null
+++ b/include/asm-mips/mach-rc32434/integ.h
@@ -0,0 +1,59 @@
1/*
2 * Definitions for the Watchdog registers
3 *
4 * Copyright 2002 Ryan Holm <ryan.holmQVist@idt.com>
5 * Copyright 2008 Florian Fainelli <florian@openwrt.org>
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 as published by the
9 * Free Software Foundation; either version 2 of the License, or (at your
10 * option) any later version.
11 *
12 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
13 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
14 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
15 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
16 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
17 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
18 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
19 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
20 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
21 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
22 *
23 * You should have received a copy of the GNU General Public License along
24 * with this program; if not, write to the Free Software Foundation, Inc.,
25 * 675 Mass Ave, Cambridge, MA 02139, USA.
26 *
27 */
28
29#ifndef __RC32434_INTEG_H__
30#define __RC32434_INTEG_H__
31
32#include <asm/mach-rc32434/rb.h>
33
34#define INTEG0_BASE_ADDR 0x18030030
35
36struct integ {
37 u32 errcs; /* sticky use ERRCS_ */
38 u32 wtcount; /* Watchdog timer count reg. */
39 u32 wtcompare; /* Watchdog timer timeout value. */
40 u32 wtc; /* Watchdog timer control. use WTC_ */
41};
42
43/* Error counters */
44#define RC32434_ERR_WTO 0
45#define RC32434_ERR_WNE 1
46#define RC32434_ERR_UCW 2
47#define RC32434_ERR_UCR 3
48#define RC32434_ERR_UPW 4
49#define RC32434_ERR_UPR 5
50#define RC32434_ERR_UDW 6
51#define RC32434_ERR_UDR 7
52#define RC32434_ERR_SAE 8
53#define RC32434_ERR_WRE 9
54
55/* Watchdog control bits */
56#define RC32434_WTC_EN 0
57#define RC32434_WTC_TO 1
58
59#endif /* __RC32434_INTEG_H__ */
diff --git a/include/asm-mips/mach-rc32434/irq.h b/include/asm-mips/mach-rc32434/irq.h
new file mode 100644
index 000000000000..cb9e4725f5dc
--- /dev/null
+++ b/include/asm-mips/mach-rc32434/irq.h
@@ -0,0 +1,8 @@
1#ifndef __ASM_RC32434_IRQ_H
2#define __ASM_RC32434_IRQ_H
3
4#define NR_IRQS 256
5
6#include <asm/mach-generic/irq.h>
7
8#endif /* __ASM_RC32434_IRQ_H */
diff --git a/include/asm-mips/mach-rc32434/pci.h b/include/asm-mips/mach-rc32434/pci.h
new file mode 100644
index 000000000000..410638f2af74
--- /dev/null
+++ b/include/asm-mips/mach-rc32434/pci.h
@@ -0,0 +1,481 @@
1/*
2 * This program is free software; you can redistribute it and/or modify it
3 * under the terms of the GNU General Public License as published by the
4 * Free Software Foundation; either version 2 of the License, or (at your
5 * option) any later version.
6 *
7 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
8 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
9 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
10 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
11 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
12 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
13 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
14 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
15 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
16 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
17 *
18 * You should have received a copy of the GNU General Public License along
19 * with this program; if not, write to the Free Software Foundation, Inc.,
20 * 675 Mass Ave, Cambridge, MA 02139, USA.
21 *
22 * Copyright 2004 IDT Inc. (rischelp@idt.com)
23 *
24 * Initial Release
25 */
26
27#ifndef _ASM_RC32434_PCI_H_
28#define _ASM_RC32434_PCI_H_
29
30#define epld_mask ((volatile unsigned char *)0xB900000d)
31
32#define PCI0_BASE_ADDR 0x18080000
33#define PCI_LBA_COUNT 4
34
35struct pci_map {
36 u32 address; /* Address. */
37 u32 control; /* Control. */
38 u32 mapping; /* mapping. */
39};
40
41struct pci_reg {
42 u32 pcic;
43 u32 pcis;
44 u32 pcism;
45 u32 pcicfga;
46 u32 pcicfgd;
47 volatile struct pci_map pcilba[PCI_LBA_COUNT];
48 u32 pcidac;
49 u32 pcidas;
50 u32 pcidasm;
51 u32 pcidad;
52 u32 pcidma8c;
53 u32 pcidma9c;
54 u32 pcitc;
55};
56
57#define PCI_MSU_COUNT 2
58
59struct pci_msu {
60 u32 pciim[PCI_MSU_COUNT];
61 u32 pciom[PCI_MSU_COUNT];
62 u32 pciid;
63 u32 pciiic;
64 u32 pciiim;
65 u32 pciiod;
66 u32 pciioic;
67 u32 pciioim;
68};
69
70/*
71 * PCI Control Register
72 */
73
74#define PCI_CTL_EN (1 << 0)
75#define PCI_CTL_TNR (1 << 1)
76#define PCI_CTL_SCE (1 << 2)
77#define PCI_CTL_IEN (1 << 3)
78#define PCI_CTL_AAA (1 << 4)
79#define PCI_CTL_EAP (1 << 5)
80#define PCI_CTL_PCIM_BIT 6
81#define PCI_CTL_PCIM 0x000001c0
82
83#define PCI_CTL_PCIM_DIS 0
84#define PCI_CTL_PCIM_TNR 1 /* Satellite - target not ready */
85#define PCI_CTL_PCIM_SUS 2 /* Satellite - suspended CPU. */
86#define PCI_CTL_PCIM_EXT 3 /* Host - external arbiter. */
87#define PCI_CTL PCIM_PRIO 4 /* Host - fixed priority arb. */
88#define PCI_CTL_PCIM_RR 5 /* Host - round robin priority. */
89#define PCI_CTL_PCIM_RSVD6 6
90#define PCI_CTL_PCIM_RSVD7 7
91
92#define PCI_CTL_IGM (1 << 9)
93
94/*
95 * PCI Status Register
96 */
97
98#define PCI_STAT_EED (1 << 0)
99#define PCI_STAT_WR (1 << 1)
100#define PCI_STAT_NMI (1 << 2)
101#define PCI_STAT_II (1 << 3)
102#define PCI_STAT_CWE (1 << 4)
103#define PCI_STAT_CRE (1 << 5)
104#define PCI_STAT_MDPE (1 << 6)
105#define PCI_STAT_STA (1 << 7)
106#define PCI_STAT_RTA (1 << 8)
107#define PCI_STAT_RMA (1 << 9)
108#define PCI_STAT_SSE (1 << 10)
109#define PCI_STAT_OSE (1 << 11)
110#define PCI_STAT_PE (1 << 12)
111#define PCI_STAT_TAE (1 << 13)
112#define PCI_STAT_RLE (1 << 14)
113#define PCI_STAT_BME (1 << 15)
114#define PCI_STAT_PRD (1 << 16)
115#define PCI_STAT_RIP (1 << 17)
116
117/*
118 * PCI Status Mask Register
119 */
120
121#define PCI_STATM_EED PCI_STAT_EED
122#define PCI_STATM_WR PCI_STAT_WR
123#define PCI_STATM_NMI PCI_STAT_NMI
124#define PCI_STATM_II PCI_STAT_II
125#define PCI_STATM_CWE PCI_STAT_CWE
126#define PCI_STATM_CRE PCI_STAT_CRE
127#define PCI_STATM_MDPE PCI_STAT_MDPE
128#define PCI_STATM_STA PCI_STAT_STA
129#define PCI_STATM_RTA PCI_STAT_RTA
130#define PCI_STATM_RMA PCI_STAT_RMA
131#define PCI_STATM_SSE PCI_STAT_SSE
132#define PCI_STATM_OSE PCI_STAT_OSE
133#define PCI_STATM_PE PCI_STAT_PE
134#define PCI_STATM_TAE PCI_STAT_TAE
135#define PCI_STATM_RLE PCI_STAT_RLE
136#define PCI_STATM_BME PCI_STAT_BME
137#define PCI_STATM_PRD PCI_STAT_PRD
138#define PCI_STATM_RIP PCI_STAT_RIP
139
140/*
141 * PCI Configuration Address Register
142 */
143#define PCI_CFGA_REG_BIT 2
144#define PCI_CFGA_REG 0x000000fc
145#define PCI_CFGA_REG_ID (0x00 >> 2) /* use PCFGID */
146#define PCI_CFGA_REG_04 (0x04 >> 2) /* use PCFG04_ */
147#define PCI_CFGA_REG_08 (0x08 >> 2) /* use PCFG08_ */
148#define PCI_CFGA_REG_0C (0x0C >> 2) /* use PCFG0C_ */
149#define PCI_CFGA_REG_PBA0 (0x10 >> 2) /* use PCIPBA_ */
150#define PCI_CFGA_REG_PBA1 (0x14 >> 2) /* use PCIPBA_ */
151#define PCI_CFGA_REG_PBA2 (0x18 >> 2) /* use PCIPBA_ */
152#define PCI_CFGA_REG_PBA3 (0x1c >> 2) /* use PCIPBA_ */
153#define PCI_CFGA_REG_SUBSYS (0x2c >> 2) /* use PCFGSS_ */
154#define PCI_CFGA_REG_3C (0x3C >> 2) /* use PCFG3C_ */
155#define PCI_CFGA_REG_PBBA0C (0x44 >> 2) /* use PCIPBAC_ */
156#define PCI_CFGA_REG_PBA0M (0x48 >> 2)
157#define PCI_CFGA_REG_PBA1C (0x4c >> 2) /* use PCIPBAC_ */
158#define PCI_CFGA_REG_PBA1M (0x50 >> 2)
159#define PCI_CFGA_REG_PBA2C (0x54 >> 2) /* use PCIPBAC_ */
160#define PCI_CFGA_REG_PBA2M (0x58 >> 2)
161#define PCI_CFGA_REG_PBA3C (0x5c >> 2) /* use PCIPBAC_ */
162#define PCI_CFGA_REG_PBA3M (0x60 >> 2)
163#define PCI_CFGA_REG_PMGT (0x64 >> 2)
164#define PCI_CFGA_FUNC_BIT 8
165#define PCI_CFGA_FUNC 0x00000700
166#define PCI_CFGA_DEV_BIT 11
167#define PCI_CFGA_DEV 0x0000f800
168#define PCI_CFGA_DEV_INTERN 0
169#define PCI_CFGA_BUS_BIT 16
170#define PCI CFGA_BUS 0x00ff0000
171#define PCI_CFGA_BUS_TYPE0 0
172#define PCI_CFGA_EN (1 << 31)
173
174/* PCI CFG04 commands */
175#define PCI_CFG04_CMD_IO_ENA (1 << 0)
176#define PCI_CFG04_CMD_MEM_ENA (1 << 1)
177#define PCI_CFG04_CMD_BM_ENA (1 << 2)
178#define PCI_CFG04_CMD_MW_INV (1 << 4)
179#define PCI_CFG04_CMD_PAR_ENA (1 << 6)
180#define PCI_CFG04_CMD_SER_ENA (1 << 8)
181#define PCI_CFG04_CMD_FAST_ENA (1 << 9)
182
183/* PCI CFG04 status fields */
184#define PCI_CFG04_STAT_BIT 16
185#define PCI_CFG04_STAT 0xffff0000
186#define PCI_CFG04_STAT_66_MHZ (1 << 21)
187#define PCI_CFG04_STAT_FBB (1 << 23)
188#define PCI_CFG04_STAT_MDPE (1 << 24)
189#define PCI_CFG04_STAT_DST (1 << 25)
190#define PCI_CFG04_STAT_STA (1 << 27)
191#define PCI_CFG04_STAT_RTA (1 << 28)
192#define PCI_CFG04_STAT_RMA (1 << 29)
193#define PCI_CFG04_STAT_SSE (1 << 30)
194#define PCI_CFG04_STAT_PE (1 << 31)
195
196#define PCI_PBA_MSI (1 << 0)
197#define PCI_PBA_P (1 << 2)
198
199/* PCI PBAC registers */
200#define PCI_PBAC_MSI (1 << 0)
201#define PCI_PBAC_P (1 << 1)
202#define PCI_PBAC_SIZE_BIT 2
203#define PCI_PBAC_SIZE 0x0000007c
204#define PCI_PBAC_SB (1 << 7)
205#define PCI_PBAC_PP (1 << 8)
206#define PCI_PBAC_MR_BIT 9
207#define PCI_PBAC_MR 0x00000600
208#define PCI_PBAC_MR_RD 0
209#define PCI_PBAC_MR_RD_LINE 1
210#define PCI_PBAC_MR_RD_MULT 2
211#define PCI_PBAC_MRL (1 << 11)
212#define PCI_PBAC_MRM (1 << 12)
213#define PCI_PBAC_TRP (1 << 13)
214
215#define PCI_CFG40_TRDY_TIM 0x000000ff
216#define PCI_CFG40_RET_LIM 0x0000ff00
217
218/*
219 * PCI Local Base Address [0|1|2|3] Register
220 */
221
222#define PCI_LBA_BADDR_BIT 0
223#define PCI_LBA_BADDR 0xffffff00
224
225/*
226 * PCI Local Base Address Control Register
227 */
228
229#define PCI_LBAC_MSI (1 << 0)
230#define PCI_LBAC_MSI_MEM 0
231#define PCI_LBAC_MSI_IO 1
232#define PCI_LBAC_SIZE_BIT 2
233#define PCI_LBAC_SIZE 0x0000007c
234#define PCI_LBAC_SB (1 << 7)
235#define PCI_LBAC_RT (1 << 8)
236#define PCI_LBAC_RT_NO_PREF 0
237#define PCI_LBAC_RT_PREF 1
238
239/*
240 * PCI Local Base Address [0|1|2|3] Mapping Register
241 */
242#define PCI_LBAM_MADDR_BIT 8
243#define PCI_LBAM_MADDR 0xffffff00
244
245/*
246 * PCI Decoupled Access Control Register
247 */
248#define PCI_DAC_DEN (1 << 0)
249
250/*
251 * PCI Decoupled Access Status Register
252 */
253#define PCI_DAS_D (1 << 0)
254#define PCI_DAS_B (1 << 1)
255#define PCI_DAS_E (1 << 2)
256#define PCI_DAS_OFE (1 << 3)
257#define PCI_DAS_OFF (1 << 4)
258#define PCI_DAS_IFE (1 << 5)
259#define PCI_DAS_IFF (1 << 6)
260
261/*
262 * PCI DMA Channel 8 Configuration Register
263 */
264#define PCI_DMA8C_MBS_BIT 0
265#define PCI_DMA8C_MBS 0x00000fff /* Maximum Burst Size. */
266#define PCI_DMA8C_OUR (1 << 12)
267
268/*
269 * PCI DMA Channel 9 Configuration Register
270 */
271#define PCI_DMA9C_MBS_BIT 0 /* Maximum Burst Size. */
272#define PCI_DMA9C_MBS 0x00000fff
273
274/*
275 * PCI to Memory(DMA Channel 8) AND Memory to PCI DMA(DMA Channel 9)Descriptors
276 */
277
278#define PCI_DMAD_PT_BIT 22 /* in DEVCMD field (descriptor) */
279#define PCI_DMAD_PT 0x00c00000 /* preferred transaction field */
280/* These are for reads (DMA channel 8) */
281#define PCI_DMAD_DEVCMD_MR 0 /* memory read */
282#define PCI_DMAD_DEVCMD_MRL 1 /* memory read line */
283#define PCI_DMAD_DEVCMD_MRM 2 /* memory read multiple */
284#define PCI_DMAD_DEVCMD_IOR 3 /* I/O read */
285/* These are for writes (DMA channel 9) */
286#define PCI_DMAD_DEVCMD_MW 0 /* memory write */
287#define PCI_DMAD_DEVCMD_MWI 1 /* memory write invalidate */
288#define PCI_DMAD_DEVCMD_IOW 3 /* I/O write */
289
290/* Swap byte field applies to both DMA channel 8 and 9 */
291#define PCI_DMAD_SB (1 << 24) /* swap byte field */
292
293
294/*
295 * PCI Target Control Register
296 */
297
298#define PCI_TC_RTIMER_BIT 0
299#define PCI_TC_RTIMER 0x000000ff
300#define PCI_TC_DTIMER_BIT 8
301#define PCI_TC_DTIMER 0x0000ff00
302#define PCI_TC_RDR (1 << 18)
303#define PCI_TC_DDT (1 << 19)
304
305/*
306 * PCI messaging unit [applies to both inbound and outbound registers ]
307 */
308#define PCI_MSU_M0 (1 << 0)
309#define PCI_MSU_M1 (1 << 1)
310#define PCI_MSU_DB (1 << 2)
311
312#define PCI_MSG_ADDR 0xB8088010
313#define PCI0_ADDR 0xB8080000
314#define rc32434_pci ((struct pci_reg *) PCI0_ADDR)
315#define rc32434_pci_msg ((struct pci_msu *) PCI_MSG_ADDR)
316
317#define PCIM_SHFT 0x6
318#define PCIM_BIT_LEN 0x7
319#define PCIM_H_EA 0x3
320#define PCIM_H_IA_FIX 0x4
321#define PCIM_H_IA_RR 0x5
322#if 0
323#define PCI_ADDR_START 0x13000000
324#endif
325
326#define PCI_ADDR_START 0x50000000
327
328#define CPUTOPCI_MEM_WIN 0x02000000
329#define CPUTOPCI_IO_WIN 0x00100000
330#define PCILBA_SIZE_SHFT 2
331#define PCILBA_SIZE_MASK 0x1F
332#define SIZE_256MB 0x1C
333#define SIZE_128MB 0x1B
334#define SIZE_64MB 0x1A
335#define SIZE_32MB 0x19
336#define SIZE_16MB 0x18
337#define SIZE_4MB 0x16
338#define SIZE_2MB 0x15
339#define SIZE_1MB 0x14
340#define KORINA_CONFIG0_ADDR 0x80000000
341#define KORINA_CONFIG1_ADDR 0x80000004
342#define KORINA_CONFIG2_ADDR 0x80000008
343#define KORINA_CONFIG3_ADDR 0x8000000C
344#define KORINA_CONFIG4_ADDR 0x80000010
345#define KORINA_CONFIG5_ADDR 0x80000014
346#define KORINA_CONFIG6_ADDR 0x80000018
347#define KORINA_CONFIG7_ADDR 0x8000001C
348#define KORINA_CONFIG8_ADDR 0x80000020
349#define KORINA_CONFIG9_ADDR 0x80000024
350#define KORINA_CONFIG10_ADDR 0x80000028
351#define KORINA_CONFIG11_ADDR 0x8000002C
352#define KORINA_CONFIG12_ADDR 0x80000030
353#define KORINA_CONFIG13_ADDR 0x80000034
354#define KORINA_CONFIG14_ADDR 0x80000038
355#define KORINA_CONFIG15_ADDR 0x8000003C
356#define KORINA_CONFIG16_ADDR 0x80000040
357#define KORINA_CONFIG17_ADDR 0x80000044
358#define KORINA_CONFIG18_ADDR 0x80000048
359#define KORINA_CONFIG19_ADDR 0x8000004C
360#define KORINA_CONFIG20_ADDR 0x80000050
361#define KORINA_CONFIG21_ADDR 0x80000054
362#define KORINA_CONFIG22_ADDR 0x80000058
363#define KORINA_CONFIG23_ADDR 0x8000005C
364#define KORINA_CONFIG24_ADDR 0x80000060
365#define KORINA_CONFIG25_ADDR 0x80000064
366#define KORINA_CMD (PCI_CFG04_CMD_IO_ENA | \
367 PCI_CFG04_CMD_MEM_ENA | \
368 PCI_CFG04_CMD_BM_ENA | \
369 PCI_CFG04_CMD_MW_INV | \
370 PCI_CFG04_CMD_PAR_ENA | \
371 PCI_CFG04_CMD_SER_ENA)
372
373#define KORINA_STAT (PCI_CFG04_STAT_MDPE | \
374 PCI_CFG04_STAT_STA | \
375 PCI_CFG04_STAT_RTA | \
376 PCI_CFG04_STAT_RMA | \
377 PCI_CFG04_STAT_SSE | \
378 PCI_CFG04_STAT_PE)
379
380#define KORINA_CNFG1 ((KORINA_STAT<<16)|KORINA_CMD)
381
382#define KORINA_REVID 0
383#define KORINA_CLASS_CODE 0
384#define KORINA_CNFG2 ((KORINA_CLASS_CODE<<8) | \
385 KORINA_REVID)
386
387#define KORINA_CACHE_LINE_SIZE 4
388#define KORINA_MASTER_LAT 0x3c
389#define KORINA_HEADER_TYPE 0
390#define KORINA_BIST 0
391
392#define KORINA_CNFG3 ((KORINA_BIST << 24) | \
393 (KORINA_HEADER_TYPE<<16) | \
394 (KORINA_MASTER_LAT<<8) | \
395 KORINA_CACHE_LINE_SIZE)
396
397#define KORINA_BAR0 0x00000008 /* 128 MB Memory */
398#define KORINA_BAR1 0x18800001 /* 1 MB IO */
399#define KORINA_BAR2 0x18000001 /* 2 MB IO window for Korina
400 internal Registers */
401#define KORINA_BAR3 0x48000008 /* Spare 128 MB Memory */
402
403#define KORINA_CNFG4 KORINA_BAR0
404#define KORINA_CNFG5 KORINA_BAR1
405#define KORINA_CNFG6 KORINA_BAR2
406#define KORINA_CNFG7 KORINA_BAR3
407
408#define KORINA_SUBSYS_VENDOR_ID 0x011d
409#define KORINA_SUBSYSTEM_ID 0x0214
410#define KORINA_CNFG8 0
411#define KORINA_CNFG9 0
412#define KORINA_CNFG10 0
413#define KORINA_CNFG11 ((KORINA_SUBSYS_VENDOR_ID<<16) | \
414 KORINA_SUBSYSTEM_ID)
415#define KORINA_INT_LINE 1
416#define KORINA_INT_PIN 1
417#define KORINA_MIN_GNT 8
418#define KORINA_MAX_LAT 0x38
419#define KORINA_CNFG12 0
420#define KORINA_CNFG13 0
421#define KORINA_CNFG14 0
422#define KORINA_CNFG15 ((KORINA_MAX_LAT<<24) | \
423 (KORINA_MIN_GNT<<16) | \
424 (KORINA_INT_PIN<<8) | \
425 KORINA_INT_LINE)
426#define KORINA_RETRY_LIMIT 0x80
427#define KORINA_TRDY_LIMIT 0x80
428#define KORINA_CNFG16 ((KORINA_RETRY_LIMIT<<8) | \
429 KORINA_TRDY_LIMIT)
430#define PCI_PBAxC_R 0x0
431#define PCI_PBAxC_RL 0x1
432#define PCI_PBAxC_RM 0x2
433#define SIZE_SHFT 2
434
435#if defined(__MIPSEB__)
436#define KORINA_PBA0C (PCI_PBAC_MRL | PCI_PBAC_SB | \
437 ((PCI_PBAxC_RM & 0x3) << PCI_PBAC_MR_BIT) | \
438 PCI_PBAC_PP | \
439 (SIZE_128MB<<SIZE_SHFT) | \
440 PCI_PBAC_P)
441#else
442#define KORINA_PBA0C (PCI_PBAC_MRL | \
443 ((PCI_PBAxC_RM & 0x3) << PCI_PBAC_MR_BIT) | \
444 PCI_PBAC_PP | \
445 (SIZE_128MB<<SIZE_SHFT) | \
446 PCI_PBAC_P)
447#endif
448#define KORINA_CNFG17 KORINA_PBA0C
449#define KORINA_PBA0M 0x0
450#define KORINA_CNFG18 KORINA_PBA0M
451
452#if defined(__MIPSEB__)
453#define KORINA_PBA1C ((SIZE_1MB<<SIZE_SHFT) | PCI_PBAC_SB | \
454 PCI_PBAC_MSI)
455#else
456#define KORINA_PBA1C ((SIZE_1MB<<SIZE_SHFT) | \
457 PCI_PBAC_MSI)
458#endif
459#define KORINA_CNFG19 KORINA_PBA1C
460#define KORINA_PBA1M 0x0
461#define KORINA_CNFG20 KORINA_PBA1M
462
463#if defined(__MIPSEB__)
464#define KORINA_PBA2C ((SIZE_2MB<<SIZE_SHFT) | PCI_PBAC_SB | \
465 PCI_PBAC_MSI)
466#else
467#define KORINA_PBA2C ((SIZE_2MB<<SIZE_SHFT) | \
468 PCI_PBAC_MSI)
469#endif
470#define KORINA_CNFG21 KORINA_PBA2C
471#define KORINA_PBA2M 0x18000000
472#define KORINA_CNFG22 KORINA_PBA2M
473#define KORINA_PBA3C 0
474#define KORINA_CNFG23 KORINA_PBA3C
475#define KORINA_PBA3M 0
476#define KORINA_CNFG24 KORINA_PBA3M
477
478#define PCITC_DTIMER_VAL 8
479#define PCITC_RTIMER_VAL 0x10
480
481#endif /* __ASM_RC32434_PCI_H */
diff --git a/include/asm-mips/mach-rc32434/prom.h b/include/asm-mips/mach-rc32434/prom.h
new file mode 100644
index 000000000000..1d66ddcda89a
--- /dev/null
+++ b/include/asm-mips/mach-rc32434/prom.h
@@ -0,0 +1,44 @@
1/*
2 * Definitions for the PROM
3 *
4 * Copyright 2002 Ryan Holm <ryan.holmQVist@idt.com>
5 * Copyright 2008 Florian Fainelli <florian@openwrt.org>
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 as published by the
9 * Free Software Foundation; either version 2 of the License, or (at your
10 * option) any later version.
11 *
12 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
13 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
14 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
15 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
16 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
17 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
18 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
19 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
20 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
21 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
22 *
23 * You should have received a copy of the GNU General Public License along
24 * with this program; if not, write to the Free Software Foundation, Inc.,
25 * 675 Mass Ave, Cambridge, MA 02139, USA.
26 *
27 */
28
29#define PROM_ENTRY(x) (0xbfc00000 + ((x) * 8))
30
31#define GPIO_INIT_NOBUTTON ""
32#define GPIO_INIT_BUTTON " 2"
33
34#define SR_NMI 0x00180000
35#define SERIAL_SPEED_ENTRY 0x00000001
36
37#define FREQ_TAG "HZ="
38#define GPIO_TAG "gpio="
39#define KMAC_TAG "kmac="
40#define MEM_TAG "mem="
41#define BOARD_TAG "board="
42
43#define BOARD_RB532 "500"
44#define BOARD_RB532A "500r5"
diff --git a/include/asm-mips/mach-rc32434/rb.h b/include/asm-mips/mach-rc32434/rb.h
new file mode 100644
index 000000000000..e0a76e3ffea8
--- /dev/null
+++ b/include/asm-mips/mach-rc32434/rb.h
@@ -0,0 +1,81 @@
1/*
2 * This program is free software; you can redistribute it and/or modify
3 * it under the terms of the GNU General Public License as published by
4 * the Free Software Foundation; either version 2 of the License, or
5 * (at your option) any later version.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 *
12 * Copyright (C) 2004 IDT Inc.
13 * Copyright (C) 2006 Felix Fietkau <nbd@openwrt.org>
14 */
15#ifndef __ASM_RC32434_RB_H
16#define __ASM_RC32434_RB_H
17
18#include <linux/genhd.h>
19
20#define IDT434_REG_BASE ((volatile void *) KSEG1ADDR(0x18000000))
21#define DEV0BASE 0x010000
22#define DEV0MASK 0x010004
23#define DEV0C 0x010008
24#define DEV0T 0x01000C
25#define DEV1BASE 0x010010
26#define DEV1MASK 0x010014
27#define DEV1C 0x010018
28#define DEV1TC 0x01001C
29#define DEV2BASE 0x010020
30#define DEV2MASK 0x010024
31#define DEV2C 0x010028
32#define DEV2TC 0x01002C
33#define DEV3BASE 0x010030
34#define DEV3MASK 0x010034
35#define DEV3C 0x010038
36#define DEV3TC 0x01003C
37#define BTCS 0x010040
38#define BTCOMPARE 0x010044
39#define GPIOBASE 0x050000
40#define GPIOCFG 0x050004
41#define GPIOD 0x050008
42#define GPIOILEVEL 0x05000C
43#define GPIOISTAT 0x050010
44#define GPIONMIEN 0x050014
45#define IMASK6 0x038038
46#define LO_WPX (1 << 0)
47#define LO_ALE (1 << 1)
48#define LO_CLE (1 << 2)
49#define LO_CEX (1 << 3)
50#define LO_FOFF (1 << 5)
51#define LO_SPICS (1 << 6)
52#define LO_ULED (1 << 7)
53
54#define BIT_TO_MASK(x) (1 << x)
55
56struct dev_reg {
57 u32 base;
58 u32 mask;
59 u32 ctl;
60 u32 timing;
61};
62
63struct korina_device {
64 char *name;
65 unsigned char mac[6];
66 struct net_device *dev;
67};
68
69struct cf_device {
70 int gpio_pin;
71 void *dev;
72 struct gendisk *gd;
73};
74
75struct mpmc_device {
76 unsigned char state;
77 spinlock_t lock;
78 void __iomem *base;
79};
80
81#endif /* __ASM_RC32434_RB_H */
diff --git a/include/asm-mips/mach-rc32434/rc32434.h b/include/asm-mips/mach-rc32434/rc32434.h
new file mode 100644
index 000000000000..c4a02145104e
--- /dev/null
+++ b/include/asm-mips/mach-rc32434/rc32434.h
@@ -0,0 +1,61 @@
1/*
2 * Definitions for IDT RC323434 CPU.
3 */
4
5#ifndef _ASM_RC32434_RC32434_H_
6#define _ASM_RC32434_RC32434_H_
7
8#include <linux/delay.h>
9#include <linux/io.h>
10
11#define RC32434_REG_BASE 0x18000000
12#define RC32434_RST (1 << 15)
13
14#define IDT_CLOCK_MULT 2
15#define MIPS_CPU_TIMER_IRQ 7
16
17/* Interrupt Controller */
18#define IC_GROUP0_PEND (RC32434_REG_BASE + 0x38000)
19#define IC_GROUP0_MASK (RC32434_REG_BASE + 0x38008)
20#define IC_GROUP_OFFSET 0x0C
21
22#define NUM_INTR_GROUPS 5
23
24/* 16550 UARTs */
25#define GROUP0_IRQ_BASE 8 /* GRP2 IRQ numbers start here */
26 /* GRP3 IRQ numbers start here */
27#define GROUP1_IRQ_BASE (GROUP0_IRQ_BASE + 32)
28 /* GRP4 IRQ numbers start here */
29#define GROUP2_IRQ_BASE (GROUP1_IRQ_BASE + 32)
30 /* GRP5 IRQ numbers start here */
31#define GROUP3_IRQ_BASE (GROUP2_IRQ_BASE + 32)
32#define GROUP4_IRQ_BASE (GROUP3_IRQ_BASE + 32)
33
34
35#ifdef __MIPSEB__
36#define RC32434_UART0_BASE (RC32434_REG_BASE + 0x58003)
37#else
38#define RC32434_UART0_BASE (RC32434_REG_BASE + 0x58000)
39#endif
40
41#define RC32434_UART0_IRQ (GROUP3_IRQ_BASE + 0)
42
43/* cpu pipeline flush */
44static inline void rc32434_sync(void)
45{
46 __asm__ volatile ("sync");
47}
48
49static inline void rc32434_sync_udelay(int us)
50{
51 __asm__ volatile ("sync");
52 udelay(us);
53}
54
55static inline void rc32434_sync_delay(int ms)
56{
57 __asm__ volatile ("sync");
58 mdelay(ms);
59}
60
61#endif /* _ASM_RC32434_RC32434_H_ */
diff --git a/include/asm-mips/mach-rc32434/timer.h b/include/asm-mips/mach-rc32434/timer.h
new file mode 100644
index 000000000000..e49b1d57a017
--- /dev/null
+++ b/include/asm-mips/mach-rc32434/timer.h
@@ -0,0 +1,65 @@
1/*
2 * Definitions for timer registers
3 *
4 * Copyright 2004 Philip Rischel <rischelp@idt.com>
5 * Copyright 2008 Florian Fainelli <florian@openwrt.org>
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 as published by the
9 * Free Software Foundation; either version 2 of the License, or (at your
10 * option) any later version.
11 *
12 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
13 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
14 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
15 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
16 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
17 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
18 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
19 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
20 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
21 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
22 *
23 * You should have received a copy of the GNU General Public License along
24 * with this program; if not, write to the Free Software Foundation, Inc.,
25 * 675 Mass Ave, Cambridge, MA 02139, USA.
26 *
27 */
28
29#ifndef __ASM_RC32434_TIMER_H
30#define __ASM_RC32434_TIMER_H
31
32#include <asm/mach-rc32434/rb.h>
33
34#define TIMER0_BASE_ADDR 0x18028000
35#define TIMER_COUNT 3
36
37struct timer_counter {
38 u32 count;
39 u32 compare;
40 u32 ctc; /*use CTC_ */
41};
42
43struct timer {
44 struct timer_counter tim[TIMER_COUNT];
45 u32 rcount; /* use RCOUNT_ */
46 u32 rcompare; /* use RCOMPARE_ */
47 u32 rtc; /* use RTC_ */
48};
49
50#define RC32434_CTC_EN_BIT 0
51#define RC32434_CTC_TO_BIT 1
52
53/* Real time clock registers */
54#define RC32434_RTC_MSK(x) BIT_TO_MASK(x)
55#define RC32434_RTC_CE_BIT 0
56#define RC32434_RTC_TO_BIT 1
57#define RC32434_RTC_RQE_BIT 2
58
59/* Counter registers */
60#define RC32434_RCOUNT_BIT 0
61#define RC32434_RCOUNT_MSK 0x0000ffff
62#define RC32434_RCOMP_BIT 0
63#define RC32434_RCOMP_MSK 0x0000ffff
64
65#endif /* __ASM_RC32434_TIMER_H */
diff --git a/include/asm-mips/mach-rc32434/war.h b/include/asm-mips/mach-rc32434/war.h
new file mode 100644
index 000000000000..3ddf187e98a6
--- /dev/null
+++ b/include/asm-mips/mach-rc32434/war.h
@@ -0,0 +1,25 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 2002, 2004, 2007 by Ralf Baechle <ralf@linux-mips.org>
7 */
8#ifndef __ASM_MIPS_MACH_MIPS_WAR_H
9#define __ASM_MIPS_MACH_MIPS_WAR_H
10
11#define R4600_V1_INDEX_ICACHEOP_WAR 0
12#define R4600_V1_HIT_CACHEOP_WAR 0
13#define R4600_V2_HIT_CACHEOP_WAR 0
14#define R5432_CP0_INTERRUPT_WAR 0
15#define BCM1250_M3_WAR 0
16#define SIBYTE_1956_WAR 0
17#define MIPS4K_ICACHE_REFILL_WAR 1
18#define MIPS_CACHE_SYNC_WAR 0
19#define TX49XX_ICACHE_INDEX_INV_WAR 0
20#define RM9000_CDEX_SMP_WAR 0
21#define ICACHE_REFILLS_WORKAROUND_WAR 0
22#define R10000_LLSC_WAR 0
23#define MIPS34K_MISSED_ITLB_WAR 0
24
25#endif /* __ASM_MIPS_MACH_MIPS_WAR_H */
diff --git a/include/asm-mips/mips-boards/atlas.h b/include/asm-mips/mips-boards/atlas.h
deleted file mode 100644
index a8ae12d120ee..000000000000
--- a/include/asm-mips/mips-boards/atlas.h
+++ /dev/null
@@ -1,80 +0,0 @@
1/*
2 * Carsten Langgaard, carstenl@mips.com
3 * Copyright (C) 2000 MIPS Technologies, Inc. All rights reserved.
4 *
5 * ########################################################################
6 *
7 * This program is free software; you can distribute it and/or modify it
8 * under the terms of the GNU General Public License (Version 2) as
9 * published by the Free Software Foundation.
10 *
11 * This program is distributed in the hope it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
19 *
20 * ########################################################################
21 *
22 * Defines of the Atlas board specific address-MAP, registers, etc.
23 *
24 */
25#ifndef _MIPS_ATLAS_H
26#define _MIPS_ATLAS_H
27
28#include <asm/addrspace.h>
29
30/*
31 * Atlas RTC-device indirect register access.
32 */
33#define ATLAS_RTC_ADR_REG 0x1f000800
34#define ATLAS_RTC_DAT_REG 0x1f000808
35
36/*
37 * Atlas interrupt controller register base.
38 */
39#define ATLAS_ICTRL_REGS_BASE 0x1f000000
40
41/*
42 * Atlas registers are memory mapped on 64-bit aligned boundaries and
43 * only word access are allowed.
44 */
45struct atlas_ictrl_regs {
46 volatile unsigned int intraw;
47 int dummy1;
48 volatile unsigned int intseten;
49 int dummy2;
50 volatile unsigned int intrsten;
51 int dummy3;
52 volatile unsigned int intenable;
53 int dummy4;
54 volatile unsigned int intstatus;
55 int dummy5;
56};
57
58/*
59 * Atlas UART register base.
60 */
61#define ATLAS_UART_REGS_BASE 0x1f000900
62#define ATLAS_BASE_BAUD ( 3686400 / 16 )
63
64/*
65 * Atlas PSU standby register.
66 */
67#define ATLAS_PSUSTBY_REG 0x1f000600
68#define ATLAS_GOSTBY 0x4d
69
70/*
71 * We make a universal assumption about the way the bootloader (YAMON)
72 * have located the Philips SAA9730 chip.
73 * This is not ideal, but is needed for setting up remote debugging as
74 * soon as possible.
75 */
76#define ATLAS_SAA9730_REG 0x10800000
77
78#define ATLAS_SAA9730_BAUDCLOCK 3692300
79
80#endif /* !(_MIPS_ATLAS_H) */
diff --git a/include/asm-mips/mips-boards/atlasint.h b/include/asm-mips/mips-boards/atlasint.h
deleted file mode 100644
index 93ba1c1b2a4f..000000000000
--- a/include/asm-mips/mips-boards/atlasint.h
+++ /dev/null
@@ -1,109 +0,0 @@
1/*
2 * Copyright (C) 1999, 2006 MIPS Technologies, Inc. All rights reserved.
3 * Authors: Carsten Langgaard <carstenl@mips.com>
4 * Maciej W. Rozycki <macro@mips.com>
5 *
6 * ########################################################################
7 *
8 * This program is free software; you can distribute it and/or modify it
9 * under the terms of the GNU General Public License (Version 2) as
10 * published by the Free Software Foundation.
11 *
12 * This program is distributed in the hope it will be useful, but WITHOUT
13 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15 * for more details.
16 *
17 * You should have received a copy of the GNU General Public License along
18 * with this program; if not, write to the Free Software Foundation, Inc.,
19 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
20 *
21 * ########################################################################
22 *
23 * Defines for the Atlas interrupt controller.
24 *
25 */
26#ifndef _MIPS_ATLASINT_H
27#define _MIPS_ATLASINT_H
28
29#include <irq.h>
30
31/* CPU interrupt offsets */
32#define MIPSCPU_INT_SW0 0
33#define MIPSCPU_INT_SW1 1
34#define MIPSCPU_INT_MB0 2
35#define MIPSCPU_INT_ATLAS MIPSCPU_INT_MB0
36#define MIPSCPU_INT_MB1 3
37#define MIPSCPU_INT_MB2 4
38#define MIPSCPU_INT_MB3 5
39#define MIPSCPU_INT_MB4 6
40
41/*
42 * Interrupts 8..39 are used for Atlas interrupt controller interrupts
43 */
44#define ATLAS_INT_BASE 8
45#define ATLAS_INT_UART (ATLAS_INT_BASE + 0)
46#define ATLAS_INT_TIM0 (ATLAS_INT_BASE + 1)
47#define ATLAS_INT_RES2 (ATLAS_INT_BASE + 2)
48#define ATLAS_INT_RES3 (ATLAS_INT_BASE + 3)
49#define ATLAS_INT_RTC (ATLAS_INT_BASE + 4)
50#define ATLAS_INT_COREHI (ATLAS_INT_BASE + 5)
51#define ATLAS_INT_CORELO (ATLAS_INT_BASE + 6)
52#define ATLAS_INT_RES7 (ATLAS_INT_BASE + 7)
53#define ATLAS_INT_PCIA (ATLAS_INT_BASE + 8)
54#define ATLAS_INT_PCIB (ATLAS_INT_BASE + 9)
55#define ATLAS_INT_PCIC (ATLAS_INT_BASE + 10)
56#define ATLAS_INT_PCID (ATLAS_INT_BASE + 11)
57#define ATLAS_INT_ENUM (ATLAS_INT_BASE + 12)
58#define ATLAS_INT_DEG (ATLAS_INT_BASE + 13)
59#define ATLAS_INT_ATXFAIL (ATLAS_INT_BASE + 14)
60#define ATLAS_INT_INTA (ATLAS_INT_BASE + 15)
61#define ATLAS_INT_INTB (ATLAS_INT_BASE + 16)
62#define ATLAS_INT_ETH ATLAS_INT_INTB
63#define ATLAS_INT_INTC (ATLAS_INT_BASE + 17)
64#define ATLAS_INT_SCSI ATLAS_INT_INTC
65#define ATLAS_INT_INTD (ATLAS_INT_BASE + 18)
66#define ATLAS_INT_SERR (ATLAS_INT_BASE + 19)
67#define ATLAS_INT_RES20 (ATLAS_INT_BASE + 20)
68#define ATLAS_INT_RES21 (ATLAS_INT_BASE + 21)
69#define ATLAS_INT_RES22 (ATLAS_INT_BASE + 22)
70#define ATLAS_INT_RES23 (ATLAS_INT_BASE + 23)
71#define ATLAS_INT_RES24 (ATLAS_INT_BASE + 24)
72#define ATLAS_INT_RES25 (ATLAS_INT_BASE + 25)
73#define ATLAS_INT_RES26 (ATLAS_INT_BASE + 26)
74#define ATLAS_INT_RES27 (ATLAS_INT_BASE + 27)
75#define ATLAS_INT_RES28 (ATLAS_INT_BASE + 28)
76#define ATLAS_INT_RES29 (ATLAS_INT_BASE + 29)
77#define ATLAS_INT_RES30 (ATLAS_INT_BASE + 30)
78#define ATLAS_INT_RES31 (ATLAS_INT_BASE + 31)
79#define ATLAS_INT_END (ATLAS_INT_BASE + 31)
80
81/*
82 * Interrupts 64..127 are used for Soc-it Classic interrupts
83 */
84#define MSC01C_INT_BASE 64
85
86/* SOC-it Classic interrupt offsets */
87#define MSC01C_INT_TMR 0
88#define MSC01C_INT_PCI 1
89
90/*
91 * Interrupts 64..127 are used for Soc-it EIC interrupts
92 */
93#define MSC01E_INT_BASE 64
94
95/* SOC-it EIC interrupt offsets */
96#define MSC01E_INT_SW0 1
97#define MSC01E_INT_SW1 2
98#define MSC01E_INT_MB0 3
99#define MSC01E_INT_ATLAS MSC01E_INT_MB0
100#define MSC01E_INT_MB1 4
101#define MSC01E_INT_MB2 5
102#define MSC01E_INT_MB3 6
103#define MSC01E_INT_MB4 7
104#define MSC01E_INT_TMR 8
105#define MSC01E_INT_PCI 9
106#define MSC01E_INT_PERFCTR 10
107#define MSC01E_INT_CPUCTR 11
108
109#endif /* !(_MIPS_ATLASINT_H) */
diff --git a/include/asm-mips/mips-boards/maltasmp.h b/include/asm-mips/mips-boards/maltasmp.h
deleted file mode 100644
index 8d7e955d506e..000000000000
--- a/include/asm-mips/mips-boards/maltasmp.h
+++ /dev/null
@@ -1,36 +0,0 @@
1/*
2 * There are several SMP models supported
3 * SMTC is mutually exclusive to other options (atm)
4 */
5#if defined(CONFIG_MIPS_MT_SMTC)
6#define malta_smtc 1
7#define malta_cmp 0
8#define malta_smvp 0
9#else
10#define malta_smtc 0
11#if defined(CONFIG_MIPS_CMP)
12extern int gcmp_present;
13#define malta_cmp gcmp_present
14#else
15#define malta_cmp 0
16#endif
17/* FIXME: should become COMFIG_MIPS_MT_SMVP */
18#if defined(CONFIG_MIPS_MT_SMP)
19#define malta_smvp 1
20#else
21#define malta_smvp 0
22#endif
23#endif
24
25#include <asm/mipsregs.h>
26#include <asm/mipsmtregs.h>
27
28/* malta_smtc */
29#include <asm/smtc.h>
30#include <asm/smtc_ipi.h>
31
32/* malta_cmp */
33#include <asm/cmp.h>
34
35/* malta_smvp */
36#include <asm/smvp.h>
diff --git a/include/asm-mips/mips-boards/saa9730_uart.h b/include/asm-mips/mips-boards/saa9730_uart.h
deleted file mode 100644
index c913143d58ec..000000000000
--- a/include/asm-mips/mips-boards/saa9730_uart.h
+++ /dev/null
@@ -1,69 +0,0 @@
1/*
2 * Carsten Langgaard, carstenl@mips.com
3 * Copyright (C) 2000 MIPS Technologies, Inc. All rights reserved.
4 *
5 * ########################################################################
6 *
7 * This program is free software; you can distribute it and/or modify it
8 * under the terms of the GNU General Public License (Version 2) as
9 * published by the Free Software Foundation.
10 *
11 * This program is distributed in the hope it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
19 *
20 * ########################################################################
21 *
22 * Register definitions for the UART part of the Philips SAA9730 chip.
23 *
24 */
25
26#ifndef SAA9730_UART_H
27#define SAA9730_UART_H
28
29/* The SAA9730 UART register map, as seen via the PCI bus */
30
31#define SAA9730_UART_REGS_ADDR 0x21800
32
33struct uart_saa9730_regmap {
34 volatile unsigned char Thr_Rbr;
35 volatile unsigned char Ier;
36 volatile unsigned char Iir_Fcr;
37 volatile unsigned char Lcr;
38 volatile unsigned char Mcr;
39 volatile unsigned char Lsr;
40 volatile unsigned char Msr;
41 volatile unsigned char Scr;
42 volatile unsigned char BaudDivLsb;
43 volatile unsigned char BaudDivMsb;
44 volatile unsigned char Junk0;
45 volatile unsigned char Junk1;
46 volatile unsigned int Config; /* 0x2180c */
47 volatile unsigned int TxStart; /* 0x21810 */
48 volatile unsigned int TxLength; /* 0x21814 */
49 volatile unsigned int TxCounter; /* 0x21818 */
50 volatile unsigned int RxStart; /* 0x2181c */
51 volatile unsigned int RxLength; /* 0x21820 */
52 volatile unsigned int RxCounter; /* 0x21824 */
53};
54typedef volatile struct uart_saa9730_regmap t_uart_saa9730_regmap;
55
56/*
57 * Only a subset of the UART control bits are defined here,
58 * enough to make the serial debug port work.
59 */
60
61#define SAA9730_LCR_DATA8 0x03
62
63#define SAA9730_MCR_DTR 0x01
64#define SAA9730_MCR_RTS 0x02
65
66#define SAA9730_LSR_DR 0x01
67#define SAA9730_LSR_THRE 0x20
68
69#endif /* !(SAA9730_UART_H) */
diff --git a/include/asm-mips/mips-boards/sead.h b/include/asm-mips/mips-boards/sead.h
deleted file mode 100644
index 68c69de0b66f..000000000000
--- a/include/asm-mips/mips-boards/sead.h
+++ /dev/null
@@ -1,36 +0,0 @@
1/*
2 * Carsten Langgaard, carstenl@mips.com
3 * Copyright (C) 2002 MIPS Technologies, Inc. All rights reserved.
4 *
5 * ########################################################################
6 *
7 * This program is free software; you can distribute it and/or modify it
8 * under the terms of the GNU General Public License (Version 2) as
9 * published by the Free Software Foundation.
10 *
11 * This program is distributed in the hope it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
19 *
20 * ########################################################################
21 *
22 * Defines of the SEAD board specific address-MAP, registers, etc.
23 *
24 */
25#ifndef _MIPS_SEAD_H
26#define _MIPS_SEAD_H
27
28#include <asm/addrspace.h>
29
30/*
31 * SEAD UART register base.
32 */
33#define SEAD_UART0_REGS_BASE (0x1f000800)
34#define SEAD_BASE_BAUD ( 3686400 / 16 )
35
36#endif /* !(_MIPS_SEAD_H) */
diff --git a/include/asm-mips/mips-boards/seadint.h b/include/asm-mips/mips-boards/seadint.h
deleted file mode 100644
index e710bae07340..000000000000
--- a/include/asm-mips/mips-boards/seadint.h
+++ /dev/null
@@ -1,28 +0,0 @@
1/*
2 * Carsten Langgaard, carstenl@mips.com
3 * Copyright (C) 2002 MIPS Technologies, Inc. All rights reserved.
4 *
5 * This program is free software; you can distribute it and/or modify it
6 * under the terms of the GNU General Public License (Version 2) as
7 * published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * for more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
17 *
18 * Defines for the SEAD interrupt controller.
19 */
20#ifndef _MIPS_SEADINT_H
21#define _MIPS_SEADINT_H
22
23#include <irq.h>
24
25#define MIPSCPU_INT_UART0 2
26#define MIPSCPU_INT_UART1 3
27
28#endif /* !(_MIPS_SEADINT_H) */
diff --git a/include/asm-mips/page.h b/include/asm-mips/page.h
index 8735aa0b8963..494f00ba9541 100644
--- a/include/asm-mips/page.h
+++ b/include/asm-mips/page.h
@@ -34,6 +34,9 @@
34#include <linux/pfn.h> 34#include <linux/pfn.h>
35#include <asm/io.h> 35#include <asm/io.h>
36 36
37extern void build_clear_page(void);
38extern void build_copy_page(void);
39
37/* 40/*
38 * It's normally defined only for FLATMEM config but it's 41 * It's normally defined only for FLATMEM config but it's
39 * used in our early mem init code for all memory models. 42 * used in our early mem init code for all memory models.
diff --git a/include/asm-mips/pci.h b/include/asm-mips/pci.h
index d3be83436070..c205875d7f31 100644
--- a/include/asm-mips/pci.h
+++ b/include/asm-mips/pci.h
@@ -173,6 +173,5 @@ static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel)
173} 173}
174 174
175extern int pci_probe_only; 175extern int pci_probe_only;
176extern unsigned int pcibios_max_latency;
177 176
178#endif /* _ASM_PCI_H */ 177#endif /* _ASM_PCI_H */
diff --git a/include/asm-mips/setup.h b/include/asm-mips/setup.h
index 883f59bfa097..e600cedda976 100644
--- a/include/asm-mips/setup.h
+++ b/include/asm-mips/setup.h
@@ -3,6 +3,8 @@
3 3
4#define COMMAND_LINE_SIZE 256 4#define COMMAND_LINE_SIZE 256
5 5
6#ifdef __KERNEL__
6extern void setup_early_printk(void); 7extern void setup_early_printk(void);
8#endif /* __KERNEL__ */
7 9
8#endif /* __SETUP_H */ 10#endif /* __SETUP_H */
diff --git a/include/asm-mips/txx9/generic.h b/include/asm-mips/txx9/generic.h
index d8756660523d..cbae37ec3d88 100644
--- a/include/asm-mips/txx9/generic.h
+++ b/include/asm-mips/txx9/generic.h
@@ -12,6 +12,8 @@
12#include <linux/ioport.h> /* for struct resource */ 12#include <linux/ioport.h> /* for struct resource */
13 13
14extern struct resource txx9_ce_res[]; 14extern struct resource txx9_ce_res[];
15#define TXX9_CE(n) (unsigned long)(txx9_ce_res[(n)].start)
16extern unsigned int txx9_pcode;
15extern char txx9_pcode_str[8]; 17extern char txx9_pcode_str[8];
16void txx9_reg_res_init(unsigned int pcode, unsigned long base, 18void txx9_reg_res_init(unsigned int pcode, unsigned long base,
17 unsigned long size); 19 unsigned long size);
@@ -19,6 +21,11 @@ void txx9_reg_res_init(unsigned int pcode, unsigned long base,
19extern unsigned int txx9_master_clock; 21extern unsigned int txx9_master_clock;
20extern unsigned int txx9_cpu_clock; 22extern unsigned int txx9_cpu_clock;
21extern unsigned int txx9_gbus_clock; 23extern unsigned int txx9_gbus_clock;
24#define TXX9_IMCLK (txx9_gbus_clock / 2)
25
26extern int txx9_ccfg_toeon;
27struct uart_port;
28int early_serial_txx9_setup(struct uart_port *port);
22 29
23struct pci_dev; 30struct pci_dev;
24struct txx9_board_vec { 31struct txx9_board_vec {
diff --git a/include/asm-mips/txx9/rbtx4927.h b/include/asm-mips/txx9/rbtx4927.h
index bf194589216f..6fcec912c143 100644
--- a/include/asm-mips/txx9/rbtx4927.h
+++ b/include/asm-mips/txx9/rbtx4927.h
@@ -34,7 +34,23 @@
34#define RBTX4927_PCIIO 0x16000000 34#define RBTX4927_PCIIO 0x16000000
35#define RBTX4927_PCIIO_SIZE 0x01000000 35#define RBTX4927_PCIIO_SIZE 0x01000000
36 36
37#define rbtx4927_pcireset_addr ((__u8 __iomem *)0xbc00f006UL) 37#define RBTX4927_IMASK_ADDR (IO_BASE + TXX9_CE(2) + 0x00002000)
38#define RBTX4927_IMSTAT_ADDR (IO_BASE + TXX9_CE(2) + 0x00002006)
39#define RBTX4927_SOFTRESET_ADDR (IO_BASE + TXX9_CE(2) + 0x0000f000)
40#define RBTX4927_SOFTRESETLOCK_ADDR (IO_BASE + TXX9_CE(2) + 0x0000f002)
41#define RBTX4927_PCIRESET_ADDR (IO_BASE + TXX9_CE(2) + 0x0000f006)
42#define RBTX4927_BRAMRTC_BASE (IO_BASE + TXX9_CE(2) + 0x00010000)
43#define RBTX4927_ETHER_BASE (IO_BASE + TXX9_CE(2) + 0x00020000)
44
45/* Ethernet port address */
46#define RBTX4927_ETHER_ADDR (RBTX4927_ETHER_BASE + 0x280)
47
48#define rbtx4927_imask_addr ((__u8 __iomem *)RBTX4927_IMASK_ADDR)
49#define rbtx4927_imstat_addr ((__u8 __iomem *)RBTX4927_IMSTAT_ADDR)
50#define rbtx4927_softreset_addr ((__u8 __iomem *)RBTX4927_SOFTRESET_ADDR)
51#define rbtx4927_softresetlock_addr \
52 ((__u8 __iomem *)RBTX4927_SOFTRESETLOCK_ADDR)
53#define rbtx4927_pcireset_addr ((__u8 __iomem *)RBTX4927_PCIRESET_ADDR)
38 54
39/* bits for ISTAT/IMASK/IMSTAT */ 55/* bits for ISTAT/IMASK/IMSTAT */
40#define RBTX4927_INTB_PCID 0 56#define RBTX4927_INTB_PCID 0
@@ -62,13 +78,7 @@
62#define RBTX4927_ISA_IO_OFFSET 0 78#define RBTX4927_ISA_IO_OFFSET 0
63#endif 79#endif
64 80
65#define RBTX4927_SW_RESET_DO (void __iomem *)0xbc00f000UL 81#define RBTX4927_RTL_8019_BASE (RBTX4927_ETHER_ADDR - mips_io_port_base)
66#define RBTX4927_SW_RESET_DO_SET 0x01
67
68#define RBTX4927_SW_RESET_ENABLE (void __iomem *)0xbc00f002UL
69#define RBTX4927_SW_RESET_ENABLE_SET 0x01
70
71#define RBTX4927_RTL_8019_BASE (0x1c020280 - RBTX4927_ISA_IO_OFFSET)
72#define RBTX4927_RTL_8019_IRQ (TXX9_IRQ_BASE + TX4927_IR_INT(3)) 82#define RBTX4927_RTL_8019_IRQ (TXX9_IRQ_BASE + TX4927_IR_INT(3))
73 83
74void rbtx4927_prom_init(void); 84void rbtx4927_prom_init(void);
diff --git a/include/asm-mips/txx9/rbtx4938.h b/include/asm-mips/txx9/rbtx4938.h
index 2f5d5e705a41..9f0441a28126 100644
--- a/include/asm-mips/txx9/rbtx4938.h
+++ b/include/asm-mips/txx9/rbtx4938.h
@@ -15,35 +15,31 @@
15#include <asm/txx9irq.h> 15#include <asm/txx9irq.h>
16#include <asm/txx9/tx4938.h> 16#include <asm/txx9/tx4938.h>
17 17
18/* CS */
19#define RBTX4938_CE0 0x1c000000 /* 64M */
20#define RBTX4938_CE2 0x17f00000 /* 1M */
21
22/* Address map */ 18/* Address map */
23#define RBTX4938_FPGA_REG_ADDR (KSEG1 + RBTX4938_CE2 + 0x00000000) 19#define RBTX4938_FPGA_REG_ADDR (IO_BASE + TXX9_CE(2) + 0x00000000)
24#define RBTX4938_FPGA_REV_ADDR (KSEG1 + RBTX4938_CE2 + 0x00000002) 20#define RBTX4938_FPGA_REV_ADDR (IO_BASE + TXX9_CE(2) + 0x00000002)
25#define RBTX4938_CONFIG1_ADDR (KSEG1 + RBTX4938_CE2 + 0x00000004) 21#define RBTX4938_CONFIG1_ADDR (IO_BASE + TXX9_CE(2) + 0x00000004)
26#define RBTX4938_CONFIG2_ADDR (KSEG1 + RBTX4938_CE2 + 0x00000006) 22#define RBTX4938_CONFIG2_ADDR (IO_BASE + TXX9_CE(2) + 0x00000006)
27#define RBTX4938_CONFIG3_ADDR (KSEG1 + RBTX4938_CE2 + 0x00000008) 23#define RBTX4938_CONFIG3_ADDR (IO_BASE + TXX9_CE(2) + 0x00000008)
28#define RBTX4938_LED_ADDR (KSEG1 + RBTX4938_CE2 + 0x00001000) 24#define RBTX4938_LED_ADDR (IO_BASE + TXX9_CE(2) + 0x00001000)
29#define RBTX4938_DIPSW_ADDR (KSEG1 + RBTX4938_CE2 + 0x00001002) 25#define RBTX4938_DIPSW_ADDR (IO_BASE + TXX9_CE(2) + 0x00001002)
30#define RBTX4938_BDIPSW_ADDR (KSEG1 + RBTX4938_CE2 + 0x00001004) 26#define RBTX4938_BDIPSW_ADDR (IO_BASE + TXX9_CE(2) + 0x00001004)
31#define RBTX4938_IMASK_ADDR (KSEG1 + RBTX4938_CE2 + 0x00002000) 27#define RBTX4938_IMASK_ADDR (IO_BASE + TXX9_CE(2) + 0x00002000)
32#define RBTX4938_IMASK2_ADDR (KSEG1 + RBTX4938_CE2 + 0x00002002) 28#define RBTX4938_IMASK2_ADDR (IO_BASE + TXX9_CE(2) + 0x00002002)
33#define RBTX4938_INTPOL_ADDR (KSEG1 + RBTX4938_CE2 + 0x00002004) 29#define RBTX4938_INTPOL_ADDR (IO_BASE + TXX9_CE(2) + 0x00002004)
34#define RBTX4938_ISTAT_ADDR (KSEG1 + RBTX4938_CE2 + 0x00002006) 30#define RBTX4938_ISTAT_ADDR (IO_BASE + TXX9_CE(2) + 0x00002006)
35#define RBTX4938_ISTAT2_ADDR (KSEG1 + RBTX4938_CE2 + 0x00002008) 31#define RBTX4938_ISTAT2_ADDR (IO_BASE + TXX9_CE(2) + 0x00002008)
36#define RBTX4938_IMSTAT_ADDR (KSEG1 + RBTX4938_CE2 + 0x0000200a) 32#define RBTX4938_IMSTAT_ADDR (IO_BASE + TXX9_CE(2) + 0x0000200a)
37#define RBTX4938_IMSTAT2_ADDR (KSEG1 + RBTX4938_CE2 + 0x0000200c) 33#define RBTX4938_IMSTAT2_ADDR (IO_BASE + TXX9_CE(2) + 0x0000200c)
38#define RBTX4938_SOFTINT_ADDR (KSEG1 + RBTX4938_CE2 + 0x00003000) 34#define RBTX4938_SOFTINT_ADDR (IO_BASE + TXX9_CE(2) + 0x00003000)
39#define RBTX4938_PIOSEL_ADDR (KSEG1 + RBTX4938_CE2 + 0x00005000) 35#define RBTX4938_PIOSEL_ADDR (IO_BASE + TXX9_CE(2) + 0x00005000)
40#define RBTX4938_SPICS_ADDR (KSEG1 + RBTX4938_CE2 + 0x00005002) 36#define RBTX4938_SPICS_ADDR (IO_BASE + TXX9_CE(2) + 0x00005002)
41#define RBTX4938_SFPWR_ADDR (KSEG1 + RBTX4938_CE2 + 0x00005008) 37#define RBTX4938_SFPWR_ADDR (IO_BASE + TXX9_CE(2) + 0x00005008)
42#define RBTX4938_SFVOL_ADDR (KSEG1 + RBTX4938_CE2 + 0x0000500a) 38#define RBTX4938_SFVOL_ADDR (IO_BASE + TXX9_CE(2) + 0x0000500a)
43#define RBTX4938_SOFTRESET_ADDR (KSEG1 + RBTX4938_CE2 + 0x00007000) 39#define RBTX4938_SOFTRESET_ADDR (IO_BASE + TXX9_CE(2) + 0x00007000)
44#define RBTX4938_SOFTRESETLOCK_ADDR (KSEG1 + RBTX4938_CE2 + 0x00007002) 40#define RBTX4938_SOFTRESETLOCK_ADDR (IO_BASE + TXX9_CE(2) + 0x00007002)
45#define RBTX4938_PCIRESET_ADDR (KSEG1 + RBTX4938_CE2 + 0x00007004) 41#define RBTX4938_PCIRESET_ADDR (IO_BASE + TXX9_CE(2) + 0x00007004)
46#define RBTX4938_ETHER_BASE (KSEG1 + RBTX4938_CE2 + 0x00020000) 42#define RBTX4938_ETHER_BASE (IO_BASE + TXX9_CE(2) + 0x00020000)
47 43
48/* Ethernet port address (Jumperless Mode (W12:Open)) */ 44/* Ethernet port address (Jumperless Mode (W12:Open)) */
49#define RBTX4938_ETHER_ADDR (RBTX4938_ETHER_BASE + 0x280) 45#define RBTX4938_ETHER_ADDR (RBTX4938_ETHER_BASE + 0x280)
diff --git a/include/asm-mips/txx9/tx3927.h b/include/asm-mips/txx9/tx3927.h
index ca414c7624e1..ea79e1b16e71 100644
--- a/include/asm-mips/txx9/tx3927.h
+++ b/include/asm-mips/txx9/tx3927.h
@@ -10,17 +10,18 @@
10 10
11#include <asm/txx9/txx927.h> 11#include <asm/txx9/txx927.h>
12 12
13#define TX3927_SDRAMC_REG 0xfffe8000 13#define TX3927_REG_BASE 0xfffe0000UL
14#define TX3927_ROMC_REG 0xfffe9000 14#define TX3927_SDRAMC_REG (TX3927_REG_BASE + 0x8000)
15#define TX3927_DMA_REG 0xfffeb000 15#define TX3927_ROMC_REG (TX3927_REG_BASE + 0x9000)
16#define TX3927_IRC_REG 0xfffec000 16#define TX3927_DMA_REG (TX3927_REG_BASE + 0xb000)
17#define TX3927_PCIC_REG 0xfffed000 17#define TX3927_IRC_REG (TX3927_REG_BASE + 0xc000)
18#define TX3927_CCFG_REG 0xfffee000 18#define TX3927_PCIC_REG (TX3927_REG_BASE + 0xd000)
19#define TX3927_CCFG_REG (TX3927_REG_BASE + 0xe000)
19#define TX3927_NR_TMR 3 20#define TX3927_NR_TMR 3
20#define TX3927_TMR_REG(ch) (0xfffef000 + (ch) * 0x100) 21#define TX3927_TMR_REG(ch) (TX3927_REG_BASE + 0xf000 + (ch) * 0x100)
21#define TX3927_NR_SIO 2 22#define TX3927_NR_SIO 2
22#define TX3927_SIO_REG(ch) (0xfffef300 + (ch) * 0x100) 23#define TX3927_SIO_REG(ch) (TX3927_REG_BASE + 0xf300 + (ch) * 0x100)
23#define TX3927_PIO_REG 0xfffef500 24#define TX3927_PIO_REG (TX3927_REG_BASE + 0xf500)
24 25
25struct tx3927_sdramc_reg { 26struct tx3927_sdramc_reg {
26 volatile unsigned long cr[8]; 27 volatile unsigned long cr[8];
diff --git a/include/asm-mips/txx9/tx4927.h b/include/asm-mips/txx9/tx4927.h
index 46d60afc038b..ceb4b79ff4e3 100644
--- a/include/asm-mips/txx9/tx4927.h
+++ b/include/asm-mips/txx9/tx4927.h
@@ -32,32 +32,46 @@
32#include <asm/txx9irq.h> 32#include <asm/txx9irq.h>
33#include <asm/txx9/tx4927pcic.h> 33#include <asm/txx9/tx4927pcic.h>
34 34
35#define TX4927_SDRAMC_REG 0xff1f8000 35#ifdef CONFIG_64BIT
36#define TX4927_EBUSC_REG 0xff1f9000 36#define TX4927_REG_BASE 0xffffffffff1f0000UL
37#define TX4927_PCIC_REG 0xff1fd000 37#else
38#define TX4927_CCFG_REG 0xff1fe000 38#define TX4927_REG_BASE 0xff1f0000UL
39#define TX4927_IRC_REG 0xff1ff600 39#endif
40#define TX4927_REG_SIZE 0x00010000
41
42#define TX4927_SDRAMC_REG (TX4927_REG_BASE + 0x8000)
43#define TX4927_EBUSC_REG (TX4927_REG_BASE + 0x9000)
44#define TX4927_PCIC_REG (TX4927_REG_BASE + 0xd000)
45#define TX4927_CCFG_REG (TX4927_REG_BASE + 0xe000)
46#define TX4927_IRC_REG (TX4927_REG_BASE + 0xf600)
40#define TX4927_NR_TMR 3 47#define TX4927_NR_TMR 3
41#define TX4927_TMR_REG(ch) (0xff1ff000 + (ch) * 0x100) 48#define TX4927_TMR_REG(ch) (TX4927_REG_BASE + 0xf000 + (ch) * 0x100)
49#define TX4927_NR_SIO 2
50#define TX4927_SIO_REG(ch) (TX4927_REG_BASE + 0xf300 + (ch) * 0x100)
51#define TX4927_PIO_REG (TX4927_REG_BASE + 0xf500)
42 52
43#define TX4927_IR_INT(n) (2 + (n)) 53#define TX4927_IR_INT(n) (2 + (n))
44#define TX4927_IR_SIO(n) (8 + (n)) 54#define TX4927_IR_SIO(n) (8 + (n))
45#define TX4927_IR_PCIC 16 55#define TX4927_IR_PCIC 16
56#define TX4927_NUM_IR_TMR 3
57#define TX4927_IR_TMR(n) (17 + (n))
46#define TX4927_IR_PCIERR 22 58#define TX4927_IR_PCIERR 22
47#define TX4927_NUM_IR 32 59#define TX4927_NUM_IR 32
48 60
49#define TX4927_IRC_INT 2 /* IP[2] in Status register */ 61#define TX4927_IRC_INT 2 /* IP[2] in Status register */
50 62
63#define TX4927_NUM_PIO 16
64
51struct tx4927_sdramc_reg { 65struct tx4927_sdramc_reg {
52 volatile unsigned long long cr[4]; 66 u64 cr[4];
53 volatile unsigned long long unused0[4]; 67 u64 unused0[4];
54 volatile unsigned long long tr; 68 u64 tr;
55 volatile unsigned long long unused1[2]; 69 u64 unused1[2];
56 volatile unsigned long long cmd; 70 u64 cmd;
57}; 71};
58 72
59struct tx4927_ebusc_reg { 73struct tx4927_ebusc_reg {
60 volatile unsigned long long cr[8]; 74 u64 cr[8];
61}; 75};
62 76
63struct tx4927_ccfg_reg { 77struct tx4927_ccfg_reg {
@@ -160,12 +174,28 @@ struct tx4927_ccfg_reg {
160#define TX4927_CLKCTR_SIO0RST 0x00000002 174#define TX4927_CLKCTR_SIO0RST 0x00000002
161#define TX4927_CLKCTR_SIO1RST 0x00000001 175#define TX4927_CLKCTR_SIO1RST 0x00000001
162 176
163#define tx4927_sdramcptr ((struct tx4927_sdramc_reg *)TX4927_SDRAMC_REG) 177#define tx4927_sdramcptr \
178 ((struct tx4927_sdramc_reg __iomem *)TX4927_SDRAMC_REG)
164#define tx4927_pcicptr \ 179#define tx4927_pcicptr \
165 ((struct tx4927_pcic_reg __iomem *)TX4927_PCIC_REG) 180 ((struct tx4927_pcic_reg __iomem *)TX4927_PCIC_REG)
166#define tx4927_ccfgptr \ 181#define tx4927_ccfgptr \
167 ((struct tx4927_ccfg_reg __iomem *)TX4927_CCFG_REG) 182 ((struct tx4927_ccfg_reg __iomem *)TX4927_CCFG_REG)
168#define tx4927_ebuscptr ((struct tx4927_ebusc_reg *)TX4927_EBUSC_REG) 183#define tx4927_ebuscptr \
184 ((struct tx4927_ebusc_reg __iomem *)TX4927_EBUSC_REG)
185#define tx4927_pioptr ((struct txx9_pio_reg __iomem *)TX4927_PIO_REG)
186
187#define TX4927_REV_PCODE() \
188 ((__u32)__raw_readq(&tx4927_ccfgptr->crir) >> 16)
189
190#define TX4927_SDRAMC_CR(ch) __raw_readq(&tx4927_sdramcptr->cr[(ch)])
191#define TX4927_SDRAMC_BA(ch) ((TX4927_SDRAMC_CR(ch) >> 49) << 21)
192#define TX4927_SDRAMC_SIZE(ch) \
193 ((((TX4927_SDRAMC_CR(ch) >> 33) & 0x7fff) + 1) << 21)
194
195#define TX4927_EBUSC_CR(ch) __raw_readq(&tx4927_ebuscptr->cr[(ch)])
196#define TX4927_EBUSC_BA(ch) ((TX4927_EBUSC_CR(ch) >> 48) << 20)
197#define TX4927_EBUSC_SIZE(ch) \
198 (0x00100000 << ((unsigned long)(TX4927_EBUSC_CR(ch) >> 8) & 0xf))
169 199
170/* utilities */ 200/* utilities */
171static inline void txx9_clear64(__u64 __iomem *adr, __u64 bits) 201static inline void txx9_clear64(__u64 __iomem *adr, __u64 bits)
@@ -212,6 +242,11 @@ static inline void tx4927_ccfg_change(__u64 change, __u64 new)
212 &tx4927_ccfgptr->ccfg); 242 &tx4927_ccfgptr->ccfg);
213} 243}
214 244
245unsigned int tx4927_get_mem_size(void);
246void tx4927_wdr_init(void);
247void tx4927_setup(void);
248void tx4927_time_init(unsigned int tmrnr);
249void tx4927_setup_serial(void);
215int tx4927_report_pciclk(void); 250int tx4927_report_pciclk(void);
216int tx4927_pciclk66_setup(void); 251int tx4927_pciclk66_setup(void);
217void tx4927_irq_init(void); 252void tx4927_irq_init(void);
diff --git a/include/asm-mips/txx9/tx4938.h b/include/asm-mips/txx9/tx4938.h
index 12de68a4c10a..1ed969d381d6 100644
--- a/include/asm-mips/txx9/tx4938.h
+++ b/include/asm-mips/txx9/tx4938.h
@@ -15,20 +15,11 @@
15/* some controllers are compatible with 4927 */ 15/* some controllers are compatible with 4927 */
16#include <asm/txx9/tx4927.h> 16#include <asm/txx9/tx4927.h>
17 17
18#define tx4938_read_nfmc(addr) (*(volatile unsigned int *)(addr)) 18#ifdef CONFIG_64BIT
19#define tx4938_write_nfmc(b, addr) (*(volatile unsigned int *)(addr)) = (b) 19#define TX4938_REG_BASE 0xffffffffff1f0000UL /* == TX4937_REG_BASE */
20 20#else
21#define TX4938_PCIIO_0 0x10000000 21#define TX4938_REG_BASE 0xff1f0000UL /* == TX4937_REG_BASE */
22#define TX4938_PCIIO_1 0x01010000 22#endif
23#define TX4938_PCIMEM_0 0x08000000
24#define TX4938_PCIMEM_1 0x11000000
25
26#define TX4938_PCIIO_SIZE_0 0x01000000
27#define TX4938_PCIIO_SIZE_1 0x00010000
28#define TX4938_PCIMEM_SIZE_0 0x08000000
29#define TX4938_PCIMEM_SIZE_1 0x00010000
30
31#define TX4938_REG_BASE 0xff1f0000 /* == TX4937_REG_BASE */
32#define TX4938_REG_SIZE 0x00010000 /* == TX4937_REG_SIZE */ 23#define TX4938_REG_SIZE 0x00010000 /* == TX4937_REG_SIZE */
33 24
34/* NDFMC, SRAMC, PCIC1, SPIC: TX4938 only */ 25/* NDFMC, SRAMC, PCIC1, SPIC: TX4938 only */
@@ -49,149 +40,8 @@
49#define TX4938_ACLC_REG (TX4938_REG_BASE + 0xf700) 40#define TX4938_ACLC_REG (TX4938_REG_BASE + 0xf700)
50#define TX4938_SPI_REG (TX4938_REG_BASE + 0xf800) 41#define TX4938_SPI_REG (TX4938_REG_BASE + 0xf800)
51 42
52#define _CONST64(c) c##ull
53
54#include <asm/byteorder.h>
55
56#ifdef __BIG_ENDIAN
57#define endian_def_l2(e1, e2) \
58 volatile unsigned long e1, e2
59#define endian_def_s2(e1, e2) \
60 volatile unsigned short e1, e2
61#define endian_def_sb2(e1, e2, e3) \
62 volatile unsigned short e1;volatile unsigned char e2, e3
63#define endian_def_b2s(e1, e2, e3) \
64 volatile unsigned char e1, e2;volatile unsigned short e3
65#define endian_def_b4(e1, e2, e3, e4) \
66 volatile unsigned char e1, e2, e3, e4
67#else
68#define endian_def_l2(e1, e2) \
69 volatile unsigned long e2, e1
70#define endian_def_s2(e1, e2) \
71 volatile unsigned short e2, e1
72#define endian_def_sb2(e1, e2, e3) \
73 volatile unsigned char e3, e2;volatile unsigned short e1
74#define endian_def_b2s(e1, e2, e3) \
75 volatile unsigned short e3;volatile unsigned char e2, e1
76#define endian_def_b4(e1, e2, e3, e4) \
77 volatile unsigned char e4, e3, e2, e1
78#endif
79
80
81struct tx4938_sdramc_reg {
82 volatile unsigned long long cr[4];
83 volatile unsigned long long unused0[4];
84 volatile unsigned long long tr;
85 volatile unsigned long long unused1[2];
86 volatile unsigned long long cmd;
87 volatile unsigned long long sfcmd;
88};
89
90struct tx4938_ebusc_reg {
91 volatile unsigned long long cr[8];
92};
93
94struct tx4938_dma_reg {
95 struct tx4938_dma_ch_reg {
96 volatile unsigned long long cha;
97 volatile unsigned long long sar;
98 volatile unsigned long long dar;
99 endian_def_l2(unused0, cntr);
100 endian_def_l2(unused1, sair);
101 endian_def_l2(unused2, dair);
102 endian_def_l2(unused3, ccr);
103 endian_def_l2(unused4, csr);
104 } ch[4];
105 volatile unsigned long long dbr[8];
106 volatile unsigned long long tdhr;
107 volatile unsigned long long midr;
108 endian_def_l2(unused0, mcr);
109};
110
111struct tx4938_aclc_reg {
112 volatile unsigned long acctlen;
113 volatile unsigned long acctldis;
114 volatile unsigned long acregacc;
115 volatile unsigned long unused0;
116 volatile unsigned long acintsts;
117 volatile unsigned long acintmsts;
118 volatile unsigned long acinten;
119 volatile unsigned long acintdis;
120 volatile unsigned long acsemaph;
121 volatile unsigned long unused1[7];
122 volatile unsigned long acgpidat;
123 volatile unsigned long acgpodat;
124 volatile unsigned long acslten;
125 volatile unsigned long acsltdis;
126 volatile unsigned long acfifosts;
127 volatile unsigned long unused2[11];
128 volatile unsigned long acdmasts;
129 volatile unsigned long acdmasel;
130 volatile unsigned long unused3[6];
131 volatile unsigned long acaudodat;
132 volatile unsigned long acsurrdat;
133 volatile unsigned long accentdat;
134 volatile unsigned long aclfedat;
135 volatile unsigned long acaudiat;
136 volatile unsigned long unused4;
137 volatile unsigned long acmodoat;
138 volatile unsigned long acmodidat;
139 volatile unsigned long unused5[15];
140 volatile unsigned long acrevid;
141};
142
143
144struct tx4938_tmr_reg {
145 volatile unsigned long tcr;
146 volatile unsigned long tisr;
147 volatile unsigned long cpra;
148 volatile unsigned long cprb;
149 volatile unsigned long itmr;
150 volatile unsigned long unused0[3];
151 volatile unsigned long ccdr;
152 volatile unsigned long unused1[3];
153 volatile unsigned long pgmr;
154 volatile unsigned long unused2[3];
155 volatile unsigned long wtmr;
156 volatile unsigned long unused3[43];
157 volatile unsigned long trr;
158};
159
160struct tx4938_sio_reg {
161 volatile unsigned long lcr;
162 volatile unsigned long dicr;
163 volatile unsigned long disr;
164 volatile unsigned long cisr;
165 volatile unsigned long fcr;
166 volatile unsigned long flcr;
167 volatile unsigned long bgr;
168 volatile unsigned long tfifo;
169 volatile unsigned long rfifo;
170};
171
172struct tx4938_ndfmc_reg {
173 endian_def_l2(unused0, dtr);
174 endian_def_l2(unused1, mcr);
175 endian_def_l2(unused2, sr);
176 endian_def_l2(unused3, isr);
177 endian_def_l2(unused4, imr);
178 endian_def_l2(unused5, spr);
179 endian_def_l2(unused6, rstr);
180};
181
182struct tx4938_spi_reg {
183 volatile unsigned long mcr;
184 volatile unsigned long cr0;
185 volatile unsigned long cr1;
186 volatile unsigned long fs;
187 volatile unsigned long unused1;
188 volatile unsigned long sr;
189 volatile unsigned long dr;
190 volatile unsigned long unused2;
191};
192
193struct tx4938_sramc_reg { 43struct tx4938_sramc_reg {
194 volatile unsigned long long cr; 44 u64 cr;
195}; 45};
196 46
197struct tx4938_ccfg_reg { 47struct tx4938_ccfg_reg {
@@ -209,34 +59,6 @@ struct tx4938_ccfg_reg {
209 u64 jmpadr; 59 u64 jmpadr;
210}; 60};
211 61
212#undef endian_def_l2
213#undef endian_def_s2
214#undef endian_def_sb2
215#undef endian_def_b2s
216#undef endian_def_b4
217
218/*
219 * NDFMC
220 */
221
222/* NDFMCR : NDFMC Mode Control */
223#define TX4938_NDFMCR_WE 0x80
224#define TX4938_NDFMCR_ECC_ALL 0x60
225#define TX4938_NDFMCR_ECC_RESET 0x60
226#define TX4938_NDFMCR_ECC_READ 0x40
227#define TX4938_NDFMCR_ECC_ON 0x20
228#define TX4938_NDFMCR_ECC_OFF 0x00
229#define TX4938_NDFMCR_CE 0x10
230#define TX4938_NDFMCR_BSPRT 0x04
231#define TX4938_NDFMCR_ALE 0x02
232#define TX4938_NDFMCR_CLE 0x01
233
234/* NDFMCR : NDFMC Status */
235#define TX4938_NDFSR_BUSY 0x80
236
237/* NDFMCR : NDFMC Reset */
238#define TX4938_NDFRSTR_RST 0x01
239
240/* 62/*
241 * IRC 63 * IRC
242 */ 64 */
@@ -268,13 +90,15 @@ struct tx4938_ccfg_reg {
268 90
269#define TX4938_IRC_INT 2 /* IP[2] in Status register */ 91#define TX4938_IRC_INT 2 /* IP[2] in Status register */
270 92
93#define TX4938_NUM_PIO 16
94
271/* 95/*
272 * CCFG 96 * CCFG
273 */ 97 */
274/* CCFG : Chip Configuration */ 98/* CCFG : Chip Configuration */
275#define TX4938_CCFG_WDRST _CONST64(0x0000020000000000) 99#define TX4938_CCFG_WDRST 0x0000020000000000ULL
276#define TX4938_CCFG_WDREXEN _CONST64(0x0000010000000000) 100#define TX4938_CCFG_WDREXEN 0x0000010000000000ULL
277#define TX4938_CCFG_BCFG_MASK _CONST64(0x000000ff00000000) 101#define TX4938_CCFG_BCFG_MASK 0x000000ff00000000ULL
278#define TX4938_CCFG_TINTDIS 0x01000000 102#define TX4938_CCFG_TINTDIS 0x01000000
279#define TX4938_CCFG_PCI66 0x00800000 103#define TX4938_CCFG_PCI66 0x00800000
280#define TX4938_CCFG_PCIMODE 0x00400000 104#define TX4938_CCFG_PCIMODE 0x00400000
@@ -310,12 +134,12 @@ struct tx4938_ccfg_reg {
310#define TX4938_CCFG_ACEHOLD 0x00000001 134#define TX4938_CCFG_ACEHOLD 0x00000001
311 135
312/* PCFG : Pin Configuration */ 136/* PCFG : Pin Configuration */
313#define TX4938_PCFG_ETH0_SEL _CONST64(0x8000000000000000) 137#define TX4938_PCFG_ETH0_SEL 0x8000000000000000ULL
314#define TX4938_PCFG_ETH1_SEL _CONST64(0x4000000000000000) 138#define TX4938_PCFG_ETH1_SEL 0x4000000000000000ULL
315#define TX4938_PCFG_ATA_SEL _CONST64(0x2000000000000000) 139#define TX4938_PCFG_ATA_SEL 0x2000000000000000ULL
316#define TX4938_PCFG_ISA_SEL _CONST64(0x1000000000000000) 140#define TX4938_PCFG_ISA_SEL 0x1000000000000000ULL
317#define TX4938_PCFG_SPI_SEL _CONST64(0x0800000000000000) 141#define TX4938_PCFG_SPI_SEL 0x0800000000000000ULL
318#define TX4938_PCFG_NDF_SEL _CONST64(0x0400000000000000) 142#define TX4938_PCFG_NDF_SEL 0x0400000000000000ULL
319#define TX4938_PCFG_SDCLKDLY_MASK 0x30000000 143#define TX4938_PCFG_SDCLKDLY_MASK 0x30000000
320#define TX4938_PCFG_SDCLKDLY(d) ((d)<<28) 144#define TX4938_PCFG_SDCLKDLY(d) ((d)<<28)
321#define TX4938_PCFG_SYSCLKEN 0x08000000 145#define TX4938_PCFG_SYSCLKEN 0x08000000
@@ -336,8 +160,8 @@ struct tx4938_ccfg_reg {
336#define TX4938_PCFG_DMASEL3_SIO0 0x00000008 160#define TX4938_PCFG_DMASEL3_SIO0 0x00000008
337 161
338/* CLKCTR : Clock Control */ 162/* CLKCTR : Clock Control */
339#define TX4938_CLKCTR_NDFCKD _CONST64(0x0001000000000000) 163#define TX4938_CLKCTR_NDFCKD 0x0001000000000000ULL
340#define TX4938_CLKCTR_NDFRST _CONST64(0x0000000100000000) 164#define TX4938_CLKCTR_NDFRST 0x0000000100000000ULL
341#define TX4938_CLKCTR_ETH1CKD 0x80000000 165#define TX4938_CLKCTR_ETH1CKD 0x80000000
342#define TX4938_CLKCTR_ETH0CKD 0x40000000 166#define TX4938_CLKCTR_ETH0CKD 0x40000000
343#define TX4938_CLKCTR_SPICKD 0x20000000 167#define TX4938_CLKCTR_SPICKD 0x20000000
@@ -424,20 +248,16 @@ struct tx4938_ccfg_reg {
424#define TX4938_DMA_CSR_DESERR 0x00000002 248#define TX4938_DMA_CSR_DESERR 0x00000002
425#define TX4938_DMA_CSR_SORERR 0x00000001 249#define TX4938_DMA_CSR_SORERR 0x00000001
426 250
427#define tx4938_sdramcptr ((struct tx4938_sdramc_reg *)TX4938_SDRAMC_REG) 251#define tx4938_sdramcptr tx4927_sdramcptr
428#define tx4938_ebuscptr ((struct tx4938_ebusc_reg *)TX4938_EBUSC_REG) 252#define tx4938_ebuscptr tx4927_ebuscptr
429#define tx4938_dmaptr(ch) ((struct tx4938_dma_reg *)TX4938_DMA_REG(ch))
430#define tx4938_ndfmcptr ((struct tx4938_ndfmc_reg *)TX4938_NDFMC_REG)
431#define tx4938_pcicptr tx4927_pcicptr 253#define tx4938_pcicptr tx4927_pcicptr
432#define tx4938_pcic1ptr \ 254#define tx4938_pcic1ptr \
433 ((struct tx4927_pcic_reg __iomem *)TX4938_PCIC1_REG) 255 ((struct tx4927_pcic_reg __iomem *)TX4938_PCIC1_REG)
434#define tx4938_ccfgptr \ 256#define tx4938_ccfgptr \
435 ((struct tx4938_ccfg_reg __iomem *)TX4938_CCFG_REG) 257 ((struct tx4938_ccfg_reg __iomem *)TX4938_CCFG_REG)
436#define tx4938_sioptr(ch) ((struct tx4938_sio_reg *)TX4938_SIO_REG(ch))
437#define tx4938_pioptr ((struct txx9_pio_reg __iomem *)TX4938_PIO_REG) 258#define tx4938_pioptr ((struct txx9_pio_reg __iomem *)TX4938_PIO_REG)
438#define tx4938_aclcptr ((struct tx4938_aclc_reg *)TX4938_ACLC_REG) 259#define tx4938_sramcptr \
439#define tx4938_spiptr ((struct tx4938_spi_reg *)TX4938_SPI_REG) 260 ((struct tx4938_sramc_reg __iomem *)TX4938_SRAMC_REG)
440#define tx4938_sramcptr ((struct tx4938_sramc_reg *)TX4938_SRAMC_REG)
441 261
442 262
443#define TX4938_REV_PCODE() \ 263#define TX4938_REV_PCODE() \
@@ -447,14 +267,19 @@ struct tx4938_ccfg_reg {
447#define tx4938_ccfg_set(bits) tx4927_ccfg_set(bits) 267#define tx4938_ccfg_set(bits) tx4927_ccfg_set(bits)
448#define tx4938_ccfg_change(change, new) tx4927_ccfg_change(change, new) 268#define tx4938_ccfg_change(change, new) tx4927_ccfg_change(change, new)
449 269
450#define TX4938_SDRAMC_BA(ch) ((tx4938_sdramcptr->cr[ch] >> 49) << 21) 270#define TX4938_SDRAMC_CR(ch) TX4927_SDRAMC_CR(ch)
451#define TX4938_SDRAMC_SIZE(ch) (((tx4938_sdramcptr->cr[ch] >> 33) + 1) << 21) 271#define TX4938_SDRAMC_BA(ch) TX4927_SDRAMC_BA(ch)
272#define TX4938_SDRAMC_SIZE(ch) TX4927_SDRAMC_SIZE(ch)
452 273
453#define TX4938_EBUSC_CR(ch) __raw_readq(&tx4938_ebuscptr->cr[(ch)]) 274#define TX4938_EBUSC_CR(ch) TX4927_EBUSC_CR(ch)
454#define TX4938_EBUSC_BA(ch) ((tx4938_ebuscptr->cr[ch] >> 48) << 20) 275#define TX4938_EBUSC_BA(ch) TX4927_EBUSC_BA(ch)
455#define TX4938_EBUSC_SIZE(ch) \ 276#define TX4938_EBUSC_SIZE(ch) TX4927_EBUSC_SIZE(ch)
456 (0x00100000 << ((unsigned long)(tx4938_ebuscptr->cr[ch] >> 8) & 0xf))
457 277
278#define tx4938_get_mem_size() tx4927_get_mem_size()
279void tx4938_wdr_init(void);
280void tx4938_setup(void);
281void tx4938_time_init(unsigned int tmrnr);
282void tx4938_setup_serial(void);
458int tx4938_report_pciclk(void); 283int tx4938_report_pciclk(void);
459void tx4938_report_pci1clk(void); 284void tx4938_report_pci1clk(void);
460int tx4938_pciclk66_setup(void); 285int tx4938_pciclk66_setup(void);
diff --git a/include/asm-powerpc/kvm_host.h b/include/asm-powerpc/kvm_host.h
index 81a69d711017..2655e2a4831e 100644
--- a/include/asm-powerpc/kvm_host.h
+++ b/include/asm-powerpc/kvm_host.h
@@ -31,6 +31,8 @@
31/* memory slots that does not exposed to userspace */ 31/* memory slots that does not exposed to userspace */
32#define KVM_PRIVATE_MEM_SLOTS 4 32#define KVM_PRIVATE_MEM_SLOTS 4
33 33
34#define KVM_COALESCED_MMIO_PAGE_OFFSET 1
35
34/* We don't currently support large pages. */ 36/* We don't currently support large pages. */
35#define KVM_PAGES_PER_HPAGE (1<<31) 37#define KVM_PAGES_PER_HPAGE (1<<31)
36 38
diff --git a/include/asm-s390/kvm_host.h b/include/asm-s390/kvm_host.h
index 18cbd8a39796..3234dd5b3511 100644
--- a/include/asm-s390/kvm_host.h
+++ b/include/asm-s390/kvm_host.h
@@ -62,7 +62,7 @@ struct sca_block {
62#define CPUSTAT_J 0x00000002 62#define CPUSTAT_J 0x00000002
63#define CPUSTAT_P 0x00000001 63#define CPUSTAT_P 0x00000001
64 64
65struct sie_block { 65struct kvm_s390_sie_block {
66 atomic_t cpuflags; /* 0x0000 */ 66 atomic_t cpuflags; /* 0x0000 */
67 __u32 prefix; /* 0x0004 */ 67 __u32 prefix; /* 0x0004 */
68 __u8 reserved8[32]; /* 0x0008 */ 68 __u8 reserved8[32]; /* 0x0008 */
@@ -140,14 +140,14 @@ struct kvm_vcpu_stat {
140 u32 diagnose_44; 140 u32 diagnose_44;
141}; 141};
142 142
143struct io_info { 143struct kvm_s390_io_info {
144 __u16 subchannel_id; /* 0x0b8 */ 144 __u16 subchannel_id; /* 0x0b8 */
145 __u16 subchannel_nr; /* 0x0ba */ 145 __u16 subchannel_nr; /* 0x0ba */
146 __u32 io_int_parm; /* 0x0bc */ 146 __u32 io_int_parm; /* 0x0bc */
147 __u32 io_int_word; /* 0x0c0 */ 147 __u32 io_int_word; /* 0x0c0 */
148}; 148};
149 149
150struct ext_info { 150struct kvm_s390_ext_info {
151 __u32 ext_params; 151 __u32 ext_params;
152 __u64 ext_params2; 152 __u64 ext_params2;
153}; 153};
@@ -160,22 +160,22 @@ struct ext_info {
160#define PGM_SPECIFICATION 0x06 160#define PGM_SPECIFICATION 0x06
161#define PGM_DATA 0x07 161#define PGM_DATA 0x07
162 162
163struct pgm_info { 163struct kvm_s390_pgm_info {
164 __u16 code; 164 __u16 code;
165}; 165};
166 166
167struct prefix_info { 167struct kvm_s390_prefix_info {
168 __u32 address; 168 __u32 address;
169}; 169};
170 170
171struct interrupt_info { 171struct kvm_s390_interrupt_info {
172 struct list_head list; 172 struct list_head list;
173 u64 type; 173 u64 type;
174 union { 174 union {
175 struct io_info io; 175 struct kvm_s390_io_info io;
176 struct ext_info ext; 176 struct kvm_s390_ext_info ext;
177 struct pgm_info pgm; 177 struct kvm_s390_pgm_info pgm;
178 struct prefix_info prefix; 178 struct kvm_s390_prefix_info prefix;
179 }; 179 };
180}; 180};
181 181
@@ -183,35 +183,35 @@ struct interrupt_info {
183#define ACTION_STORE_ON_STOP 1 183#define ACTION_STORE_ON_STOP 1
184#define ACTION_STOP_ON_STOP 2 184#define ACTION_STOP_ON_STOP 2
185 185
186struct local_interrupt { 186struct kvm_s390_local_interrupt {
187 spinlock_t lock; 187 spinlock_t lock;
188 struct list_head list; 188 struct list_head list;
189 atomic_t active; 189 atomic_t active;
190 struct float_interrupt *float_int; 190 struct kvm_s390_float_interrupt *float_int;
191 int timer_due; /* event indicator for waitqueue below */ 191 int timer_due; /* event indicator for waitqueue below */
192 wait_queue_head_t wq; 192 wait_queue_head_t wq;
193 atomic_t *cpuflags; 193 atomic_t *cpuflags;
194 unsigned int action_bits; 194 unsigned int action_bits;
195}; 195};
196 196
197struct float_interrupt { 197struct kvm_s390_float_interrupt {
198 spinlock_t lock; 198 spinlock_t lock;
199 struct list_head list; 199 struct list_head list;
200 atomic_t active; 200 atomic_t active;
201 int next_rr_cpu; 201 int next_rr_cpu;
202 unsigned long idle_mask [(64 + sizeof(long) - 1) / sizeof(long)]; 202 unsigned long idle_mask [(64 + sizeof(long) - 1) / sizeof(long)];
203 struct local_interrupt *local_int[64]; 203 struct kvm_s390_local_interrupt *local_int[64];
204}; 204};
205 205
206 206
207struct kvm_vcpu_arch { 207struct kvm_vcpu_arch {
208 struct sie_block *sie_block; 208 struct kvm_s390_sie_block *sie_block;
209 unsigned long guest_gprs[16]; 209 unsigned long guest_gprs[16];
210 s390_fp_regs host_fpregs; 210 s390_fp_regs host_fpregs;
211 unsigned int host_acrs[NUM_ACRS]; 211 unsigned int host_acrs[NUM_ACRS];
212 s390_fp_regs guest_fpregs; 212 s390_fp_regs guest_fpregs;
213 unsigned int guest_acrs[NUM_ACRS]; 213 unsigned int guest_acrs[NUM_ACRS];
214 struct local_interrupt local_int; 214 struct kvm_s390_local_interrupt local_int;
215 struct timer_list ckc_timer; 215 struct timer_list ckc_timer;
216 union { 216 union {
217 cpuid_t cpu_id; 217 cpuid_t cpu_id;
@@ -228,8 +228,8 @@ struct kvm_arch{
228 unsigned long guest_memsize; 228 unsigned long guest_memsize;
229 struct sca_block *sca; 229 struct sca_block *sca;
230 debug_info_t *dbf; 230 debug_info_t *dbf;
231 struct float_interrupt float_int; 231 struct kvm_s390_float_interrupt float_int;
232}; 232};
233 233
234extern int sie64a(struct sie_block *, __u64 *); 234extern int sie64a(struct kvm_s390_sie_block *, __u64 *);
235#endif 235#endif
diff --git a/include/asm-x86/kvm.h b/include/asm-x86/kvm.h
index 80eefef2cc76..6f1840812e59 100644
--- a/include/asm-x86/kvm.h
+++ b/include/asm-x86/kvm.h
@@ -228,5 +228,6 @@ struct kvm_pit_state {
228#define KVM_TRC_CLTS (KVM_TRC_HANDLER + 0x12) 228#define KVM_TRC_CLTS (KVM_TRC_HANDLER + 0x12)
229#define KVM_TRC_LMSW (KVM_TRC_HANDLER + 0x13) 229#define KVM_TRC_LMSW (KVM_TRC_HANDLER + 0x13)
230#define KVM_TRC_APIC_ACCESS (KVM_TRC_HANDLER + 0x14) 230#define KVM_TRC_APIC_ACCESS (KVM_TRC_HANDLER + 0x14)
231#define KVM_TRC_TDP_FAULT (KVM_TRC_HANDLER + 0x15)
231 232
232#endif 233#endif
diff --git a/include/asm-x86/kvm_host.h b/include/asm-x86/kvm_host.h
index 844f2a89afbc..f995783b1fdb 100644
--- a/include/asm-x86/kvm_host.h
+++ b/include/asm-x86/kvm_host.h
@@ -27,6 +27,7 @@
27#define KVM_PRIVATE_MEM_SLOTS 4 27#define KVM_PRIVATE_MEM_SLOTS 4
28 28
29#define KVM_PIO_PAGE_OFFSET 1 29#define KVM_PIO_PAGE_OFFSET 1
30#define KVM_COALESCED_MMIO_PAGE_OFFSET 2
30 31
31#define CR3_PAE_RESERVED_BITS ((X86_CR3_PWT | X86_CR3_PCD) - 1) 32#define CR3_PAE_RESERVED_BITS ((X86_CR3_PWT | X86_CR3_PCD) - 1)
32#define CR3_NONPAE_RESERVED_BITS ((PAGE_SIZE-1) & ~(X86_CR3_PWT | X86_CR3_PCD)) 33#define CR3_NONPAE_RESERVED_BITS ((PAGE_SIZE-1) & ~(X86_CR3_PWT | X86_CR3_PCD))
@@ -79,6 +80,7 @@
79#define KVM_MIN_FREE_MMU_PAGES 5 80#define KVM_MIN_FREE_MMU_PAGES 5
80#define KVM_REFILL_PAGES 25 81#define KVM_REFILL_PAGES 25
81#define KVM_MAX_CPUID_ENTRIES 40 82#define KVM_MAX_CPUID_ENTRIES 40
83#define KVM_NR_VAR_MTRR 8
82 84
83extern spinlock_t kvm_lock; 85extern spinlock_t kvm_lock;
84extern struct list_head vm_list; 86extern struct list_head vm_list;
@@ -109,12 +111,12 @@ enum {
109}; 111};
110 112
111enum { 113enum {
114 VCPU_SREG_ES,
112 VCPU_SREG_CS, 115 VCPU_SREG_CS,
116 VCPU_SREG_SS,
113 VCPU_SREG_DS, 117 VCPU_SREG_DS,
114 VCPU_SREG_ES,
115 VCPU_SREG_FS, 118 VCPU_SREG_FS,
116 VCPU_SREG_GS, 119 VCPU_SREG_GS,
117 VCPU_SREG_SS,
118 VCPU_SREG_TR, 120 VCPU_SREG_TR,
119 VCPU_SREG_LDTR, 121 VCPU_SREG_LDTR,
120}; 122};
@@ -243,6 +245,7 @@ struct kvm_vcpu_arch {
243 gfn_t last_pt_write_gfn; 245 gfn_t last_pt_write_gfn;
244 int last_pt_write_count; 246 int last_pt_write_count;
245 u64 *last_pte_updated; 247 u64 *last_pte_updated;
248 gfn_t last_pte_gfn;
246 249
247 struct { 250 struct {
248 gfn_t gfn; /* presumed gfn during guest pte update */ 251 gfn_t gfn; /* presumed gfn during guest pte update */
@@ -287,6 +290,10 @@ struct kvm_vcpu_arch {
287 unsigned int hv_clock_tsc_khz; 290 unsigned int hv_clock_tsc_khz;
288 unsigned int time_offset; 291 unsigned int time_offset;
289 struct page *time_page; 292 struct page *time_page;
293
294 bool nmi_pending;
295
296 u64 mtrr[0x100];
290}; 297};
291 298
292struct kvm_mem_alias { 299struct kvm_mem_alias {
@@ -344,6 +351,7 @@ struct kvm_vcpu_stat {
344 u32 mmio_exits; 351 u32 mmio_exits;
345 u32 signal_exits; 352 u32 signal_exits;
346 u32 irq_window_exits; 353 u32 irq_window_exits;
354 u32 nmi_window_exits;
347 u32 halt_exits; 355 u32 halt_exits;
348 u32 halt_wakeup; 356 u32 halt_wakeup;
349 u32 request_irq_exits; 357 u32 request_irq_exits;
@@ -379,7 +387,6 @@ struct kvm_x86_ops {
379 void (*prepare_guest_switch)(struct kvm_vcpu *vcpu); 387 void (*prepare_guest_switch)(struct kvm_vcpu *vcpu);
380 void (*vcpu_load)(struct kvm_vcpu *vcpu, int cpu); 388 void (*vcpu_load)(struct kvm_vcpu *vcpu, int cpu);
381 void (*vcpu_put)(struct kvm_vcpu *vcpu); 389 void (*vcpu_put)(struct kvm_vcpu *vcpu);
382 void (*vcpu_decache)(struct kvm_vcpu *vcpu);
383 390
384 int (*set_guest_debug)(struct kvm_vcpu *vcpu, 391 int (*set_guest_debug)(struct kvm_vcpu *vcpu,
385 struct kvm_debug_guest *dbg); 392 struct kvm_debug_guest *dbg);
@@ -497,6 +504,10 @@ int emulator_get_dr(struct x86_emulate_ctxt *ctxt, int dr,
497int emulator_set_dr(struct x86_emulate_ctxt *ctxt, int dr, 504int emulator_set_dr(struct x86_emulate_ctxt *ctxt, int dr,
498 unsigned long value); 505 unsigned long value);
499 506
507void kvm_get_segment(struct kvm_vcpu *vcpu, struct kvm_segment *var, int seg);
508int kvm_load_segment_descriptor(struct kvm_vcpu *vcpu, u16 selector,
509 int type_bits, int seg);
510
500int kvm_task_switch(struct kvm_vcpu *vcpu, u16 tss_selector, int reason); 511int kvm_task_switch(struct kvm_vcpu *vcpu, u16 tss_selector, int reason);
501 512
502void kvm_set_cr0(struct kvm_vcpu *vcpu, unsigned long cr0); 513void kvm_set_cr0(struct kvm_vcpu *vcpu, unsigned long cr0);
@@ -515,6 +526,8 @@ void kvm_queue_exception_e(struct kvm_vcpu *vcpu, unsigned nr, u32 error_code);
515void kvm_inject_page_fault(struct kvm_vcpu *vcpu, unsigned long cr2, 526void kvm_inject_page_fault(struct kvm_vcpu *vcpu, unsigned long cr2,
516 u32 error_code); 527 u32 error_code);
517 528
529void kvm_inject_nmi(struct kvm_vcpu *vcpu);
530
518void fx_init(struct kvm_vcpu *vcpu); 531void fx_init(struct kvm_vcpu *vcpu);
519 532
520int emulator_read_std(unsigned long addr, 533int emulator_read_std(unsigned long addr,
@@ -554,55 +567,53 @@ static inline struct kvm_mmu_page *page_header(hpa_t shadow_page)
554 return (struct kvm_mmu_page *)page_private(page); 567 return (struct kvm_mmu_page *)page_private(page);
555} 568}
556 569
557static inline u16 read_fs(void) 570static inline u16 kvm_read_fs(void)
558{ 571{
559 u16 seg; 572 u16 seg;
560 asm("mov %%fs, %0" : "=g"(seg)); 573 asm("mov %%fs, %0" : "=g"(seg));
561 return seg; 574 return seg;
562} 575}
563 576
564static inline u16 read_gs(void) 577static inline u16 kvm_read_gs(void)
565{ 578{
566 u16 seg; 579 u16 seg;
567 asm("mov %%gs, %0" : "=g"(seg)); 580 asm("mov %%gs, %0" : "=g"(seg));
568 return seg; 581 return seg;
569} 582}
570 583
571static inline u16 read_ldt(void) 584static inline u16 kvm_read_ldt(void)
572{ 585{
573 u16 ldt; 586 u16 ldt;
574 asm("sldt %0" : "=g"(ldt)); 587 asm("sldt %0" : "=g"(ldt));
575 return ldt; 588 return ldt;
576} 589}
577 590
578static inline void load_fs(u16 sel) 591static inline void kvm_load_fs(u16 sel)
579{ 592{
580 asm("mov %0, %%fs" : : "rm"(sel)); 593 asm("mov %0, %%fs" : : "rm"(sel));
581} 594}
582 595
583static inline void load_gs(u16 sel) 596static inline void kvm_load_gs(u16 sel)
584{ 597{
585 asm("mov %0, %%gs" : : "rm"(sel)); 598 asm("mov %0, %%gs" : : "rm"(sel));
586} 599}
587 600
588#ifndef load_ldt 601static inline void kvm_load_ldt(u16 sel)
589static inline void load_ldt(u16 sel)
590{ 602{
591 asm("lldt %0" : : "rm"(sel)); 603 asm("lldt %0" : : "rm"(sel));
592} 604}
593#endif
594 605
595static inline void get_idt(struct descriptor_table *table) 606static inline void kvm_get_idt(struct descriptor_table *table)
596{ 607{
597 asm("sidt %0" : "=m"(*table)); 608 asm("sidt %0" : "=m"(*table));
598} 609}
599 610
600static inline void get_gdt(struct descriptor_table *table) 611static inline void kvm_get_gdt(struct descriptor_table *table)
601{ 612{
602 asm("sgdt %0" : "=m"(*table)); 613 asm("sgdt %0" : "=m"(*table));
603} 614}
604 615
605static inline unsigned long read_tr_base(void) 616static inline unsigned long kvm_read_tr_base(void)
606{ 617{
607 u16 tr; 618 u16 tr;
608 asm("str %0" : "=g"(tr)); 619 asm("str %0" : "=g"(tr));
@@ -619,17 +630,17 @@ static inline unsigned long read_msr(unsigned long msr)
619} 630}
620#endif 631#endif
621 632
622static inline void fx_save(struct i387_fxsave_struct *image) 633static inline void kvm_fx_save(struct i387_fxsave_struct *image)
623{ 634{
624 asm("fxsave (%0)":: "r" (image)); 635 asm("fxsave (%0)":: "r" (image));
625} 636}
626 637
627static inline void fx_restore(struct i387_fxsave_struct *image) 638static inline void kvm_fx_restore(struct i387_fxsave_struct *image)
628{ 639{
629 asm("fxrstor (%0)":: "r" (image)); 640 asm("fxrstor (%0)":: "r" (image));
630} 641}
631 642
632static inline void fx_finit(void) 643static inline void kvm_fx_finit(void)
633{ 644{
634 asm("finit"); 645 asm("finit");
635} 646}
@@ -691,4 +702,28 @@ enum {
691 trace_mark(kvm_trace_##name, "%u %p %u %u %u %u %u %u", KVM_TRC_##evt, \ 702 trace_mark(kvm_trace_##name, "%u %p %u %u %u %u %u %u", KVM_TRC_##evt, \
692 vcpu, 0, 0, 0, 0, 0, 0) 703 vcpu, 0, 0, 0, 0, 0, 0)
693 704
705#ifdef CONFIG_64BIT
706#define KVM_EX_ENTRY ".quad"
707#else
708#define KVM_EX_ENTRY ".long"
709#endif
710
711/*
712 * Hardware virtualization extension instructions may fault if a
713 * reboot turns off virtualization while processes are running.
714 * Trap the fault and ignore the instruction if that happens.
715 */
716asmlinkage void kvm_handle_fault_on_reboot(void);
717
718#define __kvm_handle_fault_on_reboot(insn) \
719 "666: " insn "\n\t" \
720 ".pushsection .text.fixup, \"ax\" \n" \
721 "667: \n\t" \
722 "push $666b \n\t" \
723 "jmp kvm_handle_fault_on_reboot \n\t" \
724 ".popsection \n\t" \
725 ".pushsection __ex_table, \"a\" \n\t" \
726 KVM_EX_ENTRY " 666b, 667b \n\t" \
727 ".popsection"
728
694#endif 729#endif
diff --git a/include/asm-x86/kvm_x86_emulate.h b/include/asm-x86/kvm_x86_emulate.h
index b877bbd2d3a7..4e8c1e48d91d 100644
--- a/include/asm-x86/kvm_x86_emulate.h
+++ b/include/asm-x86/kvm_x86_emulate.h
@@ -124,7 +124,8 @@ struct decode_cache {
124 u8 rex_prefix; 124 u8 rex_prefix;
125 struct operand src; 125 struct operand src;
126 struct operand dst; 126 struct operand dst;
127 unsigned long *override_base; 127 bool has_seg_override;
128 u8 seg_override;
128 unsigned int d; 129 unsigned int d;
129 unsigned long regs[NR_VCPU_REGS]; 130 unsigned long regs[NR_VCPU_REGS];
130 unsigned long eip; 131 unsigned long eip;
@@ -134,6 +135,7 @@ struct decode_cache {
134 u8 modrm_reg; 135 u8 modrm_reg;
135 u8 modrm_rm; 136 u8 modrm_rm;
136 u8 use_modrm_ea; 137 u8 use_modrm_ea;
138 bool rip_relative;
137 unsigned long modrm_ea; 139 unsigned long modrm_ea;
138 void *modrm_ptr; 140 void *modrm_ptr;
139 unsigned long modrm_val; 141 unsigned long modrm_val;
@@ -150,12 +152,7 @@ struct x86_emulate_ctxt {
150 /* Emulated execution mode, represented by an X86EMUL_MODE value. */ 152 /* Emulated execution mode, represented by an X86EMUL_MODE value. */
151 int mode; 153 int mode;
152 154
153 unsigned long cs_base; 155 u32 cs_base;
154 unsigned long ds_base;
155 unsigned long es_base;
156 unsigned long ss_base;
157 unsigned long gs_base;
158 unsigned long fs_base;
159 156
160 /* decode cache */ 157 /* decode cache */
161 158
diff --git a/include/linux/brcmphy.h b/include/linux/brcmphy.h
new file mode 100644
index 000000000000..9b64b6d67873
--- /dev/null
+++ b/include/linux/brcmphy.h
@@ -0,0 +1,6 @@
1#define PHY_BRCM_WIRESPEED_ENABLE 0x00000001
2#define PHY_BRCM_AUTO_PWRDWN_ENABLE 0x00000002
3#define PHY_BRCM_APD_CLK125_ENABLE 0x00000004
4#define PHY_BRCM_STD_IBND_DISABLE 0x00000008
5#define PHY_BRCM_EXT_IBND_RX_ENABLE 0x00000010
6#define PHY_BRCM_EXT_IBND_TX_ENABLE 0x00000020
diff --git a/include/linux/configfs.h b/include/linux/configfs.h
index 0488f937634a..d62c19ff041c 100644
--- a/include/linux/configfs.h
+++ b/include/linux/configfs.h
@@ -148,7 +148,8 @@ struct configfs_attribute {
148 * items. If the item is a group, it may support mkdir(2). 148 * items. If the item is a group, it may support mkdir(2).
149 * Groups supply one of make_group() and make_item(). If the 149 * Groups supply one of make_group() and make_item(). If the
150 * group supports make_group(), one can create group children. If it 150 * group supports make_group(), one can create group children. If it
151 * supports make_item(), one can create config_item children. If it has 151 * supports make_item(), one can create config_item children. make_group()
152 * and make_item() return ERR_PTR() on errors. If it has
152 * default_groups on group->default_groups, it has automatically created 153 * default_groups on group->default_groups, it has automatically created
153 * group children. default_groups may coexist alongsize make_group() or 154 * group children. default_groups may coexist alongsize make_group() or
154 * make_item(), but if the group wishes to have only default_groups 155 * make_item(), but if the group wishes to have only default_groups
@@ -165,8 +166,8 @@ struct configfs_item_operations {
165}; 166};
166 167
167struct configfs_group_operations { 168struct configfs_group_operations {
168 int (*make_item)(struct config_group *group, const char *name, struct config_item **new_item); 169 struct config_item *(*make_item)(struct config_group *group, const char *name);
169 int (*make_group)(struct config_group *group, const char *name, struct config_group **new_group); 170 struct config_group *(*make_group)(struct config_group *group, const char *name);
170 int (*commit_item)(struct config_item *item); 171 int (*commit_item)(struct config_item *item);
171 void (*disconnect_notify)(struct config_group *group, struct config_item *item); 172 void (*disconnect_notify)(struct config_group *group, struct config_item *item);
172 void (*drop_item)(struct config_group *group, struct config_item *item); 173 void (*drop_item)(struct config_group *group, struct config_item *item);
diff --git a/include/linux/cyclades.h b/include/linux/cyclades.h
index 504cb2c3fa9a..2d3d1e04ba92 100644
--- a/include/linux/cyclades.h
+++ b/include/linux/cyclades.h
@@ -550,11 +550,11 @@ struct cyclades_icount {
550 550
551struct cyclades_port { 551struct cyclades_port {
552 int magic; 552 int magic;
553 struct tty_port port;
553 struct cyclades_card *card; 554 struct cyclades_card *card;
554 int line; 555 int line;
555 int flags; /* defined in tty.h */ 556 int flags; /* defined in tty.h */
556 int type; /* UART type */ 557 int type; /* UART type */
557 struct tty_struct *tty;
558 int read_status_mask; 558 int read_status_mask;
559 int ignore_status_mask; 559 int ignore_status_mask;
560 int timeout; 560 int timeout;
@@ -567,13 +567,8 @@ struct cyclades_port {
567 int chip_rev; 567 int chip_rev;
568 int custom_divisor; 568 int custom_divisor;
569 u8 x_char; /* to be pushed out ASAP */ 569 u8 x_char; /* to be pushed out ASAP */
570 int close_delay;
571 unsigned short closing_wait;
572 int count; /* # of fd on device */
573 int breakon; 570 int breakon;
574 int breakoff; 571 int breakoff;
575 int blocked_open; /* # of blocked opens */
576 unsigned char *xmit_buf;
577 int xmit_head; 572 int xmit_head;
578 int xmit_tail; 573 int xmit_tail;
579 int xmit_cnt; 574 int xmit_cnt;
@@ -583,16 +578,14 @@ struct cyclades_port {
583 struct cyclades_monitor mon; 578 struct cyclades_monitor mon;
584 struct cyclades_idle_stats idle_stats; 579 struct cyclades_idle_stats idle_stats;
585 struct cyclades_icount icount; 580 struct cyclades_icount icount;
586 wait_queue_head_t open_wait;
587 wait_queue_head_t close_wait;
588 struct completion shutdown_wait; 581 struct completion shutdown_wait;
589 wait_queue_head_t delta_msr_wait; 582 wait_queue_head_t delta_msr_wait;
590 int throttle; 583 int throttle;
591}; 584};
592 585
593#define CLOSING_WAIT_DELAY 30*HZ 586#define CLOSING_WAIT_DELAY 30*HZ
594#define CY_CLOSING_WAIT_NONE 65535 587#define CY_CLOSING_WAIT_NONE ASYNC_CLOSING_WAIT_NONE
595#define CY_CLOSING_WAIT_INF 0 588#define CY_CLOSING_WAIT_INF ASYNC_CLOSING_WAIT_INF
596 589
597 590
598#define CyMAX_CHIPS_PER_CARD 8 591#define CyMAX_CHIPS_PER_CARD 8
diff --git a/include/linux/dccp.h b/include/linux/dccp.h
index aa0737019e37..6080449fbec9 100644
--- a/include/linux/dccp.h
+++ b/include/linux/dccp.h
@@ -364,8 +364,6 @@ static inline unsigned int dccp_hdr_len(const struct sk_buff *skb)
364/* FIXME: for now we're default to 1 but it should really be 0 */ 364/* FIXME: for now we're default to 1 but it should really be 0 */
365#define DCCPF_INITIAL_SEND_NDP_COUNT 1 365#define DCCPF_INITIAL_SEND_NDP_COUNT 1
366 366
367#define DCCP_NDP_LIMIT 0xFFFFFF
368
369/** 367/**
370 * struct dccp_minisock - Minimal DCCP connection representation 368 * struct dccp_minisock - Minimal DCCP connection representation
371 * 369 *
@@ -437,7 +435,7 @@ extern int dccp_parse_options(struct sock *sk, struct dccp_request_sock *dreq,
437 struct sk_buff *skb); 435 struct sk_buff *skb);
438 436
439struct dccp_options_received { 437struct dccp_options_received {
440 u32 dccpor_ndp; /* only 24 bits */ 438 u64 dccpor_ndp:48;
441 u32 dccpor_timestamp; 439 u32 dccpor_timestamp;
442 u32 dccpor_timestamp_echo; 440 u32 dccpor_timestamp_echo;
443 u32 dccpor_elapsed_time; 441 u32 dccpor_elapsed_time;
@@ -533,7 +531,7 @@ struct dccp_sock {
533 __u16 dccps_r_ack_ratio; 531 __u16 dccps_r_ack_ratio;
534 __u16 dccps_pcslen; 532 __u16 dccps_pcslen;
535 __u16 dccps_pcrlen; 533 __u16 dccps_pcrlen;
536 unsigned long dccps_ndp_count; 534 __u64 dccps_ndp_count:48;
537 unsigned long dccps_rate_last; 535 unsigned long dccps_rate_last;
538 struct dccp_minisock dccps_minisock; 536 struct dccp_minisock dccps_minisock;
539 struct dccp_ackvec *dccps_hc_rx_ackvec; 537 struct dccp_ackvec *dccps_hc_rx_ackvec;
diff --git a/include/linux/dm9000.h b/include/linux/dm9000.h
index a3750462f9e3..fc82446b6425 100644
--- a/include/linux/dm9000.h
+++ b/include/linux/dm9000.h
@@ -21,6 +21,7 @@
21#define DM9000_PLATF_32BITONLY (0x0004) 21#define DM9000_PLATF_32BITONLY (0x0004)
22#define DM9000_PLATF_EXT_PHY (0x0008) 22#define DM9000_PLATF_EXT_PHY (0x0008)
23#define DM9000_PLATF_NO_EEPROM (0x0010) 23#define DM9000_PLATF_NO_EEPROM (0x0010)
24#define DM9000_PLATF_SIMPLE_PHY (0x0020) /* Use NSR to find LinkStatus */
24 25
25/* platfrom data for platfrom device structure's platfrom_data field */ 26/* platfrom data for platfrom device structure's platfrom_data field */
26 27
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h
index c8d216357865..8bb5e87df365 100644
--- a/include/linux/ethtool.h
+++ b/include/linux/ethtool.h
@@ -272,6 +272,12 @@ enum ethtool_flags {
272 ETH_FLAG_LRO = (1 << 15), /* LRO is enabled */ 272 ETH_FLAG_LRO = (1 << 15), /* LRO is enabled */
273}; 273};
274 274
275struct ethtool_rxnfc {
276 __u32 cmd;
277 __u32 flow_type;
278 __u64 data;
279};
280
275#ifdef __KERNEL__ 281#ifdef __KERNEL__
276 282
277struct net_device; 283struct net_device;
@@ -396,6 +402,8 @@ struct ethtool_ops {
396 /* the following hooks are obsolete */ 402 /* the following hooks are obsolete */
397 int (*self_test_count)(struct net_device *);/* use get_sset_count */ 403 int (*self_test_count)(struct net_device *);/* use get_sset_count */
398 int (*get_stats_count)(struct net_device *);/* use get_sset_count */ 404 int (*get_stats_count)(struct net_device *);/* use get_sset_count */
405 int (*get_rxhash)(struct net_device *, struct ethtool_rxnfc *);
406 int (*set_rxhash)(struct net_device *, struct ethtool_rxnfc *);
399}; 407};
400#endif /* __KERNEL__ */ 408#endif /* __KERNEL__ */
401 409
@@ -442,6 +450,9 @@ struct ethtool_ops {
442#define ETHTOOL_GPFLAGS 0x00000027 /* Get driver-private flags bitmap */ 450#define ETHTOOL_GPFLAGS 0x00000027 /* Get driver-private flags bitmap */
443#define ETHTOOL_SPFLAGS 0x00000028 /* Set driver-private flags bitmap */ 451#define ETHTOOL_SPFLAGS 0x00000028 /* Set driver-private flags bitmap */
444 452
453#define ETHTOOL_GRXFH 0x00000029 /* Get RX flow hash configuration */
454#define ETHTOOL_SRXFH 0x0000002a /* Set RX flow hash configuration */
455
445/* compatibility with older code */ 456/* compatibility with older code */
446#define SPARC_ETH_GSET ETHTOOL_GSET 457#define SPARC_ETH_GSET ETHTOOL_GSET
447#define SPARC_ETH_SSET ETHTOOL_SSET 458#define SPARC_ETH_SSET ETHTOOL_SSET
@@ -528,4 +539,26 @@ struct ethtool_ops {
528#define WAKE_MAGIC (1 << 5) 539#define WAKE_MAGIC (1 << 5)
529#define WAKE_MAGICSECURE (1 << 6) /* only meaningful if WAKE_MAGIC */ 540#define WAKE_MAGICSECURE (1 << 6) /* only meaningful if WAKE_MAGIC */
530 541
542/* L3-L4 network traffic flow types */
543#define TCP_V4_FLOW 0x01
544#define UDP_V4_FLOW 0x02
545#define SCTP_V4_FLOW 0x03
546#define AH_ESP_V4_FLOW 0x04
547#define TCP_V6_FLOW 0x05
548#define UDP_V6_FLOW 0x06
549#define SCTP_V6_FLOW 0x07
550#define AH_ESP_V6_FLOW 0x08
551
552/* L3-L4 network traffic flow hash options */
553#define RXH_DEV_PORT (1 << 0)
554#define RXH_L2DA (1 << 1)
555#define RXH_VLAN (1 << 2)
556#define RXH_L3_PROTO (1 << 3)
557#define RXH_IP_SRC (1 << 4)
558#define RXH_IP_DST (1 << 5)
559#define RXH_L4_B_0_1 (1 << 6) /* src port in case of TCP/UDP/SCTP */
560#define RXH_L4_B_2_3 (1 << 7) /* dst port in case of TCP/UDP/SCTP */
561#define RXH_DISCARD (1 << 31)
562
563
531#endif /* _LINUX_ETHTOOL_H */ 564#endif /* _LINUX_ETHTOOL_H */
diff --git a/include/linux/fs.h b/include/linux/fs.h
index c6455dadb21b..9c2ac5c0ef5c 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -918,12 +918,12 @@ struct file_lock {
918 struct list_head fl_link; /* doubly linked list of all locks */ 918 struct list_head fl_link; /* doubly linked list of all locks */
919 struct list_head fl_block; /* circular list of blocked processes */ 919 struct list_head fl_block; /* circular list of blocked processes */
920 fl_owner_t fl_owner; 920 fl_owner_t fl_owner;
921 unsigned char fl_flags;
922 unsigned char fl_type;
921 unsigned int fl_pid; 923 unsigned int fl_pid;
922 struct pid *fl_nspid; 924 struct pid *fl_nspid;
923 wait_queue_head_t fl_wait; 925 wait_queue_head_t fl_wait;
924 struct file *fl_file; 926 struct file *fl_file;
925 unsigned char fl_flags;
926 unsigned char fl_type;
927 loff_t fl_start; 927 loff_t fl_start;
928 loff_t fl_end; 928 loff_t fl_end;
929 929
diff --git a/include/linux/generic_serial.h b/include/linux/generic_serial.h
index 110833666e37..4cc913939817 100644
--- a/include/linux/generic_serial.h
+++ b/include/linux/generic_serial.h
@@ -14,6 +14,7 @@
14 14
15#ifdef __KERNEL__ 15#ifdef __KERNEL__
16#include <linux/mutex.h> 16#include <linux/mutex.h>
17#include <linux/tty.h>
17 18
18struct real_driver { 19struct real_driver {
19 void (*disable_tx_interrupts) (void *); 20 void (*disable_tx_interrupts) (void *);
@@ -33,17 +34,12 @@ struct real_driver {
33 34
34struct gs_port { 35struct gs_port {
35 int magic; 36 int magic;
37 struct tty_port port;
36 unsigned char *xmit_buf; 38 unsigned char *xmit_buf;
37 int xmit_head; 39 int xmit_head;
38 int xmit_tail; 40 int xmit_tail;
39 int xmit_cnt; 41 int xmit_cnt;
40 struct mutex port_write_mutex; 42 struct mutex port_write_mutex;
41 int flags;
42 wait_queue_head_t open_wait;
43 wait_queue_head_t close_wait;
44 int count;
45 int blocked_open;
46 struct tty_struct *tty;
47 unsigned long event; 43 unsigned long event;
48 unsigned short closing_wait; 44 unsigned short closing_wait;
49 int close_delay; 45 int close_delay;
diff --git a/include/linux/hayesesp.h b/include/linux/hayesesp.h
index 2177ee5b2fe2..940aeb51d53f 100644
--- a/include/linux/hayesesp.h
+++ b/include/linux/hayesesp.h
@@ -76,11 +76,10 @@ struct hayes_esp_config {
76 76
77struct esp_struct { 77struct esp_struct {
78 int magic; 78 int magic;
79 struct tty_port port;
79 spinlock_t lock; 80 spinlock_t lock;
80 int port; 81 int io_port;
81 int irq; 82 int irq;
82 int flags; /* defined in tty.h */
83 struct tty_struct *tty;
84 int read_status_mask; 83 int read_status_mask;
85 int ignore_status_mask; 84 int ignore_status_mask;
86 int timeout; 85 int timeout;
@@ -93,14 +92,10 @@ struct esp_struct {
93 int MCR; /* Modem control register */ 92 int MCR; /* Modem control register */
94 unsigned long last_active; 93 unsigned long last_active;
95 int line; 94 int line;
96 int count; /* # of fd on device */
97 int blocked_open; /* # of blocked opens */
98 unsigned char *xmit_buf; 95 unsigned char *xmit_buf;
99 int xmit_head; 96 int xmit_head;
100 int xmit_tail; 97 int xmit_tail;
101 int xmit_cnt; 98 int xmit_cnt;
102 wait_queue_head_t open_wait;
103 wait_queue_head_t close_wait;
104 wait_queue_head_t delta_msr_wait; 99 wait_queue_head_t delta_msr_wait;
105 wait_queue_head_t break_wait; 100 wait_queue_head_t break_wait;
106 struct async_icount icount; /* kernel counters for the 4 input interrupts */ 101 struct async_icount icount; /* kernel counters for the 4 input interrupts */
diff --git a/include/linux/hdlc.h b/include/linux/hdlc.h
index 6115545a5b9c..c59769693bee 100644
--- a/include/linux/hdlc.h
+++ b/include/linux/hdlc.h
@@ -45,7 +45,6 @@ struct hdlc_proto {
45 45
46/* Pointed to by dev->priv */ 46/* Pointed to by dev->priv */
47typedef struct hdlc_device { 47typedef struct hdlc_device {
48 struct net_device_stats stats;
49 /* used by HDLC layer to take control over HDLC device from hw driver*/ 48 /* used by HDLC layer to take control over HDLC device from hw driver*/
50 int (*attach)(struct net_device *dev, 49 int (*attach)(struct net_device *dev,
51 unsigned short encoding, unsigned short parity); 50 unsigned short encoding, unsigned short parity);
@@ -109,12 +108,6 @@ int attach_hdlc_protocol(struct net_device *dev, struct hdlc_proto *proto,
109/* May be used by hardware driver to gain control over HDLC device */ 108/* May be used by hardware driver to gain control over HDLC device */
110void detach_hdlc_protocol(struct net_device *dev); 109void detach_hdlc_protocol(struct net_device *dev);
111 110
112static __inline__ struct net_device_stats *hdlc_stats(struct net_device *dev)
113{
114 return &dev_to_hdlc(dev)->stats;
115}
116
117
118static __inline__ __be16 hdlc_type_trans(struct sk_buff *skb, 111static __inline__ __be16 hdlc_type_trans(struct sk_buff *skb,
119 struct net_device *dev) 112 struct net_device *dev)
120{ 113{
diff --git a/include/linux/i2c-id.h b/include/linux/i2c-id.h
index ef13b7c66df3..4862398e05bf 100644
--- a/include/linux/i2c-id.h
+++ b/include/linux/i2c-id.h
@@ -33,15 +33,11 @@
33 33
34#define I2C_DRIVERID_MSP3400 1 34#define I2C_DRIVERID_MSP3400 1
35#define I2C_DRIVERID_TUNER 2 35#define I2C_DRIVERID_TUNER 2
36#define I2C_DRIVERID_TDA8425 4 /* stereo sound processor */
37#define I2C_DRIVERID_TEA6420 5 /* audio matrix switch */ 36#define I2C_DRIVERID_TEA6420 5 /* audio matrix switch */
38#define I2C_DRIVERID_TEA6415C 6 /* video matrix switch */ 37#define I2C_DRIVERID_TEA6415C 6 /* video matrix switch */
39#define I2C_DRIVERID_TDA9840 7 /* stereo sound processor */ 38#define I2C_DRIVERID_TDA9840 7 /* stereo sound processor */
40#define I2C_DRIVERID_SAA7111A 8 /* video input processor */ 39#define I2C_DRIVERID_SAA7111A 8 /* video input processor */
41#define I2C_DRIVERID_SAA7185B 13 /* video encoder */ 40#define I2C_DRIVERID_SAA7185B 13 /* video encoder */
42#define I2C_DRIVERID_TEA6300 18 /* audio mixer */
43#define I2C_DRIVERID_TDA9850 20 /* audio mixer */
44#define I2C_DRIVERID_TDA9855 21 /* audio mixer */
45#define I2C_DRIVERID_SAA7110 22 /* video decoder */ 41#define I2C_DRIVERID_SAA7110 22 /* video decoder */
46#define I2C_DRIVERID_MGATVO 23 /* Matrox TVOut */ 42#define I2C_DRIVERID_MGATVO 23 /* Matrox TVOut */
47#define I2C_DRIVERID_SAA5249 24 /* SAA5249 and compatibles */ 43#define I2C_DRIVERID_SAA5249 24 /* SAA5249 and compatibles */
@@ -50,9 +46,7 @@
50#define I2C_DRIVERID_TDA7432 27 /* Stereo sound processor */ 46#define I2C_DRIVERID_TDA7432 27 /* Stereo sound processor */
51#define I2C_DRIVERID_TVMIXER 28 /* Mixer driver for tv cards */ 47#define I2C_DRIVERID_TVMIXER 28 /* Mixer driver for tv cards */
52#define I2C_DRIVERID_TVAUDIO 29 /* Generic TV sound driver */ 48#define I2C_DRIVERID_TVAUDIO 29 /* Generic TV sound driver */
53#define I2C_DRIVERID_TDA9873 31 /* TV sound decoder chip */
54#define I2C_DRIVERID_TDA9875 32 /* TV sound decoder chip */ 49#define I2C_DRIVERID_TDA9875 32 /* TV sound decoder chip */
55#define I2C_DRIVERID_PIC16C54_PV9 33 /* Audio mux/ir receiver */
56#define I2C_DRIVERID_BT819 40 /* video decoder */ 50#define I2C_DRIVERID_BT819 40 /* video decoder */
57#define I2C_DRIVERID_BT856 41 /* video encoder */ 51#define I2C_DRIVERID_BT856 41 /* video encoder */
58#define I2C_DRIVERID_VPX3220 42 /* video decoder+vbi/vtxt */ 52#define I2C_DRIVERID_VPX3220 42 /* video decoder+vbi/vtxt */
@@ -63,7 +57,6 @@
63#define I2C_DRIVERID_INDYCAM 58 /* SGI IndyCam */ 57#define I2C_DRIVERID_INDYCAM 58 /* SGI IndyCam */
64#define I2C_DRIVERID_OVCAMCHIP 61 /* OmniVision CMOS image sens. */ 58#define I2C_DRIVERID_OVCAMCHIP 61 /* OmniVision CMOS image sens. */
65#define I2C_DRIVERID_MAX6900 63 /* MAX6900 real-time clock */ 59#define I2C_DRIVERID_MAX6900 63 /* MAX6900 real-time clock */
66#define I2C_DRIVERID_TDA9874 66 /* TV sound decoder */
67#define I2C_DRIVERID_SAA6752HS 67 /* MPEG2 encoder */ 60#define I2C_DRIVERID_SAA6752HS 67 /* MPEG2 encoder */
68#define I2C_DRIVERID_TVEEPROM 68 /* TV EEPROM */ 61#define I2C_DRIVERID_TVEEPROM 68 /* TV EEPROM */
69#define I2C_DRIVERID_WM8775 69 /* wm8775 audio processor */ 62#define I2C_DRIVERID_WM8775 69 /* wm8775 audio processor */
@@ -158,7 +151,6 @@
158#define I2C_HW_SMBUS_W9968CF 0x04000d 151#define I2C_HW_SMBUS_W9968CF 0x04000d
159#define I2C_HW_SMBUS_OV511 0x04000e /* OV511(+) USB 1.1 webcam ICs */ 152#define I2C_HW_SMBUS_OV511 0x04000e /* OV511(+) USB 1.1 webcam ICs */
160#define I2C_HW_SMBUS_OV518 0x04000f /* OV518(+) USB 1.1 webcam ICs */ 153#define I2C_HW_SMBUS_OV518 0x04000f /* OV518(+) USB 1.1 webcam ICs */
161#define I2C_HW_SMBUS_OVFX2 0x040011 /* Cypress/OmniVision FX2 webcam */
162#define I2C_HW_SMBUS_CAFE 0x040012 /* Marvell 88ALP01 "CAFE" cam */ 154#define I2C_HW_SMBUS_CAFE 0x040012 /* Marvell 88ALP01 "CAFE" cam */
163#define I2C_HW_SMBUS_ALI1563 0x040013 155#define I2C_HW_SMBUS_ALI1563 0x040013
164 156
diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h
index 0b5e03eae6d2..a1630ba0b87c 100644
--- a/include/linux/ieee80211.h
+++ b/include/linux/ieee80211.h
@@ -98,6 +98,9 @@
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#define IEEE80211_MAX_MESH_ID_LEN 32
101#define IEEE80211_QOS_CTL_LEN 2
102#define IEEE80211_QOS_CTL_TID_MASK 0x000F
103#define IEEE80211_QOS_CTL_TAG1D_MASK 0x0007
101 104
102struct ieee80211_hdr { 105struct ieee80211_hdr {
103 __le16 frame_control; 106 __le16 frame_control;
@@ -109,6 +112,355 @@ struct ieee80211_hdr {
109 u8 addr4[6]; 112 u8 addr4[6];
110} __attribute__ ((packed)); 113} __attribute__ ((packed));
111 114
115/**
116 * ieee80211_has_tods - check if IEEE80211_FCTL_TODS is set
117 * @fc: frame control bytes in little-endian byteorder
118 */
119static inline int ieee80211_has_tods(__le16 fc)
120{
121 return (fc & cpu_to_le16(IEEE80211_FCTL_TODS)) != 0;
122}
123
124/**
125 * ieee80211_has_fromds - check if IEEE80211_FCTL_FROMDS is set
126 * @fc: frame control bytes in little-endian byteorder
127 */
128static inline int ieee80211_has_fromds(__le16 fc)
129{
130 return (fc & cpu_to_le16(IEEE80211_FCTL_FROMDS)) != 0;
131}
132
133/**
134 * ieee80211_has_a4 - check if IEEE80211_FCTL_TODS and IEEE80211_FCTL_FROMDS are set
135 * @fc: frame control bytes in little-endian byteorder
136 */
137static inline int ieee80211_has_a4(__le16 fc)
138{
139 __le16 tmp = cpu_to_le16(IEEE80211_FCTL_TODS | IEEE80211_FCTL_FROMDS);
140 return (fc & tmp) == tmp;
141}
142
143/**
144 * ieee80211_has_morefrags - check if IEEE80211_FCTL_MOREFRAGS is set
145 * @fc: frame control bytes in little-endian byteorder
146 */
147static inline int ieee80211_has_morefrags(__le16 fc)
148{
149 return (fc & cpu_to_le16(IEEE80211_FCTL_MOREFRAGS)) != 0;
150}
151
152/**
153 * ieee80211_has_retry - check if IEEE80211_FCTL_RETRY is set
154 * @fc: frame control bytes in little-endian byteorder
155 */
156static inline int ieee80211_has_retry(__le16 fc)
157{
158 return (fc & cpu_to_le16(IEEE80211_FCTL_RETRY)) != 0;
159}
160
161/**
162 * ieee80211_has_pm - check if IEEE80211_FCTL_PM is set
163 * @fc: frame control bytes in little-endian byteorder
164 */
165static inline int ieee80211_has_pm(__le16 fc)
166{
167 return (fc & cpu_to_le16(IEEE80211_FCTL_PM)) != 0;
168}
169
170/**
171 * ieee80211_has_moredata - check if IEEE80211_FCTL_MOREDATA is set
172 * @fc: frame control bytes in little-endian byteorder
173 */
174static inline int ieee80211_has_moredata(__le16 fc)
175{
176 return (fc & cpu_to_le16(IEEE80211_FCTL_MOREDATA)) != 0;
177}
178
179/**
180 * ieee80211_has_protected - check if IEEE80211_FCTL_PROTECTED is set
181 * @fc: frame control bytes in little-endian byteorder
182 */
183static inline int ieee80211_has_protected(__le16 fc)
184{
185 return (fc & cpu_to_le16(IEEE80211_FCTL_PROTECTED)) != 0;
186}
187
188/**
189 * ieee80211_has_order - check if IEEE80211_FCTL_ORDER is set
190 * @fc: frame control bytes in little-endian byteorder
191 */
192static inline int ieee80211_has_order(__le16 fc)
193{
194 return (fc & cpu_to_le16(IEEE80211_FCTL_ORDER)) != 0;
195}
196
197/**
198 * ieee80211_is_mgmt - check if type is IEEE80211_FTYPE_MGMT
199 * @fc: frame control bytes in little-endian byteorder
200 */
201static inline int ieee80211_is_mgmt(__le16 fc)
202{
203 return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE)) ==
204 cpu_to_le16(IEEE80211_FTYPE_MGMT);
205}
206
207/**
208 * ieee80211_is_ctl - check if type is IEEE80211_FTYPE_CTL
209 * @fc: frame control bytes in little-endian byteorder
210 */
211static inline int ieee80211_is_ctl(__le16 fc)
212{
213 return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE)) ==
214 cpu_to_le16(IEEE80211_FTYPE_CTL);
215}
216
217/**
218 * ieee80211_is_data - check if type is IEEE80211_FTYPE_DATA
219 * @fc: frame control bytes in little-endian byteorder
220 */
221static inline int ieee80211_is_data(__le16 fc)
222{
223 return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE)) ==
224 cpu_to_le16(IEEE80211_FTYPE_DATA);
225}
226
227/**
228 * ieee80211_is_data_qos - check if type is IEEE80211_FTYPE_DATA and IEEE80211_STYPE_QOS_DATA is set
229 * @fc: frame control bytes in little-endian byteorder
230 */
231static inline int ieee80211_is_data_qos(__le16 fc)
232{
233 /*
234 * mask with QOS_DATA rather than IEEE80211_FCTL_STYPE as we just need
235 * to check the one bit
236 */
237 return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_STYPE_QOS_DATA)) ==
238 cpu_to_le16(IEEE80211_FTYPE_DATA | IEEE80211_STYPE_QOS_DATA);
239}
240
241/**
242 * ieee80211_is_data_present - check if type is IEEE80211_FTYPE_DATA and has data
243 * @fc: frame control bytes in little-endian byteorder
244 */
245static inline int ieee80211_is_data_present(__le16 fc)
246{
247 /*
248 * mask with 0x40 and test that that bit is clear to only return true
249 * for the data-containing substypes.
250 */
251 return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | 0x40)) ==
252 cpu_to_le16(IEEE80211_FTYPE_DATA);
253}
254
255/**
256 * ieee80211_is_assoc_req - check if IEEE80211_FTYPE_MGMT && IEEE80211_STYPE_ASSOC_REQ
257 * @fc: frame control bytes in little-endian byteorder
258 */
259static inline int ieee80211_is_assoc_req(__le16 fc)
260{
261 return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) ==
262 cpu_to_le16(IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_ASSOC_REQ);
263}
264
265/**
266 * ieee80211_is_assoc_resp - check if IEEE80211_FTYPE_MGMT && IEEE80211_STYPE_ASSOC_RESP
267 * @fc: frame control bytes in little-endian byteorder
268 */
269static inline int ieee80211_is_assoc_resp(__le16 fc)
270{
271 return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) ==
272 cpu_to_le16(IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_ASSOC_RESP);
273}
274
275/**
276 * ieee80211_is_reassoc_req - check if IEEE80211_FTYPE_MGMT && IEEE80211_STYPE_REASSOC_REQ
277 * @fc: frame control bytes in little-endian byteorder
278 */
279static inline int ieee80211_is_reassoc_req(__le16 fc)
280{
281 return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) ==
282 cpu_to_le16(IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_REASSOC_REQ);
283}
284
285/**
286 * ieee80211_is_reassoc_resp - check if IEEE80211_FTYPE_MGMT && IEEE80211_STYPE_REASSOC_RESP
287 * @fc: frame control bytes in little-endian byteorder
288 */
289static inline int ieee80211_is_reassoc_resp(__le16 fc)
290{
291 return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) ==
292 cpu_to_le16(IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_REASSOC_RESP);
293}
294
295/**
296 * ieee80211_is_probe_req - check if IEEE80211_FTYPE_MGMT && IEEE80211_STYPE_PROBE_REQ
297 * @fc: frame control bytes in little-endian byteorder
298 */
299static inline int ieee80211_is_probe_req(__le16 fc)
300{
301 return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) ==
302 cpu_to_le16(IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_PROBE_REQ);
303}
304
305/**
306 * ieee80211_is_probe_resp - check if IEEE80211_FTYPE_MGMT && IEEE80211_STYPE_PROBE_RESP
307 * @fc: frame control bytes in little-endian byteorder
308 */
309static inline int ieee80211_is_probe_resp(__le16 fc)
310{
311 return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) ==
312 cpu_to_le16(IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_PROBE_RESP);
313}
314
315/**
316 * ieee80211_is_beacon - check if IEEE80211_FTYPE_MGMT && IEEE80211_STYPE_BEACON
317 * @fc: frame control bytes in little-endian byteorder
318 */
319static inline int ieee80211_is_beacon(__le16 fc)
320{
321 return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) ==
322 cpu_to_le16(IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_BEACON);
323}
324
325/**
326 * ieee80211_is_atim - check if IEEE80211_FTYPE_MGMT && IEEE80211_STYPE_ATIM
327 * @fc: frame control bytes in little-endian byteorder
328 */
329static inline int ieee80211_is_atim(__le16 fc)
330{
331 return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) ==
332 cpu_to_le16(IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_ATIM);
333}
334
335/**
336 * ieee80211_is_disassoc - check if IEEE80211_FTYPE_MGMT && IEEE80211_STYPE_DISASSOC
337 * @fc: frame control bytes in little-endian byteorder
338 */
339static inline int ieee80211_is_disassoc(__le16 fc)
340{
341 return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) ==
342 cpu_to_le16(IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_DISASSOC);
343}
344
345/**
346 * ieee80211_is_auth - check if IEEE80211_FTYPE_MGMT && IEEE80211_STYPE_AUTH
347 * @fc: frame control bytes in little-endian byteorder
348 */
349static inline int ieee80211_is_auth(__le16 fc)
350{
351 return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) ==
352 cpu_to_le16(IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_AUTH);
353}
354
355/**
356 * ieee80211_is_deauth - check if IEEE80211_FTYPE_MGMT && IEEE80211_STYPE_DEAUTH
357 * @fc: frame control bytes in little-endian byteorder
358 */
359static inline int ieee80211_is_deauth(__le16 fc)
360{
361 return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) ==
362 cpu_to_le16(IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_DEAUTH);
363}
364
365/**
366 * ieee80211_is_action - check if IEEE80211_FTYPE_MGMT && IEEE80211_STYPE_ACTION
367 * @fc: frame control bytes in little-endian byteorder
368 */
369static inline int ieee80211_is_action(__le16 fc)
370{
371 return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) ==
372 cpu_to_le16(IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_ACTION);
373}
374
375/**
376 * ieee80211_is_back_req - check if IEEE80211_FTYPE_CTL && IEEE80211_STYPE_BACK_REQ
377 * @fc: frame control bytes in little-endian byteorder
378 */
379static inline int ieee80211_is_back_req(__le16 fc)
380{
381 return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) ==
382 cpu_to_le16(IEEE80211_FTYPE_CTL | IEEE80211_STYPE_BACK_REQ);
383}
384
385/**
386 * ieee80211_is_back - check if IEEE80211_FTYPE_CTL && IEEE80211_STYPE_BACK
387 * @fc: frame control bytes in little-endian byteorder
388 */
389static inline int ieee80211_is_back(__le16 fc)
390{
391 return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) ==
392 cpu_to_le16(IEEE80211_FTYPE_CTL | IEEE80211_STYPE_BACK);
393}
394
395/**
396 * ieee80211_is_pspoll - check if IEEE80211_FTYPE_CTL && IEEE80211_STYPE_PSPOLL
397 * @fc: frame control bytes in little-endian byteorder
398 */
399static inline int ieee80211_is_pspoll(__le16 fc)
400{
401 return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) ==
402 cpu_to_le16(IEEE80211_FTYPE_CTL | IEEE80211_STYPE_PSPOLL);
403}
404
405/**
406 * ieee80211_is_rts - check if IEEE80211_FTYPE_CTL && IEEE80211_STYPE_RTS
407 * @fc: frame control bytes in little-endian byteorder
408 */
409static inline int ieee80211_is_rts(__le16 fc)
410{
411 return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) ==
412 cpu_to_le16(IEEE80211_FTYPE_CTL | IEEE80211_STYPE_RTS);
413}
414
415/**
416 * ieee80211_is_cts - check if IEEE80211_FTYPE_CTL && IEEE80211_STYPE_CTS
417 * @fc: frame control bytes in little-endian byteorder
418 */
419static inline int ieee80211_is_cts(__le16 fc)
420{
421 return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) ==
422 cpu_to_le16(IEEE80211_FTYPE_CTL | IEEE80211_STYPE_CTS);
423}
424
425/**
426 * ieee80211_is_ack - check if IEEE80211_FTYPE_CTL && IEEE80211_STYPE_ACK
427 * @fc: frame control bytes in little-endian byteorder
428 */
429static inline int ieee80211_is_ack(__le16 fc)
430{
431 return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) ==
432 cpu_to_le16(IEEE80211_FTYPE_CTL | IEEE80211_STYPE_ACK);
433}
434
435/**
436 * ieee80211_is_cfend - check if IEEE80211_FTYPE_CTL && IEEE80211_STYPE_CFEND
437 * @fc: frame control bytes in little-endian byteorder
438 */
439static inline int ieee80211_is_cfend(__le16 fc)
440{
441 return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) ==
442 cpu_to_le16(IEEE80211_FTYPE_CTL | IEEE80211_STYPE_CFEND);
443}
444
445/**
446 * ieee80211_is_cfendack - check if IEEE80211_FTYPE_CTL && IEEE80211_STYPE_CFENDACK
447 * @fc: frame control bytes in little-endian byteorder
448 */
449static inline int ieee80211_is_cfendack(__le16 fc)
450{
451 return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) ==
452 cpu_to_le16(IEEE80211_FTYPE_CTL | IEEE80211_STYPE_CFENDACK);
453}
454
455/**
456 * ieee80211_is_nullfunc - check if FTYPE=IEEE80211_FTYPE_DATA and STYPE=IEEE80211_STYPE_NULLFUNC
457 * @fc: frame control bytes in little-endian byteorder
458 */
459static inline int ieee80211_is_nullfunc(__le16 fc)
460{
461 return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) ==
462 cpu_to_le16(IEEE80211_FTYPE_DATA | IEEE80211_STYPE_NULLFUNC);
463}
112 464
113struct ieee80211s_hdr { 465struct ieee80211s_hdr {
114 u8 flags; 466 u8 flags;
@@ -119,6 +471,40 @@ struct ieee80211s_hdr {
119 u8 eaddr3[6]; 471 u8 eaddr3[6];
120} __attribute__ ((packed)); 472} __attribute__ ((packed));
121 473
474/**
475 * struct ieee80211_quiet_ie
476 *
477 * This structure refers to "Quiet information element"
478 */
479struct ieee80211_quiet_ie {
480 u8 count;
481 u8 period;
482 __le16 duration;
483 __le16 offset;
484} __attribute__ ((packed));
485
486/**
487 * struct ieee80211_msrment_ie
488 *
489 * This structure refers to "Measurement Request/Report information element"
490 */
491struct ieee80211_msrment_ie {
492 u8 token;
493 u8 mode;
494 u8 type;
495 u8 request[0];
496} __attribute__ ((packed));
497
498/**
499 * struct ieee80211_channel_sw_ie
500 *
501 * This structure refers to "Channel Switch Announcement information element"
502 */
503struct ieee80211_channel_sw_ie {
504 u8 mode;
505 u8 new_ch_num;
506 u8 count;
507} __attribute__ ((packed));
122 508
123struct ieee80211_mgmt { 509struct ieee80211_mgmt {
124 __le16 frame_control; 510 __le16 frame_control;
@@ -194,13 +580,18 @@ struct ieee80211_mgmt {
194 u8 action_code; 580 u8 action_code;
195 u8 element_id; 581 u8 element_id;
196 u8 length; 582 u8 length;
197 u8 switch_mode; 583 struct ieee80211_channel_sw_ie sw_elem;
198 u8 new_chan;
199 u8 switch_count;
200 } __attribute__((packed)) chan_switch; 584 } __attribute__((packed)) chan_switch;
201 struct{ 585 struct{
202 u8 action_code; 586 u8 action_code;
203 u8 dialog_token; 587 u8 dialog_token;
588 u8 element_id;
589 u8 length;
590 struct ieee80211_msrment_ie msr_elem;
591 } __attribute__((packed)) measurement;
592 struct{
593 u8 action_code;
594 u8 dialog_token;
204 __le16 capab; 595 __le16 capab;
205 __le16 timeout; 596 __le16 timeout;
206 __le16 start_seq_num; 597 __le16 start_seq_num;
@@ -269,6 +660,10 @@ struct ieee80211_bar {
269 __le16 start_seq_num; 660 __le16 start_seq_num;
270} __attribute__((packed)); 661} __attribute__((packed));
271 662
663/* 802.11 BAR control masks */
664#define IEEE80211_BAR_CTRL_ACK_POLICY_NORMAL 0x0000
665#define IEEE80211_BAR_CTRL_CBMTID_COMPRESSED_BA 0x0004
666
272/** 667/**
273 * struct ieee80211_ht_cap - HT capabilities 668 * struct ieee80211_ht_cap - HT capabilities
274 * 669 *
@@ -306,20 +701,33 @@ struct ieee80211_ht_addt_info {
306#define IEEE80211_HT_CAP_SGI_40 0x0040 701#define IEEE80211_HT_CAP_SGI_40 0x0040
307#define IEEE80211_HT_CAP_DELAY_BA 0x0400 702#define IEEE80211_HT_CAP_DELAY_BA 0x0400
308#define IEEE80211_HT_CAP_MAX_AMSDU 0x0800 703#define IEEE80211_HT_CAP_MAX_AMSDU 0x0800
704/* 802.11n HT capability AMPDU settings */
309#define IEEE80211_HT_CAP_AMPDU_FACTOR 0x03 705#define IEEE80211_HT_CAP_AMPDU_FACTOR 0x03
310#define IEEE80211_HT_CAP_AMPDU_DENSITY 0x1C 706#define IEEE80211_HT_CAP_AMPDU_DENSITY 0x1C
707/* 802.11n HT capability MSC set */
708#define IEEE80211_SUPP_MCS_SET_UEQM 4
709#define IEEE80211_HT_CAP_MAX_STREAMS 4
710#define IEEE80211_SUPP_MCS_SET_LEN 10
711/* maximum streams the spec allows */
712#define IEEE80211_HT_CAP_MCS_TX_DEFINED 0x01
713#define IEEE80211_HT_CAP_MCS_TX_RX_DIFF 0x02
714#define IEEE80211_HT_CAP_MCS_TX_STREAMS 0x0C
715#define IEEE80211_HT_CAP_MCS_TX_UEQM 0x10
311/* 802.11n HT IE masks */ 716/* 802.11n HT IE masks */
312#define IEEE80211_HT_IE_CHA_SEC_OFFSET 0x03 717#define IEEE80211_HT_IE_CHA_SEC_OFFSET 0x03
718#define IEEE80211_HT_IE_CHA_SEC_NONE 0x00
719#define IEEE80211_HT_IE_CHA_SEC_ABOVE 0x01
720#define IEEE80211_HT_IE_CHA_SEC_BELOW 0x03
313#define IEEE80211_HT_IE_CHA_WIDTH 0x04 721#define IEEE80211_HT_IE_CHA_WIDTH 0x04
314#define IEEE80211_HT_IE_HT_PROTECTION 0x0003 722#define IEEE80211_HT_IE_HT_PROTECTION 0x0003
315#define IEEE80211_HT_IE_NON_GF_STA_PRSNT 0x0004 723#define IEEE80211_HT_IE_NON_GF_STA_PRSNT 0x0004
316#define IEEE80211_HT_IE_NON_HT_STA_PRSNT 0x0010 724#define IEEE80211_HT_IE_NON_HT_STA_PRSNT 0x0010
317 725
318/* MIMO Power Save Modes */ 726/* MIMO Power Save Modes */
319#define WLAN_HT_CAP_MIMO_PS_STATIC 0 727#define WLAN_HT_CAP_MIMO_PS_STATIC 0
320#define WLAN_HT_CAP_MIMO_PS_DYNAMIC 1 728#define WLAN_HT_CAP_MIMO_PS_DYNAMIC 1
321#define WLAN_HT_CAP_MIMO_PS_INVALID 2 729#define WLAN_HT_CAP_MIMO_PS_INVALID 2
322#define WLAN_HT_CAP_MIMO_PS_DISABLED 3 730#define WLAN_HT_CAP_MIMO_PS_DISABLED 3
323 731
324/* Authentication algorithms */ 732/* Authentication algorithms */
325#define WLAN_AUTH_OPEN 0 733#define WLAN_AUTH_OPEN 0
@@ -337,11 +745,21 @@ struct ieee80211_ht_addt_info {
337#define WLAN_CAPABILITY_SHORT_PREAMBLE (1<<5) 745#define WLAN_CAPABILITY_SHORT_PREAMBLE (1<<5)
338#define WLAN_CAPABILITY_PBCC (1<<6) 746#define WLAN_CAPABILITY_PBCC (1<<6)
339#define WLAN_CAPABILITY_CHANNEL_AGILITY (1<<7) 747#define WLAN_CAPABILITY_CHANNEL_AGILITY (1<<7)
748
340/* 802.11h */ 749/* 802.11h */
341#define WLAN_CAPABILITY_SPECTRUM_MGMT (1<<8) 750#define WLAN_CAPABILITY_SPECTRUM_MGMT (1<<8)
342#define WLAN_CAPABILITY_QOS (1<<9) 751#define WLAN_CAPABILITY_QOS (1<<9)
343#define WLAN_CAPABILITY_SHORT_SLOT_TIME (1<<10) 752#define WLAN_CAPABILITY_SHORT_SLOT_TIME (1<<10)
344#define WLAN_CAPABILITY_DSSS_OFDM (1<<13) 753#define WLAN_CAPABILITY_DSSS_OFDM (1<<13)
754/* measurement */
755#define IEEE80211_SPCT_MSR_RPRT_MODE_LATE (1<<0)
756#define IEEE80211_SPCT_MSR_RPRT_MODE_INCAPABLE (1<<1)
757#define IEEE80211_SPCT_MSR_RPRT_MODE_REFUSED (1<<2)
758
759#define IEEE80211_SPCT_MSR_RPRT_TYPE_BASIC 0
760#define IEEE80211_SPCT_MSR_RPRT_TYPE_CCA 1
761#define IEEE80211_SPCT_MSR_RPRT_TYPE_RPI 2
762
345 763
346/* 802.11g ERP information element */ 764/* 802.11g ERP information element */
347#define WLAN_ERP_NON_ERP_PRESENT (1<<0) 765#define WLAN_ERP_NON_ERP_PRESENT (1<<0)
@@ -512,6 +930,15 @@ enum ieee80211_category {
512 WLAN_CATEGORY_WMM = 17, 930 WLAN_CATEGORY_WMM = 17,
513}; 931};
514 932
933/* SPECTRUM_MGMT action code */
934enum ieee80211_spectrum_mgmt_actioncode {
935 WLAN_ACTION_SPCT_MSR_REQ = 0,
936 WLAN_ACTION_SPCT_MSR_RPRT = 1,
937 WLAN_ACTION_SPCT_TPC_REQ = 2,
938 WLAN_ACTION_SPCT_TPC_RPRT = 3,
939 WLAN_ACTION_SPCT_CHL_SWITCH = 4,
940};
941
515/* BACK action code */ 942/* BACK action code */
516enum ieee80211_back_actioncode { 943enum ieee80211_back_actioncode {
517 WLAN_ACTION_ADDBA_REQ = 0, 944 WLAN_ACTION_ADDBA_REQ = 0,
@@ -540,63 +967,57 @@ enum ieee80211_back_parties {
540#define WLAN_MAX_KEY_LEN 32 967#define WLAN_MAX_KEY_LEN 32
541 968
542/** 969/**
970 * ieee80211_get_qos_ctl - get pointer to qos control bytes
971 * @hdr: the frame
972 *
973 * The qos ctrl bytes come after the frame_control, duration, seq_num
974 * and 3 or 4 addresses of length ETH_ALEN.
975 * 3 addr: 2 + 2 + 2 + 3*6 = 24
976 * 4 addr: 2 + 2 + 2 + 4*6 = 30
977 */
978static inline u8 *ieee80211_get_qos_ctl(struct ieee80211_hdr *hdr)
979{
980 if (ieee80211_has_a4(hdr->frame_control))
981 return (u8 *)hdr + 30;
982 else
983 return (u8 *)hdr + 24;
984}
985
986/**
543 * ieee80211_get_SA - get pointer to SA 987 * ieee80211_get_SA - get pointer to SA
988 * @hdr: the frame
544 * 989 *
545 * Given an 802.11 frame, this function returns the offset 990 * Given an 802.11 frame, this function returns the offset
546 * to the source address (SA). It does not verify that the 991 * to the source address (SA). It does not verify that the
547 * header is long enough to contain the address, and the 992 * header is long enough to contain the address, and the
548 * header must be long enough to contain the frame control 993 * header must be long enough to contain the frame control
549 * field. 994 * field.
550 *
551 * @hdr: the frame
552 */ 995 */
553static inline u8 *ieee80211_get_SA(struct ieee80211_hdr *hdr) 996static inline u8 *ieee80211_get_SA(struct ieee80211_hdr *hdr)
554{ 997{
555 u8 *raw = (u8 *) hdr; 998 if (ieee80211_has_a4(hdr->frame_control))
556 u8 tofrom = (*(raw+1)) & 3; /* get the TODS and FROMDS bits */ 999 return hdr->addr4;
557 1000 if (ieee80211_has_fromds(hdr->frame_control))
558 switch (tofrom) { 1001 return hdr->addr3;
559 case 2:
560 return hdr->addr3;
561 case 3:
562 return hdr->addr4;
563 }
564 return hdr->addr2; 1002 return hdr->addr2;
565} 1003}
566 1004
567/** 1005/**
568 * ieee80211_get_DA - get pointer to DA 1006 * ieee80211_get_DA - get pointer to DA
1007 * @hdr: the frame
569 * 1008 *
570 * Given an 802.11 frame, this function returns the offset 1009 * Given an 802.11 frame, this function returns the offset
571 * to the destination address (DA). It does not verify that 1010 * to the destination address (DA). It does not verify that
572 * the header is long enough to contain the address, and the 1011 * the header is long enough to contain the address, and the
573 * header must be long enough to contain the frame control 1012 * header must be long enough to contain the frame control
574 * field. 1013 * field.
575 *
576 * @hdr: the frame
577 */ 1014 */
578static inline u8 *ieee80211_get_DA(struct ieee80211_hdr *hdr) 1015static inline u8 *ieee80211_get_DA(struct ieee80211_hdr *hdr)
579{ 1016{
580 u8 *raw = (u8 *) hdr; 1017 if (ieee80211_has_tods(hdr->frame_control))
581 u8 to_ds = (*(raw+1)) & 1; /* get the TODS bit */
582
583 if (to_ds)
584 return hdr->addr3; 1018 return hdr->addr3;
585 return hdr->addr1; 1019 else
586} 1020 return hdr->addr1;
587
588/**
589 * ieee80211_get_morefrag - determine whether the MOREFRAGS bit is set
590 *
591 * This function determines whether the "more fragments" bit is set
592 * in the frame.
593 *
594 * @hdr: the frame
595 */
596static inline int ieee80211_get_morefrag(struct ieee80211_hdr *hdr)
597{
598 return (le16_to_cpu(hdr->frame_control) &
599 IEEE80211_FCTL_MOREFRAGS) != 0;
600} 1021}
601 1022
602#endif /* IEEE80211_H */ 1023#endif /* IEEE80211_H */
diff --git a/include/linux/if_bridge.h b/include/linux/if_bridge.h
index 950e13d09e06..6badb3e2c4e4 100644
--- a/include/linux/if_bridge.h
+++ b/include/linux/if_bridge.h
@@ -4,8 +4,6 @@
4 * Authors: 4 * Authors:
5 * Lennert Buytenhek <buytenh@gnu.org> 5 * Lennert Buytenhek <buytenh@gnu.org>
6 * 6 *
7 * $Id: if_bridge.h,v 1.1 2000/02/18 16:47:01 davem Exp $
8 *
9 * This program is free software; you can redistribute it and/or 7 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License 8 * modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation; either version 9 * as published by the Free Software Foundation; either version
diff --git a/include/linux/if_packet.h b/include/linux/if_packet.h
index ad09609227ff..18db0668065a 100644
--- a/include/linux/if_packet.h
+++ b/include/linux/if_packet.h
@@ -43,6 +43,9 @@ struct sockaddr_ll
43#define PACKET_COPY_THRESH 7 43#define PACKET_COPY_THRESH 7
44#define PACKET_AUXDATA 8 44#define PACKET_AUXDATA 8
45#define PACKET_ORIGDEV 9 45#define PACKET_ORIGDEV 9
46#define PACKET_VERSION 10
47#define PACKET_HDRLEN 11
48#define PACKET_RESERVE 12
46 49
47struct tpacket_stats 50struct tpacket_stats
48{ 51{
@@ -57,6 +60,7 @@ struct tpacket_auxdata
57 __u32 tp_snaplen; 60 __u32 tp_snaplen;
58 __u16 tp_mac; 61 __u16 tp_mac;
59 __u16 tp_net; 62 __u16 tp_net;
63 __u16 tp_vlan_tci;
60}; 64};
61 65
62struct tpacket_hdr 66struct tpacket_hdr
@@ -79,6 +83,26 @@ struct tpacket_hdr
79#define TPACKET_ALIGN(x) (((x)+TPACKET_ALIGNMENT-1)&~(TPACKET_ALIGNMENT-1)) 83#define TPACKET_ALIGN(x) (((x)+TPACKET_ALIGNMENT-1)&~(TPACKET_ALIGNMENT-1))
80#define TPACKET_HDRLEN (TPACKET_ALIGN(sizeof(struct tpacket_hdr)) + sizeof(struct sockaddr_ll)) 84#define TPACKET_HDRLEN (TPACKET_ALIGN(sizeof(struct tpacket_hdr)) + sizeof(struct sockaddr_ll))
81 85
86struct tpacket2_hdr
87{
88 __u32 tp_status;
89 __u32 tp_len;
90 __u32 tp_snaplen;
91 __u16 tp_mac;
92 __u16 tp_net;
93 __u32 tp_sec;
94 __u32 tp_nsec;
95 __u16 tp_vlan_tci;
96};
97
98#define TPACKET2_HDRLEN (TPACKET_ALIGN(sizeof(struct tpacket2_hdr)) + sizeof(struct sockaddr_ll))
99
100enum tpacket_versions
101{
102 TPACKET_V1,
103 TPACKET_V2,
104};
105
82/* 106/*
83 Frame structure: 107 Frame structure:
84 108
diff --git a/include/linux/if_ppp.h b/include/linux/if_ppp.h
index 0f2f70d4e48c..c3b1f8562709 100644
--- a/include/linux/if_ppp.h
+++ b/include/linux/if_ppp.h
@@ -1,5 +1,3 @@
1/* $Id: if_ppp.h,v 1.21 2000/03/27 06:03:36 paulus Exp $ */
2
3/* 1/*
4 * if_ppp.h - Point-to-Point Protocol definitions. 2 * if_ppp.h - Point-to-Point Protocol definitions.
5 * 3 *
diff --git a/include/linux/if_tun.h b/include/linux/if_tun.h
index 8c71fe2fb1f5..4c6307ad9fdb 100644
--- a/include/linux/if_tun.h
+++ b/include/linux/if_tun.h
@@ -11,14 +11,13 @@
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details. 13 * GNU General Public License for more details.
14 *
15 * $Id: if_tun.h,v 1.2 2001/06/01 18:39:47 davem Exp $
16 */ 14 */
17 15
18#ifndef __IF_TUN_H 16#ifndef __IF_TUN_H
19#define __IF_TUN_H 17#define __IF_TUN_H
20 18
21#include <linux/types.h> 19#include <linux/types.h>
20#include <linux/if_ether.h>
22 21
23/* Read queue size */ 22/* Read queue size */
24#define TUN_READQ_SIZE 500 23#define TUN_READQ_SIZE 500
@@ -33,6 +32,7 @@
33#define TUN_NO_PI 0x0040 32#define TUN_NO_PI 0x0040
34#define TUN_ONE_QUEUE 0x0080 33#define TUN_ONE_QUEUE 0x0080
35#define TUN_PERSIST 0x0100 34#define TUN_PERSIST 0x0100
35#define TUN_VNET_HDR 0x0200
36 36
37/* Ioctl defines */ 37/* Ioctl defines */
38#define TUNSETNOCSUM _IOW('T', 200, int) 38#define TUNSETNOCSUM _IOW('T', 200, int)
@@ -42,17 +42,43 @@
42#define TUNSETOWNER _IOW('T', 204, int) 42#define TUNSETOWNER _IOW('T', 204, int)
43#define TUNSETLINK _IOW('T', 205, int) 43#define TUNSETLINK _IOW('T', 205, int)
44#define TUNSETGROUP _IOW('T', 206, int) 44#define TUNSETGROUP _IOW('T', 206, int)
45#define TUNGETFEATURES _IOR('T', 207, unsigned int)
46#define TUNSETOFFLOAD _IOW('T', 208, unsigned int)
47#define TUNSETTXFILTER _IOW('T', 209, unsigned int)
45 48
46/* TUNSETIFF ifr flags */ 49/* TUNSETIFF ifr flags */
47#define IFF_TUN 0x0001 50#define IFF_TUN 0x0001
48#define IFF_TAP 0x0002 51#define IFF_TAP 0x0002
49#define IFF_NO_PI 0x1000 52#define IFF_NO_PI 0x1000
50#define IFF_ONE_QUEUE 0x2000 53#define IFF_ONE_QUEUE 0x2000
54#define IFF_VNET_HDR 0x4000
55
56/* Features for GSO (TUNSETOFFLOAD). */
57#define TUN_F_CSUM 0x01 /* You can hand me unchecksummed packets. */
58#define TUN_F_TSO4 0x02 /* I can handle TSO for IPv4 packets */
59#define TUN_F_TSO6 0x04 /* I can handle TSO for IPv6 packets */
60#define TUN_F_TSO_ECN 0x08 /* I can handle TSO with ECN bits. */
51 61
62/* Protocol info prepended to the packets (when IFF_NO_PI is not set) */
63#define TUN_PKT_STRIP 0x0001
52struct tun_pi { 64struct tun_pi {
53 unsigned short flags; 65 __u16 flags;
54 __be16 proto; 66 __be16 proto;
55}; 67};
56#define TUN_PKT_STRIP 0x0001 68
69/*
70 * Filter spec (used for SETXXFILTER ioctls)
71 * This stuff is applicable only to the TAP (Ethernet) devices.
72 * If the count is zero the filter is disabled and the driver accepts
73 * all packets (promisc mode).
74 * If the filter is enabled in order to accept broadcast packets
75 * broadcast addr must be explicitly included in the addr list.
76 */
77#define TUN_FLT_ALLMULTI 0x0001 /* Accept all multicast packets */
78struct tun_filter {
79 __u16 flags; /* TUN_FLT_ flags see above */
80 __u16 count; /* Number of addresses */
81 __u8 addr[0][ETH_ALEN];
82};
57 83
58#endif /* __IF_TUN_H */ 84#endif /* __IF_TUN_H */
diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h
index 15ace02b7b24..9e7b49b8062d 100644
--- a/include/linux/if_vlan.h
+++ b/include/linux/if_vlan.h
@@ -14,10 +14,6 @@
14#define _LINUX_IF_VLAN_H_ 14#define _LINUX_IF_VLAN_H_
15 15
16#ifdef __KERNEL__ 16#ifdef __KERNEL__
17
18/* externally defined structs */
19struct hlist_node;
20
21#include <linux/netdevice.h> 17#include <linux/netdevice.h>
22#include <linux/etherdevice.h> 18#include <linux/etherdevice.h>
23 19
@@ -91,7 +87,7 @@ struct vlan_group {
91}; 87};
92 88
93static inline struct net_device *vlan_group_get_device(struct vlan_group *vg, 89static inline struct net_device *vlan_group_get_device(struct vlan_group *vg,
94 unsigned int vlan_id) 90 u16 vlan_id)
95{ 91{
96 struct net_device **array; 92 struct net_device **array;
97 array = vg->vlan_devices_arrays[vlan_id / VLAN_GROUP_ARRAY_PART_LEN]; 93 array = vg->vlan_devices_arrays[vlan_id / VLAN_GROUP_ARRAY_PART_LEN];
@@ -99,7 +95,7 @@ static inline struct net_device *vlan_group_get_device(struct vlan_group *vg,
99} 95}
100 96
101static inline void vlan_group_set_device(struct vlan_group *vg, 97static inline void vlan_group_set_device(struct vlan_group *vg,
102 unsigned int vlan_id, 98 u16 vlan_id,
103 struct net_device *dev) 99 struct net_device *dev)
104{ 100{
105 struct net_device **array; 101 struct net_device **array;
@@ -109,164 +105,81 @@ static inline void vlan_group_set_device(struct vlan_group *vg,
109 array[vlan_id % VLAN_GROUP_ARRAY_PART_LEN] = dev; 105 array[vlan_id % VLAN_GROUP_ARRAY_PART_LEN] = dev;
110} 106}
111 107
112struct vlan_priority_tci_mapping { 108#define vlan_tx_tag_present(__skb) ((__skb)->vlan_tci)
113 u32 priority; 109#define vlan_tx_tag_get(__skb) ((__skb)->vlan_tci)
114 unsigned short vlan_qos; /* This should be shifted when first set, so we only do it
115 * at provisioning time.
116 * ((skb->priority << 13) & 0xE000)
117 */
118 struct vlan_priority_tci_mapping *next;
119};
120 110
121/* Holds information that makes sense if this device is a VLAN device. */ 111#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE)
122struct vlan_dev_info { 112extern struct net_device *vlan_dev_real_dev(const struct net_device *dev);
123 /** This will be the mapping that correlates skb->priority to 113extern u16 vlan_dev_vlan_id(const struct net_device *dev);
124 * 3 bits of VLAN QOS tags...
125 */
126 unsigned int nr_ingress_mappings;
127 u32 ingress_priority_map[8];
128
129 unsigned int nr_egress_mappings;
130 struct vlan_priority_tci_mapping *egress_priority_map[16]; /* hash table */
131
132 unsigned short vlan_id; /* The VLAN Identifier for this interface. */
133 unsigned short flags; /* (1 << 0) re_order_header This option will cause the
134 * VLAN code to move around the ethernet header on
135 * ingress to make the skb look **exactly** like it
136 * came in from an ethernet port. This destroys some of
137 * the VLAN information in the skb, but it fixes programs
138 * like DHCP that use packet-filtering and don't understand
139 * 802.1Q
140 */
141 struct net_device *real_dev; /* the underlying device/interface */
142 unsigned char real_dev_addr[ETH_ALEN];
143 struct proc_dir_entry *dent; /* Holds the proc data */
144 unsigned long cnt_inc_headroom_on_tx; /* How many times did we have to grow the skb on TX. */
145 unsigned long cnt_encap_on_xmit; /* How many times did we have to encapsulate the skb on TX. */
146};
147 114
148static inline struct vlan_dev_info *vlan_dev_info(const struct net_device *dev) 115extern int __vlan_hwaccel_rx(struct sk_buff *skb, struct vlan_group *grp,
116 u16 vlan_tci, int polling);
117#else
118static inline struct net_device *vlan_dev_real_dev(const struct net_device *dev)
149{ 119{
150 return netdev_priv(dev); 120 BUG();
121 return NULL;
151} 122}
152 123
153/* inline functions */ 124static inline u16 vlan_dev_vlan_id(const struct net_device *dev)
154static inline __u32 vlan_get_ingress_priority(struct net_device *dev,
155 unsigned short vlan_tag)
156{ 125{
157 struct vlan_dev_info *vip = vlan_dev_info(dev); 126 BUG();
158 127 return 0;
159 return vip->ingress_priority_map[(vlan_tag >> 13) & 0x7];
160} 128}
161 129
162/* VLAN tx hw acceleration helpers. */ 130static inline int __vlan_hwaccel_rx(struct sk_buff *skb, struct vlan_group *grp,
163struct vlan_skb_tx_cookie { 131 u16 vlan_tci, int polling)
164 u32 magic;
165 u32 vlan_tag;
166};
167
168#define VLAN_TX_COOKIE_MAGIC 0x564c414e /* "VLAN" in ascii. */
169#define VLAN_TX_SKB_CB(__skb) ((struct vlan_skb_tx_cookie *)&((__skb)->cb[0]))
170#define vlan_tx_tag_present(__skb) \
171 (VLAN_TX_SKB_CB(__skb)->magic == VLAN_TX_COOKIE_MAGIC)
172#define vlan_tx_tag_get(__skb) (VLAN_TX_SKB_CB(__skb)->vlan_tag)
173
174/* VLAN rx hw acceleration helper. This acts like netif_{rx,receive_skb}(). */
175static inline int __vlan_hwaccel_rx(struct sk_buff *skb,
176 struct vlan_group *grp,
177 unsigned short vlan_tag, int polling)
178{ 132{
179 struct net_device_stats *stats; 133 BUG();
180 134 return NET_XMIT_SUCCESS;
181 if (skb_bond_should_drop(skb)) {
182 dev_kfree_skb_any(skb);
183 return NET_RX_DROP;
184 }
185
186 skb->dev = vlan_group_get_device(grp, vlan_tag & VLAN_VID_MASK);
187 if (skb->dev == NULL) {
188 dev_kfree_skb_any(skb);
189
190 /* Not NET_RX_DROP, this is not being dropped
191 * due to congestion.
192 */
193 return 0;
194 }
195
196 skb->dev->last_rx = jiffies;
197
198 stats = &skb->dev->stats;
199 stats->rx_packets++;
200 stats->rx_bytes += skb->len;
201
202 skb->priority = vlan_get_ingress_priority(skb->dev, vlan_tag);
203 switch (skb->pkt_type) {
204 case PACKET_BROADCAST:
205 break;
206
207 case PACKET_MULTICAST:
208 stats->multicast++;
209 break;
210
211 case PACKET_OTHERHOST:
212 /* Our lower layer thinks this is not local, let's make sure.
213 * This allows the VLAN to have a different MAC than the underlying
214 * device, and still route correctly.
215 */
216 if (!compare_ether_addr(eth_hdr(skb)->h_dest,
217 skb->dev->dev_addr))
218 skb->pkt_type = PACKET_HOST;
219 break;
220 };
221
222 return (polling ? netif_receive_skb(skb) : netif_rx(skb));
223} 135}
136#endif
224 137
138/**
139 * vlan_hwaccel_rx - netif_rx wrapper for VLAN RX acceleration
140 * @skb: buffer
141 * @grp: vlan group
142 * @vlan_tci: VLAN TCI as received from the card
143 */
225static inline int vlan_hwaccel_rx(struct sk_buff *skb, 144static inline int vlan_hwaccel_rx(struct sk_buff *skb,
226 struct vlan_group *grp, 145 struct vlan_group *grp,
227 unsigned short vlan_tag) 146 u16 vlan_tci)
228{ 147{
229 return __vlan_hwaccel_rx(skb, grp, vlan_tag, 0); 148 return __vlan_hwaccel_rx(skb, grp, vlan_tci, 0);
230} 149}
231 150
151/**
152 * vlan_hwaccel_receive_skb - netif_receive_skb wrapper for VLAN RX acceleration
153 * @skb: buffer
154 * @grp: vlan group
155 * @vlan_tci: VLAN TCI as received from the card
156 */
232static inline int vlan_hwaccel_receive_skb(struct sk_buff *skb, 157static inline int vlan_hwaccel_receive_skb(struct sk_buff *skb,
233 struct vlan_group *grp, 158 struct vlan_group *grp,
234 unsigned short vlan_tag) 159 u16 vlan_tci)
235{ 160{
236 return __vlan_hwaccel_rx(skb, grp, vlan_tag, 1); 161 return __vlan_hwaccel_rx(skb, grp, vlan_tci, 1);
237} 162}
238 163
239/** 164/**
240 * __vlan_put_tag - regular VLAN tag inserting 165 * __vlan_put_tag - regular VLAN tag inserting
241 * @skb: skbuff to tag 166 * @skb: skbuff to tag
242 * @tag: VLAN tag to insert 167 * @vlan_tci: VLAN TCI to insert
243 * 168 *
244 * Inserts the VLAN tag into @skb as part of the payload 169 * Inserts the VLAN tag into @skb as part of the payload
245 * Returns a VLAN tagged skb. If a new skb is created, @skb is freed. 170 * Returns a VLAN tagged skb. If a new skb is created, @skb is freed.
246 * 171 *
247 * Following the skb_unshare() example, in case of error, the calling function 172 * Following the skb_unshare() example, in case of error, the calling function
248 * doesn't have to worry about freeing the original skb. 173 * doesn't have to worry about freeing the original skb.
249 */ 174 */
250static inline struct sk_buff *__vlan_put_tag(struct sk_buff *skb, unsigned short tag) 175static inline struct sk_buff *__vlan_put_tag(struct sk_buff *skb, u16 vlan_tci)
251{ 176{
252 struct vlan_ethhdr *veth; 177 struct vlan_ethhdr *veth;
253 178
254 if (skb_headroom(skb) < VLAN_HLEN) { 179 if (skb_cow_head(skb, VLAN_HLEN) < 0) {
255 struct sk_buff *sk_tmp = skb; 180 kfree_skb(skb);
256 skb = skb_realloc_headroom(sk_tmp, VLAN_HLEN); 181 return NULL;
257 kfree_skb(sk_tmp);
258 if (!skb) {
259 printk(KERN_ERR "vlan: failed to realloc headroom\n");
260 return NULL;
261 }
262 } else {
263 skb = skb_unshare(skb, GFP_ATOMIC);
264 if (!skb) {
265 printk(KERN_ERR "vlan: failed to unshare skbuff\n");
266 return NULL;
267 }
268 } 182 }
269
270 veth = (struct vlan_ethhdr *)skb_push(skb, VLAN_HLEN); 183 veth = (struct vlan_ethhdr *)skb_push(skb, VLAN_HLEN);
271 184
272 /* Move the mac addresses to the beginning of the new header. */ 185 /* Move the mac addresses to the beginning of the new header. */
@@ -275,12 +188,10 @@ static inline struct sk_buff *__vlan_put_tag(struct sk_buff *skb, unsigned short
275 /* first, the ethernet type */ 188 /* first, the ethernet type */
276 veth->h_vlan_proto = htons(ETH_P_8021Q); 189 veth->h_vlan_proto = htons(ETH_P_8021Q);
277 190
278 /* now, the tag */ 191 /* now, the TCI */
279 veth->h_vlan_TCI = htons(tag); 192 veth->h_vlan_TCI = htons(vlan_tci);
280 193
281 skb->protocol = htons(ETH_P_8021Q); 194 skb->protocol = htons(ETH_P_8021Q);
282 skb->mac_header -= VLAN_HLEN;
283 skb->network_header -= VLAN_HLEN;
284 195
285 return skb; 196 return skb;
286} 197}
@@ -288,18 +199,14 @@ static inline struct sk_buff *__vlan_put_tag(struct sk_buff *skb, unsigned short
288/** 199/**
289 * __vlan_hwaccel_put_tag - hardware accelerated VLAN inserting 200 * __vlan_hwaccel_put_tag - hardware accelerated VLAN inserting
290 * @skb: skbuff to tag 201 * @skb: skbuff to tag
291 * @tag: VLAN tag to insert 202 * @vlan_tci: VLAN TCI to insert
292 * 203 *
293 * Puts the VLAN tag in @skb->cb[] and lets the device do the rest 204 * Puts the VLAN TCI in @skb->vlan_tci and lets the device do the rest
294 */ 205 */
295static inline struct sk_buff *__vlan_hwaccel_put_tag(struct sk_buff *skb, unsigned short tag) 206static inline struct sk_buff *__vlan_hwaccel_put_tag(struct sk_buff *skb,
207 u16 vlan_tci)
296{ 208{
297 struct vlan_skb_tx_cookie *cookie; 209 skb->vlan_tci = vlan_tci;
298
299 cookie = VLAN_TX_SKB_CB(skb);
300 cookie->magic = VLAN_TX_COOKIE_MAGIC;
301 cookie->vlan_tag = tag;
302
303 return skb; 210 return skb;
304} 211}
305 212
@@ -308,28 +215,28 @@ static inline struct sk_buff *__vlan_hwaccel_put_tag(struct sk_buff *skb, unsign
308/** 215/**
309 * vlan_put_tag - inserts VLAN tag according to device features 216 * vlan_put_tag - inserts VLAN tag according to device features
310 * @skb: skbuff to tag 217 * @skb: skbuff to tag
311 * @tag: VLAN tag to insert 218 * @vlan_tci: VLAN TCI to insert
312 * 219 *
313 * Assumes skb->dev is the target that will xmit this frame. 220 * Assumes skb->dev is the target that will xmit this frame.
314 * Returns a VLAN tagged skb. 221 * Returns a VLAN tagged skb.
315 */ 222 */
316static inline struct sk_buff *vlan_put_tag(struct sk_buff *skb, unsigned short tag) 223static inline struct sk_buff *vlan_put_tag(struct sk_buff *skb, u16 vlan_tci)
317{ 224{
318 if (skb->dev->features & NETIF_F_HW_VLAN_TX) { 225 if (skb->dev->features & NETIF_F_HW_VLAN_TX) {
319 return __vlan_hwaccel_put_tag(skb, tag); 226 return __vlan_hwaccel_put_tag(skb, vlan_tci);
320 } else { 227 } else {
321 return __vlan_put_tag(skb, tag); 228 return __vlan_put_tag(skb, vlan_tci);
322 } 229 }
323} 230}
324 231
325/** 232/**
326 * __vlan_get_tag - get the VLAN ID that is part of the payload 233 * __vlan_get_tag - get the VLAN ID that is part of the payload
327 * @skb: skbuff to query 234 * @skb: skbuff to query
328 * @tag: buffer to store vlaue 235 * @vlan_tci: buffer to store vlaue
329 * 236 *
330 * Returns error if the skb is not of VLAN type 237 * Returns error if the skb is not of VLAN type
331 */ 238 */
332static inline int __vlan_get_tag(const struct sk_buff *skb, unsigned short *tag) 239static inline int __vlan_get_tag(const struct sk_buff *skb, u16 *vlan_tci)
333{ 240{
334 struct vlan_ethhdr *veth = (struct vlan_ethhdr *)skb->data; 241 struct vlan_ethhdr *veth = (struct vlan_ethhdr *)skb->data;
335 242
@@ -337,29 +244,25 @@ static inline int __vlan_get_tag(const struct sk_buff *skb, unsigned short *tag)
337 return -EINVAL; 244 return -EINVAL;
338 } 245 }
339 246
340 *tag = ntohs(veth->h_vlan_TCI); 247 *vlan_tci = ntohs(veth->h_vlan_TCI);
341
342 return 0; 248 return 0;
343} 249}
344 250
345/** 251/**
346 * __vlan_hwaccel_get_tag - get the VLAN ID that is in @skb->cb[] 252 * __vlan_hwaccel_get_tag - get the VLAN ID that is in @skb->cb[]
347 * @skb: skbuff to query 253 * @skb: skbuff to query
348 * @tag: buffer to store vlaue 254 * @vlan_tci: buffer to store vlaue
349 * 255 *
350 * Returns error if @skb->cb[] is not set correctly 256 * Returns error if @skb->vlan_tci is not set correctly
351 */ 257 */
352static inline int __vlan_hwaccel_get_tag(const struct sk_buff *skb, 258static inline int __vlan_hwaccel_get_tag(const struct sk_buff *skb,
353 unsigned short *tag) 259 u16 *vlan_tci)
354{ 260{
355 struct vlan_skb_tx_cookie *cookie; 261 if (vlan_tx_tag_present(skb)) {
356 262 *vlan_tci = skb->vlan_tci;
357 cookie = VLAN_TX_SKB_CB(skb);
358 if (cookie->magic == VLAN_TX_COOKIE_MAGIC) {
359 *tag = cookie->vlan_tag;
360 return 0; 263 return 0;
361 } else { 264 } else {
362 *tag = 0; 265 *vlan_tci = 0;
363 return -EINVAL; 266 return -EINVAL;
364 } 267 }
365} 268}
@@ -369,16 +272,16 @@ static inline int __vlan_hwaccel_get_tag(const struct sk_buff *skb,
369/** 272/**
370 * vlan_get_tag - get the VLAN ID from the skb 273 * vlan_get_tag - get the VLAN ID from the skb
371 * @skb: skbuff to query 274 * @skb: skbuff to query
372 * @tag: buffer to store vlaue 275 * @vlan_tci: buffer to store vlaue
373 * 276 *
374 * Returns error if the skb is not VLAN tagged 277 * Returns error if the skb is not VLAN tagged
375 */ 278 */
376static inline int vlan_get_tag(const struct sk_buff *skb, unsigned short *tag) 279static inline int vlan_get_tag(const struct sk_buff *skb, u16 *vlan_tci)
377{ 280{
378 if (skb->dev->features & NETIF_F_HW_VLAN_TX) { 281 if (skb->dev->features & NETIF_F_HW_VLAN_TX) {
379 return __vlan_hwaccel_get_tag(skb, tag); 282 return __vlan_hwaccel_get_tag(skb, vlan_tci);
380 } else { 283 } else {
381 return __vlan_get_tag(skb, tag); 284 return __vlan_get_tag(skb, vlan_tci);
382 } 285 }
383} 286}
384 287
@@ -402,6 +305,7 @@ enum vlan_ioctl_cmds {
402 305
403enum vlan_flags { 306enum vlan_flags {
404 VLAN_FLAG_REORDER_HDR = 0x1, 307 VLAN_FLAG_REORDER_HDR = 0x1,
308 VLAN_FLAG_GVRP = 0x2,
405}; 309};
406 310
407enum vlan_name_types { 311enum vlan_name_types {
diff --git a/include/linux/igmp.h b/include/linux/igmp.h
index f5a1a0db2e8e..7bb3c095c15b 100644
--- a/include/linux/igmp.h
+++ b/include/linux/igmp.h
@@ -228,7 +228,6 @@ extern int ip_mc_msfget(struct sock *sk, struct ip_msfilter *msf,
228extern int ip_mc_gsfget(struct sock *sk, struct group_filter *gsf, 228extern int ip_mc_gsfget(struct sock *sk, struct group_filter *gsf,
229 struct group_filter __user *optval, int __user *optlen); 229 struct group_filter __user *optval, int __user *optlen);
230extern int ip_mc_sf_allow(struct sock *sk, __be32 local, __be32 rmt, int dif); 230extern int ip_mc_sf_allow(struct sock *sk, __be32 local, __be32 rmt, int dif);
231extern void ip_mr_init(void);
232extern void ip_mc_init_dev(struct in_device *); 231extern void ip_mc_init_dev(struct in_device *);
233extern void ip_mc_destroy_dev(struct in_device *); 232extern void ip_mc_destroy_dev(struct in_device *);
234extern void ip_mc_up(struct in_device *); 233extern void ip_mc_up(struct in_device *);
diff --git a/include/linux/ip6_tunnel.h b/include/linux/ip6_tunnel.h
index af3f4a70f3df..1e7cc4af40de 100644
--- a/include/linux/ip6_tunnel.h
+++ b/include/linux/ip6_tunnel.h
@@ -1,7 +1,3 @@
1/*
2 * $Id$
3 */
4
5#ifndef _IP6_TUNNEL_H 1#ifndef _IP6_TUNNEL_H
6#define _IP6_TUNNEL_H 2#define _IP6_TUNNEL_H
7 3
diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h
index cde056e08181..391ad0843a46 100644
--- a/include/linux/ipv6.h
+++ b/include/linux/ipv6.h
@@ -163,6 +163,8 @@ struct ipv6_devconf {
163#ifdef CONFIG_IPV6_MROUTE 163#ifdef CONFIG_IPV6_MROUTE
164 __s32 mc_forwarding; 164 __s32 mc_forwarding;
165#endif 165#endif
166 __s32 disable_ipv6;
167 __s32 accept_dad;
166 void *sysctl; 168 void *sysctl;
167}; 169};
168 170
@@ -194,6 +196,8 @@ enum {
194 DEVCONF_OPTIMISTIC_DAD, 196 DEVCONF_OPTIMISTIC_DAD,
195 DEVCONF_ACCEPT_SOURCE_ROUTE, 197 DEVCONF_ACCEPT_SOURCE_ROUTE,
196 DEVCONF_MC_FORWARDING, 198 DEVCONF_MC_FORWARDING,
199 DEVCONF_DISABLE_IPV6,
200 DEVCONF_ACCEPT_DAD,
197 DEVCONF_MAX 201 DEVCONF_MAX
198}; 202};
199 203
diff --git a/include/linux/istallion.h b/include/linux/istallion.h
index 5a84fe944b74..0d1840723249 100644
--- a/include/linux/istallion.h
+++ b/include/linux/istallion.h
@@ -51,25 +51,21 @@
51 */ 51 */
52struct stliport { 52struct stliport {
53 unsigned long magic; 53 unsigned long magic;
54 struct tty_port port;
54 unsigned int portnr; 55 unsigned int portnr;
55 unsigned int panelnr; 56 unsigned int panelnr;
56 unsigned int brdnr; 57 unsigned int brdnr;
57 unsigned long state; 58 unsigned long state;
58 unsigned int devnr; 59 unsigned int devnr;
59 int flags;
60 int baud_base; 60 int baud_base;
61 int custom_divisor; 61 int custom_divisor;
62 int close_delay; 62 int close_delay;
63 int closing_wait; 63 int closing_wait;
64 int refcount;
65 int openwaitcnt; 64 int openwaitcnt;
66 int rc; 65 int rc;
67 int argsize; 66 int argsize;
68 void *argp; 67 void *argp;
69 unsigned int rxmarkmsk; 68 unsigned int rxmarkmsk;
70 struct tty_struct *tty;
71 wait_queue_head_t open_wait;
72 wait_queue_head_t close_wait;
73 wait_queue_head_t raw_wait; 69 wait_queue_head_t raw_wait;
74 struct asysigs asig; 70 struct asysigs asig;
75 unsigned long addr; 71 unsigned long addr;
diff --git a/include/linux/kvm.h b/include/linux/kvm.h
index a281afeddfbb..0ea064cbfbc8 100644
--- a/include/linux/kvm.h
+++ b/include/linux/kvm.h
@@ -173,6 +173,30 @@ struct kvm_run {
173 }; 173 };
174}; 174};
175 175
176/* for KVM_REGISTER_COALESCED_MMIO / KVM_UNREGISTER_COALESCED_MMIO */
177
178struct kvm_coalesced_mmio_zone {
179 __u64 addr;
180 __u32 size;
181 __u32 pad;
182};
183
184struct kvm_coalesced_mmio {
185 __u64 phys_addr;
186 __u32 len;
187 __u32 pad;
188 __u8 data[8];
189};
190
191struct kvm_coalesced_mmio_ring {
192 __u32 first, last;
193 struct kvm_coalesced_mmio coalesced_mmio[0];
194};
195
196#define KVM_COALESCED_MMIO_MAX \
197 ((PAGE_SIZE - sizeof(struct kvm_coalesced_mmio_ring)) / \
198 sizeof(struct kvm_coalesced_mmio))
199
176/* for KVM_TRANSLATE */ 200/* for KVM_TRANSLATE */
177struct kvm_translation { 201struct kvm_translation {
178 /* in */ 202 /* in */
@@ -294,14 +318,14 @@ struct kvm_trace_rec {
294 __u32 vcpu_id; 318 __u32 vcpu_id;
295 union { 319 union {
296 struct { 320 struct {
297 __u32 cycle_lo, cycle_hi; 321 __u64 cycle_u64;
298 __u32 extra_u32[KVM_TRC_EXTRA_MAX]; 322 __u32 extra_u32[KVM_TRC_EXTRA_MAX];
299 } cycle; 323 } cycle;
300 struct { 324 struct {
301 __u32 extra_u32[KVM_TRC_EXTRA_MAX]; 325 __u32 extra_u32[KVM_TRC_EXTRA_MAX];
302 } nocycle; 326 } nocycle;
303 } u; 327 } u;
304}; 328} __attribute__((packed));
305 329
306#define KVMIO 0xAE 330#define KVMIO 0xAE
307 331
@@ -346,6 +370,7 @@ struct kvm_trace_rec {
346#define KVM_CAP_NOP_IO_DELAY 12 370#define KVM_CAP_NOP_IO_DELAY 12
347#define KVM_CAP_PV_MMU 13 371#define KVM_CAP_PV_MMU 13
348#define KVM_CAP_MP_STATE 14 372#define KVM_CAP_MP_STATE 14
373#define KVM_CAP_COALESCED_MMIO 15
349 374
350/* 375/*
351 * ioctls for VM fds 376 * ioctls for VM fds
@@ -371,6 +396,10 @@ struct kvm_trace_rec {
371#define KVM_CREATE_PIT _IO(KVMIO, 0x64) 396#define KVM_CREATE_PIT _IO(KVMIO, 0x64)
372#define KVM_GET_PIT _IOWR(KVMIO, 0x65, struct kvm_pit_state) 397#define KVM_GET_PIT _IOWR(KVMIO, 0x65, struct kvm_pit_state)
373#define KVM_SET_PIT _IOR(KVMIO, 0x66, struct kvm_pit_state) 398#define KVM_SET_PIT _IOR(KVMIO, 0x66, struct kvm_pit_state)
399#define KVM_REGISTER_COALESCED_MMIO \
400 _IOW(KVMIO, 0x67, struct kvm_coalesced_mmio_zone)
401#define KVM_UNREGISTER_COALESCED_MMIO \
402 _IOW(KVMIO, 0x68, struct kvm_coalesced_mmio_zone)
374 403
375/* 404/*
376 * ioctls for vcpu fds 405 * ioctls for vcpu fds
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
index de9d1df4bba2..07d68a8ae8e9 100644
--- a/include/linux/kvm_host.h
+++ b/include/linux/kvm_host.h
@@ -52,7 +52,8 @@ struct kvm_io_bus {
52 52
53void kvm_io_bus_init(struct kvm_io_bus *bus); 53void kvm_io_bus_init(struct kvm_io_bus *bus);
54void kvm_io_bus_destroy(struct kvm_io_bus *bus); 54void kvm_io_bus_destroy(struct kvm_io_bus *bus);
55struct kvm_io_device *kvm_io_bus_find_dev(struct kvm_io_bus *bus, gpa_t addr); 55struct kvm_io_device *kvm_io_bus_find_dev(struct kvm_io_bus *bus,
56 gpa_t addr, int len, int is_write);
56void kvm_io_bus_register_dev(struct kvm_io_bus *bus, 57void kvm_io_bus_register_dev(struct kvm_io_bus *bus,
57 struct kvm_io_device *dev); 58 struct kvm_io_device *dev);
58 59
@@ -116,6 +117,10 @@ struct kvm {
116 struct kvm_vm_stat stat; 117 struct kvm_vm_stat stat;
117 struct kvm_arch arch; 118 struct kvm_arch arch;
118 atomic_t users_count; 119 atomic_t users_count;
120#ifdef KVM_COALESCED_MMIO_PAGE_OFFSET
121 struct kvm_coalesced_mmio_dev *coalesced_mmio_dev;
122 struct kvm_coalesced_mmio_ring *coalesced_mmio_ring;
123#endif
119}; 124};
120 125
121/* The guest did something we don't support. */ 126/* The guest did something we don't support. */
@@ -135,9 +140,6 @@ void kvm_vcpu_uninit(struct kvm_vcpu *vcpu);
135void vcpu_load(struct kvm_vcpu *vcpu); 140void vcpu_load(struct kvm_vcpu *vcpu);
136void vcpu_put(struct kvm_vcpu *vcpu); 141void vcpu_put(struct kvm_vcpu *vcpu);
137 142
138void decache_vcpus_on_cpu(int cpu);
139
140
141int kvm_init(void *opaque, unsigned int vcpu_size, 143int kvm_init(void *opaque, unsigned int vcpu_size,
142 struct module *module); 144 struct module *module);
143void kvm_exit(void); 145void kvm_exit(void);
@@ -166,6 +168,7 @@ int kvm_arch_set_memory_region(struct kvm *kvm,
166 struct kvm_userspace_memory_region *mem, 168 struct kvm_userspace_memory_region *mem,
167 struct kvm_memory_slot old, 169 struct kvm_memory_slot old,
168 int user_alloc); 170 int user_alloc);
171void kvm_arch_flush_shadow(struct kvm *kvm);
169gfn_t unalias_gfn(struct kvm *kvm, gfn_t gfn); 172gfn_t unalias_gfn(struct kvm *kvm, gfn_t gfn);
170struct page *gfn_to_page(struct kvm *kvm, gfn_t gfn); 173struct page *gfn_to_page(struct kvm *kvm, gfn_t gfn);
171unsigned long gfn_to_hva(struct kvm *kvm, gfn_t gfn); 174unsigned long gfn_to_hva(struct kvm *kvm, gfn_t gfn);
diff --git a/include/linux/lockd/lockd.h b/include/linux/lockd/lockd.h
index 102d928f7206..dbb87ab282e8 100644
--- a/include/linux/lockd/lockd.h
+++ b/include/linux/lockd/lockd.h
@@ -200,10 +200,12 @@ typedef int (*nlm_host_match_fn_t)(void *cur, struct nlm_host *ref);
200 * Server-side lock handling 200 * Server-side lock handling
201 */ 201 */
202__be32 nlmsvc_lock(struct svc_rqst *, struct nlm_file *, 202__be32 nlmsvc_lock(struct svc_rqst *, struct nlm_file *,
203 struct nlm_lock *, int, struct nlm_cookie *); 203 struct nlm_host *, struct nlm_lock *, int,
204 struct nlm_cookie *);
204__be32 nlmsvc_unlock(struct nlm_file *, struct nlm_lock *); 205__be32 nlmsvc_unlock(struct nlm_file *, struct nlm_lock *);
205__be32 nlmsvc_testlock(struct svc_rqst *, struct nlm_file *, 206__be32 nlmsvc_testlock(struct svc_rqst *, struct nlm_file *,
206 struct nlm_lock *, struct nlm_lock *, struct nlm_cookie *); 207 struct nlm_host *, struct nlm_lock *,
208 struct nlm_lock *, struct nlm_cookie *);
207__be32 nlmsvc_cancel_blocked(struct nlm_file *, struct nlm_lock *); 209__be32 nlmsvc_cancel_blocked(struct nlm_file *, struct nlm_lock *);
208unsigned long nlmsvc_retry_blocked(void); 210unsigned long nlmsvc_retry_blocked(void);
209void nlmsvc_traverse_blocks(struct nlm_host *, struct nlm_file *, 211void nlmsvc_traverse_blocks(struct nlm_host *, struct nlm_file *,
@@ -224,7 +226,7 @@ void nlmsvc_invalidate_all(void);
224 * Cluster failover support 226 * Cluster failover support
225 */ 227 */
226int nlmsvc_unlock_all_by_sb(struct super_block *sb); 228int nlmsvc_unlock_all_by_sb(struct super_block *sb);
227int nlmsvc_unlock_all_by_ip(__be32 server_addr); 229int nlmsvc_unlock_all_by_ip(struct sockaddr *server_addr);
228 230
229static inline struct inode *nlmsvc_file_inode(struct nlm_file *file) 231static inline struct inode *nlmsvc_file_inode(struct nlm_file *file)
230{ 232{
diff --git a/include/linux/mfd/asic3.h b/include/linux/mfd/asic3.h
index 4ab2162db13b..322cd6deb9f0 100644
--- a/include/linux/mfd/asic3.h
+++ b/include/linux/mfd/asic3.h
@@ -8,7 +8,7 @@
8 * published by the Free Software Foundation. 8 * published by the Free Software Foundation.
9 * 9 *
10 * Copyright 2001 Compaq Computer Corporation. 10 * Copyright 2001 Compaq Computer Corporation.
11 * Copyright 2007 OpendHand. 11 * Copyright 2007-2008 OpenedHand Ltd.
12 */ 12 */
13 13
14#ifndef __ASIC3_H__ 14#ifndef __ASIC3_H__
@@ -16,43 +16,22 @@
16 16
17#include <linux/types.h> 17#include <linux/types.h>
18 18
19struct asic3 {
20 void __iomem *mapping;
21 unsigned int bus_shift;
22 unsigned int irq_nr;
23 unsigned int irq_base;
24 spinlock_t lock;
25 u16 irq_bothedge[4];
26 struct device *dev;
27};
28
29struct asic3_platform_data { 19struct asic3_platform_data {
30 struct { 20 u16 *gpio_config;
31 u32 dir; 21 unsigned int gpio_config_num;
32 u32 init;
33 u32 sleep_mask;
34 u32 sleep_out;
35 u32 batt_fault_out;
36 u32 sleep_conf;
37 u32 alt_function;
38 } gpio_a, gpio_b, gpio_c, gpio_d;
39
40 unsigned int bus_shift;
41 22
42 unsigned int irq_base; 23 unsigned int irq_base;
43 24
44 struct platform_device **children; 25 unsigned int gpio_base;
45 unsigned int n_children;
46}; 26};
47 27
48int asic3_gpio_get_value(struct asic3 *asic, unsigned gpio);
49void asic3_gpio_set_value(struct asic3 *asic, unsigned gpio, int val);
50
51#define ASIC3_NUM_GPIO_BANKS 4 28#define ASIC3_NUM_GPIO_BANKS 4
52#define ASIC3_GPIOS_PER_BANK 16 29#define ASIC3_GPIOS_PER_BANK 16
53#define ASIC3_NUM_GPIOS 64 30#define ASIC3_NUM_GPIOS 64
54#define ASIC3_NR_IRQS ASIC3_NUM_GPIOS + 6 31#define ASIC3_NR_IRQS ASIC3_NUM_GPIOS + 6
55 32
33#define ASIC3_TO_GPIO(gpio) (NR_BUILTIN_GPIO + (gpio))
34
56#define ASIC3_GPIO_BANK_A 0 35#define ASIC3_GPIO_BANK_A 0
57#define ASIC3_GPIO_BANK_B 1 36#define ASIC3_GPIO_BANK_B 1
58#define ASIC3_GPIO_BANK_C 2 37#define ASIC3_GPIO_BANK_C 2
@@ -64,32 +43,89 @@ void asic3_gpio_set_value(struct asic3 *asic, unsigned gpio, int val);
64/* All offsets below are specified with this address bus shift */ 43/* All offsets below are specified with this address bus shift */
65#define ASIC3_DEFAULT_ADDR_SHIFT 2 44#define ASIC3_DEFAULT_ADDR_SHIFT 2
66 45
67#define ASIC3_OFFSET(base, reg) (ASIC3_##base##_Base + ASIC3_##base##_##reg) 46#define ASIC3_OFFSET(base, reg) (ASIC3_##base##_BASE + ASIC3_##base##_##reg)
68#define ASIC3_GPIO_OFFSET(base, reg) \ 47#define ASIC3_GPIO_OFFSET(base, reg) \
69 (ASIC3_GPIO_##base##_Base + ASIC3_GPIO_##reg) 48 (ASIC3_GPIO_##base##_BASE + ASIC3_GPIO_##reg)
70 49
71#define ASIC3_GPIO_A_Base 0x0000 50#define ASIC3_GPIO_A_BASE 0x0000
72#define ASIC3_GPIO_B_Base 0x0100 51#define ASIC3_GPIO_B_BASE 0x0100
73#define ASIC3_GPIO_C_Base 0x0200 52#define ASIC3_GPIO_C_BASE 0x0200
74#define ASIC3_GPIO_D_Base 0x0300 53#define ASIC3_GPIO_D_BASE 0x0300
75 54
76#define ASIC3_GPIO_Mask 0x00 /* R/W 0:don't mask */ 55#define ASIC3_GPIO_TO_BANK(gpio) ((gpio) >> 4)
77#define ASIC3_GPIO_Direction 0x04 /* R/W 0:input */ 56#define ASIC3_GPIO_TO_BIT(gpio) ((gpio) - \
78#define ASIC3_GPIO_Out 0x08 /* R/W 0:output low */ 57 (ASIC3_GPIOS_PER_BANK * ((gpio) >> 4)))
79#define ASIC3_GPIO_TriggerType 0x0c /* R/W 0:level */ 58#define ASIC3_GPIO_TO_MASK(gpio) (1 << ASIC3_GPIO_TO_BIT(gpio))
80#define ASIC3_GPIO_EdgeTrigger 0x10 /* R/W 0:falling */ 59#define ASIC3_GPIO_TO_BASE(gpio) (ASIC3_GPIO_A_BASE + (((gpio) >> 4) * 0x0100))
81#define ASIC3_GPIO_LevelTrigger 0x14 /* R/W 0:low level detect */ 60#define ASIC3_BANK_TO_BASE(bank) (ASIC3_GPIO_A_BASE + ((bank) * 0x100))
82#define ASIC3_GPIO_SleepMask 0x18 /* R/W 0:don't mask in sleep mode */ 61
83#define ASIC3_GPIO_SleepOut 0x1c /* R/W level 0:low in sleep mode */ 62#define ASIC3_GPIO_MASK 0x00 /* R/W 0:don't mask */
84#define ASIC3_GPIO_BattFaultOut 0x20 /* R/W level 0:low in batt_fault */ 63#define ASIC3_GPIO_DIRECTION 0x04 /* R/W 0:input */
85#define ASIC3_GPIO_IntStatus 0x24 /* R/W 0:none, 1:detect */ 64#define ASIC3_GPIO_OUT 0x08 /* R/W 0:output low */
86#define ASIC3_GPIO_AltFunction 0x28 /* R/W 1:LED register control */ 65#define ASIC3_GPIO_TRIGGER_TYPE 0x0c /* R/W 0:level */
87#define ASIC3_GPIO_SleepConf 0x2c /* 66#define ASIC3_GPIO_EDGE_TRIGGER 0x10 /* R/W 0:falling */
67#define ASIC3_GPIO_LEVEL_TRIGGER 0x14 /* R/W 0:low level detect */
68#define ASIC3_GPIO_SLEEP_MASK 0x18 /* R/W 0:don't mask in sleep mode */
69#define ASIC3_GPIO_SLEEP_OUT 0x1c /* R/W level 0:low in sleep mode */
70#define ASIC3_GPIO_BAT_FAULT_OUT 0x20 /* R/W level 0:low in batt_fault */
71#define ASIC3_GPIO_INT_STATUS 0x24 /* R/W 0:none, 1:detect */
72#define ASIC3_GPIO_ALT_FUNCTION 0x28 /* R/W 1:LED register control */
73#define ASIC3_GPIO_SLEEP_CONF 0x2c /*
88 * R/W bit 1: autosleep 74 * R/W bit 1: autosleep
89 * 0: disable gposlpout in normal mode, 75 * 0: disable gposlpout in normal mode,
90 * enable gposlpout in sleep mode. 76 * enable gposlpout in sleep mode.
91 */ 77 */
92#define ASIC3_GPIO_Status 0x30 /* R Pin status */ 78#define ASIC3_GPIO_STATUS 0x30 /* R Pin status */
79
80/*
81 * ASIC3 GPIO config
82 *
83 * Bits 0..6 gpio number
84 * Bits 7..13 Alternate function
85 * Bit 14 Direction
86 * Bit 15 Initial value
87 *
88 */
89#define ASIC3_CONFIG_GPIO_PIN(config) ((config) & 0x7f)
90#define ASIC3_CONFIG_GPIO_ALT(config) (((config) & (0x7f << 7)) >> 7)
91#define ASIC3_CONFIG_GPIO_DIR(config) ((config & (1 << 14)) >> 14)
92#define ASIC3_CONFIG_GPIO_INIT(config) ((config & (1 << 15)) >> 15)
93#define ASIC3_CONFIG_GPIO(gpio, alt, dir, init) (((gpio) & 0x7f) \
94 | (((alt) & 0x7f) << 7) | (((dir) & 0x1) << 14) \
95 | (((init) & 0x1) << 15))
96#define ASIC3_CONFIG_GPIO_DEFAULT(gpio, dir, init) \
97 ASIC3_CONFIG_GPIO((gpio), 0, (dir), (init))
98#define ASIC3_CONFIG_GPIO_DEFAULT_OUT(gpio, init) \
99 ASIC3_CONFIG_GPIO((gpio), 0, 1, (init))
100
101/*
102 * Alternate functions
103 */
104#define ASIC3_GPIOA11_PWM0 ASIC3_CONFIG_GPIO(11, 1, 1, 0)
105#define ASIC3_GPIOA12_PWM1 ASIC3_CONFIG_GPIO(12, 1, 1, 0)
106#define ASIC3_GPIOA15_CONTROL_CX ASIC3_CONFIG_GPIO(15, 1, 1, 0)
107#define ASIC3_GPIOC0_LED0 ASIC3_CONFIG_GPIO(32, 1, 1, 0)
108#define ASIC3_GPIOC1_LED1 ASIC3_CONFIG_GPIO(33, 1, 1, 0)
109#define ASIC3_GPIOC2_LED2 ASIC3_CONFIG_GPIO(34, 1, 1, 0)
110#define ASIC3_GPIOC3_SPI_RXD ASIC3_CONFIG_GPIO(35, 1, 0, 0)
111#define ASIC3_GPIOC4_CF_nCD ASIC3_CONFIG_GPIO(36, 1, 0, 0)
112#define ASIC3_GPIOC4_SPI_TXD ASIC3_CONFIG_GPIO(36, 1, 1, 0)
113#define ASIC3_GPIOC5_SPI_CLK ASIC3_CONFIG_GPIO(37, 1, 1, 0)
114#define ASIC3_GPIOC5_nCIOW ASIC3_CONFIG_GPIO(37, 1, 1, 0)
115#define ASIC3_GPIOC6_nCIOR ASIC3_CONFIG_GPIO(38, 1, 1, 0)
116#define ASIC3_GPIOC7_nPCE_1 ASIC3_CONFIG_GPIO(39, 1, 0, 0)
117#define ASIC3_GPIOC8_nPCE_2 ASIC3_CONFIG_GPIO(40, 1, 0, 0)
118#define ASIC3_GPIOC9_nPOE ASIC3_CONFIG_GPIO(41, 1, 0, 0)
119#define ASIC3_GPIOC10_nPWE ASIC3_CONFIG_GPIO(42, 1, 0, 0)
120#define ASIC3_GPIOC11_PSKTSEL ASIC3_CONFIG_GPIO(43, 1, 0, 0)
121#define ASIC3_GPIOC12_nPREG ASIC3_CONFIG_GPIO(44, 1, 0, 0)
122#define ASIC3_GPIOC13_nPWAIT ASIC3_CONFIG_GPIO(45, 1, 1, 0)
123#define ASIC3_GPIOC14_nPIOIS16 ASIC3_CONFIG_GPIO(46, 1, 1, 0)
124#define ASIC3_GPIOC15_nPIOR ASIC3_CONFIG_GPIO(47, 1, 0, 0)
125#define ASIC3_GPIOD11_nCIOIS16 ASIC3_CONFIG_GPIO(59, 1, 0, 0)
126#define ASIC3_GPIOD12_nCWAIT ASIC3_CONFIG_GPIO(60, 1, 0, 0)
127#define ASIC3_GPIOD15_nPIOW ASIC3_CONFIG_GPIO(63, 1, 0, 0)
128
93 129
94#define ASIC3_SPI_Base 0x0400 130#define ASIC3_SPI_Base 0x0400
95#define ASIC3_SPI_Control 0x0000 131#define ASIC3_SPI_Control 0x0000
@@ -128,7 +164,7 @@ void asic3_gpio_set_value(struct asic3 *asic, unsigned gpio, int val);
128#define LED_AUTOSTOP (1 << 5) /* LED ON/OFF auto stop 0:disable, 1:enable */ 164#define LED_AUTOSTOP (1 << 5) /* LED ON/OFF auto stop 0:disable, 1:enable */
129#define LED_ALWAYS (1 << 6) /* LED Interrupt Mask 0:No mask, 1:mask */ 165#define LED_ALWAYS (1 << 6) /* LED Interrupt Mask 0:No mask, 1:mask */
130 166
131#define ASIC3_CLOCK_Base 0x0A00 167#define ASIC3_CLOCK_BASE 0x0A00
132#define ASIC3_CLOCK_CDEX 0x00 168#define ASIC3_CLOCK_CDEX 0x00
133#define ASIC3_CLOCK_SEL 0x04 169#define ASIC3_CLOCK_SEL 0x04
134 170
@@ -159,12 +195,12 @@ void asic3_gpio_set_value(struct asic3 *asic, unsigned gpio, int val);
159#define CLOCK_SEL_CX (1 << 2) 195#define CLOCK_SEL_CX (1 << 2)
160 196
161 197
162#define ASIC3_INTR_Base 0x0B00 198#define ASIC3_INTR_BASE 0x0B00
163 199
164#define ASIC3_INTR_IntMask 0x00 /* Interrupt mask control */ 200#define ASIC3_INTR_INT_MASK 0x00 /* Interrupt mask control */
165#define ASIC3_INTR_PIntStat 0x04 /* Peripheral interrupt status */ 201#define ASIC3_INTR_P_INT_STAT 0x04 /* Peripheral interrupt status */
166#define ASIC3_INTR_IntCPS 0x08 /* Interrupt timer clock pre-scale */ 202#define ASIC3_INTR_INT_CPS 0x08 /* Interrupt timer clock pre-scale */
167#define ASIC3_INTR_IntTBS 0x0c /* Interrupt timer set */ 203#define ASIC3_INTR_INT_TBS 0x0c /* Interrupt timer set */
168 204
169#define ASIC3_INTMASK_GINTMASK (1 << 0) /* Global INTs mask 1:enable */ 205#define ASIC3_INTMASK_GINTMASK (1 << 0) /* Global INTs mask 1:enable */
170#define ASIC3_INTMASK_GINTEL (1 << 1) /* 1: rising edge, 0: hi level */ 206#define ASIC3_INTMASK_GINTEL (1 << 1) /* 1: rising edge, 0: hi level */
@@ -227,44 +263,12 @@ void asic3_gpio_set_value(struct asic3 *asic, unsigned gpio, int val);
227#define ASIC3_EXTCF_CF_SLEEP (1 << 15) /* CF sleep mode control */ 263#define ASIC3_EXTCF_CF_SLEEP (1 << 15) /* CF sleep mode control */
228 264
229/********************************************* 265/*********************************************
230 * The Onewire interface registers 266 * The Onewire interface (DS1WM) is handled
231 * 267 * by the ds1wm driver.
232 * OWM_CMD
233 * OWM_DAT
234 * OWM_INTR
235 * OWM_INTEN
236 * OWM_CLKDIV
237 * 268 *
238 *********************************************/ 269 *********************************************/
239 270
240#define ASIC3_OWM_Base 0xC00 271#define ASIC3_OWM_BASE 0xC00
241
242#define ASIC3_OWM_CMD 0x00
243#define ASIC3_OWM_DAT 0x04
244#define ASIC3_OWM_INTR 0x08
245#define ASIC3_OWM_INTEN 0x0C
246#define ASIC3_OWM_CLKDIV 0x10
247
248#define ASIC3_OWM_CMD_ONEWR (1 << 0)
249#define ASIC3_OWM_CMD_SRA (1 << 1)
250#define ASIC3_OWM_CMD_DQO (1 << 2)
251#define ASIC3_OWM_CMD_DQI (1 << 3)
252
253#define ASIC3_OWM_INTR_PD (1 << 0)
254#define ASIC3_OWM_INTR_PDR (1 << 1)
255#define ASIC3_OWM_INTR_TBE (1 << 2)
256#define ASIC3_OWM_INTR_TEMP (1 << 3)
257#define ASIC3_OWM_INTR_RBF (1 << 4)
258
259#define ASIC3_OWM_INTEN_EPD (1 << 0)
260#define ASIC3_OWM_INTEN_IAS (1 << 1)
261#define ASIC3_OWM_INTEN_ETBE (1 << 2)
262#define ASIC3_OWM_INTEN_ETMT (1 << 3)
263#define ASIC3_OWM_INTEN_ERBF (1 << 4)
264
265#define ASIC3_OWM_CLKDIV_PRE (3 << 0) /* two bits wide at bit 0 */
266#define ASIC3_OWM_CLKDIV_DIV (7 << 2) /* 3 bits wide at bit 2 */
267
268 272
269/***************************************************************************** 273/*****************************************************************************
270 * The SD configuration registers are at a completely different location 274 * The SD configuration registers are at a completely different location
@@ -492,6 +496,7 @@ void asic3_gpio_set_value(struct asic3 *asic, unsigned gpio, int val);
492#define ASIC3_SDIO_CTRL_LEDCtrl 0x7C 496#define ASIC3_SDIO_CTRL_LEDCtrl 0x7C
493#define ASIC3_SDIO_CTRL_SoftwareReset 0x1C0 497#define ASIC3_SDIO_CTRL_SoftwareReset 0x1C0
494 498
495#define ASIC3_MAP_SIZE 0x2000 499#define ASIC3_MAP_SIZE_32BIT 0x2000
500#define ASIC3_MAP_SIZE_16BIT 0x1000
496 501
497#endif /* __ASIC3_H__ */ 502#endif /* __ASIC3_H__ */
diff --git a/include/linux/mroute.h b/include/linux/mroute.h
index de4decfa1bfc..07112ee9293a 100644
--- a/include/linux/mroute.h
+++ b/include/linux/mroute.h
@@ -144,11 +144,37 @@ static inline int ip_mroute_opt(int opt)
144} 144}
145#endif 145#endif
146 146
147#ifdef CONFIG_IP_MROUTE
147extern int ip_mroute_setsockopt(struct sock *, int, char __user *, int); 148extern int ip_mroute_setsockopt(struct sock *, int, char __user *, int);
148extern int ip_mroute_getsockopt(struct sock *, int, char __user *, int __user *); 149extern int ip_mroute_getsockopt(struct sock *, int, char __user *, int __user *);
149extern int ipmr_ioctl(struct sock *sk, int cmd, void __user *arg); 150extern int ipmr_ioctl(struct sock *sk, int cmd, void __user *arg);
150extern void ip_mr_init(void); 151extern int ip_mr_init(void);
152#else
153static inline
154int ip_mroute_setsockopt(struct sock *sock,
155 int optname, char __user *optval, int optlen)
156{
157 return -ENOPROTOOPT;
158}
159
160static inline
161int ip_mroute_getsockopt(struct sock *sock,
162 int optname, char __user *optval, int __user *optlen)
163{
164 return -ENOPROTOOPT;
165}
151 166
167static inline
168int ipmr_ioctl(struct sock *sk, int cmd, void __user *arg)
169{
170 return -ENOIOCTLCMD;
171}
172
173static inline int ip_mr_init(void)
174{
175 return 0;
176}
177#endif
152 178
153struct vif_device 179struct vif_device
154{ 180{
diff --git a/include/linux/mroute6.h b/include/linux/mroute6.h
index e7989593142b..5cf50473a10f 100644
--- a/include/linux/mroute6.h
+++ b/include/linux/mroute6.h
@@ -131,11 +131,44 @@ static inline int ip6_mroute_opt(int opt)
131 131
132struct sock; 132struct sock;
133 133
134#ifdef CONFIG_IPV6_MROUTE
134extern int ip6_mroute_setsockopt(struct sock *, int, char __user *, int); 135extern 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_mroute_getsockopt(struct sock *, int, char __user *, int __user *);
136extern int ip6_mr_input(struct sk_buff *skb); 137extern int ip6_mr_input(struct sk_buff *skb);
137extern int ip6mr_ioctl(struct sock *sk, int cmd, void __user *arg); 138extern int ip6mr_ioctl(struct sock *sk, int cmd, void __user *arg);
138extern void ip6_mr_init(void); 139extern int ip6_mr_init(void);
140extern void ip6_mr_cleanup(void);
141#else
142static inline
143int ip6_mroute_setsockopt(struct sock *sock,
144 int optname, char __user *optval, int optlen)
145{
146 return -ENOPROTOOPT;
147}
148
149static inline
150int ip6_mroute_getsockopt(struct sock *sock,
151 int optname, char __user *optval, int __user *optlen)
152{
153 return -ENOPROTOOPT;
154}
155
156static inline
157int ip6mr_ioctl(struct sock *sk, int cmd, void __user *arg)
158{
159 return -ENOIOCTLCMD;
160}
161
162static inline int ip6_mr_init(void)
163{
164 return 0;
165}
166
167static inline void ip6_mr_cleanup(void)
168{
169 return;
170}
171#endif
139 172
140struct mif_device 173struct mif_device
141{ 174{
diff --git a/include/linux/mv643xx_eth.h b/include/linux/mv643xx_eth.h
index a15cdd4a8e58..12078577aef6 100644
--- a/include/linux/mv643xx_eth.h
+++ b/include/linux/mv643xx_eth.h
@@ -17,30 +17,59 @@
17 17
18struct mv643xx_eth_shared_platform_data { 18struct mv643xx_eth_shared_platform_data {
19 struct mbus_dram_target_info *dram; 19 struct mbus_dram_target_info *dram;
20 unsigned int t_clk; 20 unsigned int t_clk;
21}; 21};
22 22
23struct mv643xx_eth_platform_data { 23struct mv643xx_eth_platform_data {
24 /*
25 * Pointer back to our parent instance, and our port number.
26 */
24 struct platform_device *shared; 27 struct platform_device *shared;
25 int port_number; 28 int port_number;
26 29
30 /*
31 * Whether a PHY is present, and if yes, at which address.
32 */
27 struct platform_device *shared_smi; 33 struct platform_device *shared_smi;
34 int force_phy_addr;
35 int phy_addr;
28 36
29 u16 force_phy_addr; /* force override if phy_addr == 0 */ 37 /*
30 u16 phy_addr; 38 * Use this MAC address if it is valid, overriding the
31 39 * address that is already in the hardware.
32 /* If speed is 0, then speed and duplex are autonegotiated. */ 40 */
33 int speed; /* 0, SPEED_10, SPEED_100, SPEED_1000 */ 41 u8 mac_addr[6];
34 int duplex; /* DUPLEX_HALF or DUPLEX_FULL */ 42
35 43 /*
36 /* non-zero values of the following fields override defaults */ 44 * If speed is 0, autonegotiation is enabled.
37 u32 tx_queue_size; 45 * Valid values for speed: 0, SPEED_10, SPEED_100, SPEED_1000.
38 u32 rx_queue_size; 46 * Valid values for duplex: DUPLEX_HALF, DUPLEX_FULL.
39 u32 tx_sram_addr; 47 */
40 u32 tx_sram_size; 48 int speed;
41 u32 rx_sram_addr; 49 int duplex;
42 u32 rx_sram_size; 50
43 u8 mac_addr[6]; /* mac address if non-zero*/ 51 /*
52 * Which RX/TX queues to use.
53 */
54 int rx_queue_mask;
55 int tx_queue_mask;
56
57 /*
58 * Override default RX/TX queue sizes if nonzero.
59 */
60 int rx_queue_size;
61 int tx_queue_size;
62
63 /*
64 * Use on-chip SRAM for RX/TX descriptors if size is nonzero
65 * and sufficient to contain all descriptors for the requested
66 * ring sizes.
67 */
68 unsigned long rx_sram_addr;
69 int rx_sram_size;
70 unsigned long tx_sram_addr;
71 int tx_sram_size;
44}; 72};
45 73
46#endif /* __LINUX_MV643XX_ETH_H */ 74
75#endif
diff --git a/include/linux/net.h b/include/linux/net.h
index 71f7dd559285..150a48c68d52 100644
--- a/include/linux/net.h
+++ b/include/linux/net.h
@@ -106,23 +106,23 @@ enum sock_shutdown_cmd {
106/** 106/**
107 * struct socket - general BSD socket 107 * struct socket - general BSD socket
108 * @state: socket state (%SS_CONNECTED, etc) 108 * @state: socket state (%SS_CONNECTED, etc)
109 * @type: socket type (%SOCK_STREAM, etc)
109 * @flags: socket flags (%SOCK_ASYNC_NOSPACE, etc) 110 * @flags: socket flags (%SOCK_ASYNC_NOSPACE, etc)
110 * @ops: protocol specific socket operations 111 * @ops: protocol specific socket operations
111 * @fasync_list: Asynchronous wake up list 112 * @fasync_list: Asynchronous wake up list
112 * @file: File back pointer for gc 113 * @file: File back pointer for gc
113 * @sk: internal networking protocol agnostic socket representation 114 * @sk: internal networking protocol agnostic socket representation
114 * @wait: wait queue for several uses 115 * @wait: wait queue for several uses
115 * @type: socket type (%SOCK_STREAM, etc)
116 */ 116 */
117struct socket { 117struct socket {
118 socket_state state; 118 socket_state state;
119 short type;
119 unsigned long flags; 120 unsigned long flags;
120 const struct proto_ops *ops; 121 const struct proto_ops *ops;
121 struct fasync_struct *fasync_list; 122 struct fasync_struct *fasync_list;
122 struct file *file; 123 struct file *file;
123 struct sock *sk; 124 struct sock *sk;
124 wait_queue_head_t wait; 125 wait_queue_head_t wait;
125 short type;
126}; 126};
127 127
128struct vm_area_struct; 128struct vm_area_struct;
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 25f87102ab66..812bcd8b4363 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -118,14 +118,6 @@ struct wireless_dev;
118 118
119#endif /* __KERNEL__ */ 119#endif /* __KERNEL__ */
120 120
121struct net_device_subqueue
122{
123 /* Give a control state for each queue. This struct may contain
124 * per-queue locks in the future.
125 */
126 unsigned long state;
127};
128
129/* 121/*
130 * Network device statistics. Akin to the 2.0 ether stats but 122 * Network device statistics. Akin to the 2.0 ether stats but
131 * with byte counters. 123 * with byte counters.
@@ -281,14 +273,11 @@ struct header_ops {
281 273
282enum netdev_state_t 274enum netdev_state_t
283{ 275{
284 __LINK_STATE_XOFF=0,
285 __LINK_STATE_START, 276 __LINK_STATE_START,
286 __LINK_STATE_PRESENT, 277 __LINK_STATE_PRESENT,
287 __LINK_STATE_SCHED,
288 __LINK_STATE_NOCARRIER, 278 __LINK_STATE_NOCARRIER,
289 __LINK_STATE_LINKWATCH_PENDING, 279 __LINK_STATE_LINKWATCH_PENDING,
290 __LINK_STATE_DORMANT, 280 __LINK_STATE_DORMANT,
291 __LINK_STATE_QDISC_RUNNING,
292}; 281};
293 282
294 283
@@ -448,6 +437,20 @@ static inline void napi_synchronize(const struct napi_struct *n)
448# define napi_synchronize(n) barrier() 437# define napi_synchronize(n) barrier()
449#endif 438#endif
450 439
440enum netdev_queue_state_t
441{
442 __QUEUE_STATE_XOFF,
443};
444
445struct netdev_queue {
446 struct net_device *dev;
447 struct Qdisc *qdisc;
448 unsigned long state;
449 spinlock_t _xmit_lock;
450 int xmit_lock_owner;
451 struct Qdisc *qdisc_sleeping;
452} ____cacheline_aligned_in_smp;
453
451/* 454/*
452 * The DEVICE structure. 455 * The DEVICE structure.
453 * Actually, this whole structure is a big mistake. It mixes I/O 456 * Actually, this whole structure is a big mistake. It mixes I/O
@@ -516,7 +519,6 @@ struct net_device
516#define NETIF_F_LLTX 4096 /* LockLess TX - deprecated. Please */ 519#define NETIF_F_LLTX 4096 /* LockLess TX - deprecated. Please */
517 /* do not use LLTX in new drivers */ 520 /* do not use LLTX in new drivers */
518#define NETIF_F_NETNS_LOCAL 8192 /* Does not change network namespaces */ 521#define NETIF_F_NETNS_LOCAL 8192 /* Does not change network namespaces */
519#define NETIF_F_MULTI_QUEUE 16384 /* Has multiple TX/RX queues */
520#define NETIF_F_LRO 32768 /* large receive offload */ 522#define NETIF_F_LRO 32768 /* large receive offload */
521 523
522 /* Segmentation offload features */ 524 /* Segmentation offload features */
@@ -537,8 +539,6 @@ struct net_device
537#define NETIF_F_V6_CSUM (NETIF_F_GEN_CSUM | NETIF_F_IPV6_CSUM) 539#define NETIF_F_V6_CSUM (NETIF_F_GEN_CSUM | NETIF_F_IPV6_CSUM)
538#define NETIF_F_ALL_CSUM (NETIF_F_V4_CSUM | NETIF_F_V6_CSUM) 540#define NETIF_F_ALL_CSUM (NETIF_F_V4_CSUM | NETIF_F_V6_CSUM)
539 541
540 struct net_device *next_sched;
541
542 /* Interface index. Unique device identifier */ 542 /* Interface index. Unique device identifier */
543 int ifindex; 543 int ifindex;
544 int iflink; 544 int iflink;
@@ -594,13 +594,14 @@ struct net_device
594 unsigned char addr_len; /* hardware address length */ 594 unsigned char addr_len; /* hardware address length */
595 unsigned short dev_id; /* for shared network cards */ 595 unsigned short dev_id; /* for shared network cards */
596 596
597 spinlock_t addr_list_lock;
597 struct dev_addr_list *uc_list; /* Secondary unicast mac addresses */ 598 struct dev_addr_list *uc_list; /* Secondary unicast mac addresses */
598 int uc_count; /* Number of installed ucasts */ 599 int uc_count; /* Number of installed ucasts */
599 int uc_promisc; 600 int uc_promisc;
600 struct dev_addr_list *mc_list; /* Multicast mac addresses */ 601 struct dev_addr_list *mc_list; /* Multicast mac addresses */
601 int mc_count; /* Number of installed mcasts */ 602 int mc_count; /* Number of installed mcasts */
602 int promiscuity; 603 unsigned int promiscuity;
603 int allmulti; 604 unsigned int allmulti;
604 605
605 606
606 /* Protocol specific pointers */ 607 /* Protocol specific pointers */
@@ -624,32 +625,21 @@ struct net_device
624 625
625 unsigned char broadcast[MAX_ADDR_LEN]; /* hw bcast add */ 626 unsigned char broadcast[MAX_ADDR_LEN]; /* hw bcast add */
626 627
627 /* ingress path synchronizer */ 628 struct netdev_queue rx_queue;
628 spinlock_t ingress_lock;
629 struct Qdisc *qdisc_ingress;
630 629
631/* 630 struct netdev_queue *_tx ____cacheline_aligned_in_smp;
632 * Cache line mostly used on queue transmit path (qdisc)
633 */
634 /* device queue lock */
635 spinlock_t queue_lock ____cacheline_aligned_in_smp;
636 struct Qdisc *qdisc;
637 struct Qdisc *qdisc_sleeping;
638 struct list_head qdisc_list;
639 unsigned long tx_queue_len; /* Max frames per queue allowed */
640 631
641 /* Partially transmitted GSO packet. */ 632 /* Number of TX queues allocated at alloc_netdev_mq() time */
642 struct sk_buff *gso_skb; 633 unsigned int num_tx_queues;
634
635 /* Number of TX queues currently active in device */
636 unsigned int real_num_tx_queues;
637
638 unsigned long tx_queue_len; /* Max frames per queue allowed */
643 639
644/* 640/*
645 * One part is mostly used on xmit path (device) 641 * One part is mostly used on xmit path (device)
646 */ 642 */
647 /* hard_start_xmit synchronizer */
648 spinlock_t _xmit_lock ____cacheline_aligned_in_smp;
649 /* cpu id of processor entered to hard_start_xmit or -1,
650 if nobody entered there.
651 */
652 int xmit_lock_owner;
653 void *priv; /* pointer to private data */ 643 void *priv; /* pointer to private data */
654 int (*hard_start_xmit) (struct sk_buff *skb, 644 int (*hard_start_xmit) (struct sk_buff *skb,
655 struct net_device *dev); 645 struct net_device *dev);
@@ -728,6 +718,9 @@ struct net_device
728 void (*poll_controller)(struct net_device *dev); 718 void (*poll_controller)(struct net_device *dev);
729#endif 719#endif
730 720
721 u16 (*select_queue)(struct net_device *dev,
722 struct sk_buff *skb);
723
731#ifdef CONFIG_NET_NS 724#ifdef CONFIG_NET_NS
732 /* Network namespace this network device is inside */ 725 /* Network namespace this network device is inside */
733 struct net *nd_net; 726 struct net *nd_net;
@@ -740,6 +733,8 @@ struct net_device
740 struct net_bridge_port *br_port; 733 struct net_bridge_port *br_port;
741 /* macvlan */ 734 /* macvlan */
742 struct macvlan_port *macvlan_port; 735 struct macvlan_port *macvlan_port;
736 /* GARP */
737 struct garp_port *garp_port;
743 738
744 /* class/net/name entry */ 739 /* class/net/name entry */
745 struct device dev; 740 struct device dev;
@@ -755,16 +750,31 @@ struct net_device
755 /* for setting kernel sock attribute on TCP connection setup */ 750 /* for setting kernel sock attribute on TCP connection setup */
756#define GSO_MAX_SIZE 65536 751#define GSO_MAX_SIZE 65536
757 unsigned int gso_max_size; 752 unsigned int gso_max_size;
758
759 /* The TX queue control structures */
760 unsigned int egress_subqueue_count;
761 struct net_device_subqueue egress_subqueue[1];
762}; 753};
763#define to_net_dev(d) container_of(d, struct net_device, dev) 754#define to_net_dev(d) container_of(d, struct net_device, dev)
764 755
765#define NETDEV_ALIGN 32 756#define NETDEV_ALIGN 32
766#define NETDEV_ALIGN_CONST (NETDEV_ALIGN - 1) 757#define NETDEV_ALIGN_CONST (NETDEV_ALIGN - 1)
767 758
759static inline
760struct netdev_queue *netdev_get_tx_queue(const struct net_device *dev,
761 unsigned int index)
762{
763 return &dev->_tx[index];
764}
765
766static inline void netdev_for_each_tx_queue(struct net_device *dev,
767 void (*f)(struct net_device *,
768 struct netdev_queue *,
769 void *),
770 void *arg)
771{
772 unsigned int i;
773
774 for (i = 0; i < dev->num_tx_queues; i++)
775 f(dev, &dev->_tx[i], arg);
776}
777
768/* 778/*
769 * Net namespace inlines 779 * Net namespace inlines
770 */ 780 */
@@ -795,7 +805,9 @@ void dev_net_set(struct net_device *dev, struct net *net)
795 */ 805 */
796static inline void *netdev_priv(const struct net_device *dev) 806static inline void *netdev_priv(const struct net_device *dev)
797{ 807{
798 return dev->priv; 808 return (char *)dev + ((sizeof(struct net_device)
809 + NETDEV_ALIGN_CONST)
810 & ~NETDEV_ALIGN_CONST);
799} 811}
800 812
801/* Set the sysfs physical device reference for the network logical device 813/* Set the sysfs physical device reference for the network logical device
@@ -830,6 +842,19 @@ static inline void netif_napi_add(struct net_device *dev,
830 set_bit(NAPI_STATE_SCHED, &napi->state); 842 set_bit(NAPI_STATE_SCHED, &napi->state);
831} 843}
832 844
845/**
846 * netif_napi_del - remove a napi context
847 * @napi: napi context
848 *
849 * netif_napi_del() removes a napi context from the network device napi list
850 */
851static inline void netif_napi_del(struct napi_struct *napi)
852{
853#ifdef CONFIG_NETPOLL
854 list_del(&napi->dev_list);
855#endif
856}
857
833struct packet_type { 858struct packet_type {
834 __be16 type; /* This is really htons(ether_type). */ 859 __be16 type; /* This is really htons(ether_type). */
835 struct net_device *dev; /* NULL is wildcarded here */ 860 struct net_device *dev; /* NULL is wildcarded here */
@@ -890,6 +915,7 @@ extern struct net_device *__dev_get_by_name(struct net *net, const char *name);
890extern int dev_alloc_name(struct net_device *dev, const char *name); 915extern int dev_alloc_name(struct net_device *dev, const char *name);
891extern int dev_open(struct net_device *dev); 916extern int dev_open(struct net_device *dev);
892extern int dev_close(struct net_device *dev); 917extern int dev_close(struct net_device *dev);
918extern void dev_disable_lro(struct net_device *dev);
893extern int dev_queue_xmit(struct sk_buff *skb); 919extern int dev_queue_xmit(struct sk_buff *skb);
894extern int register_netdevice(struct net_device *dev); 920extern int register_netdevice(struct net_device *dev);
895extern void unregister_netdevice(struct net_device *dev); 921extern void unregister_netdevice(struct net_device *dev);
@@ -939,7 +965,7 @@ static inline int unregister_gifconf(unsigned int family)
939 */ 965 */
940struct softnet_data 966struct softnet_data
941{ 967{
942 struct net_device *output_queue; 968 struct Qdisc *output_queue;
943 struct sk_buff_head input_pkt_queue; 969 struct sk_buff_head input_pkt_queue;
944 struct list_head poll_list; 970 struct list_head poll_list;
945 struct sk_buff *completion_queue; 971 struct sk_buff *completion_queue;
@@ -954,12 +980,20 @@ DECLARE_PER_CPU(struct softnet_data,softnet_data);
954 980
955#define HAVE_NETIF_QUEUE 981#define HAVE_NETIF_QUEUE
956 982
957extern void __netif_schedule(struct net_device *dev); 983extern void __netif_schedule(struct Qdisc *q);
958 984
959static inline void netif_schedule(struct net_device *dev) 985static inline void netif_schedule_queue(struct netdev_queue *txq)
960{ 986{
961 if (!test_bit(__LINK_STATE_XOFF, &dev->state)) 987 if (!test_bit(__QUEUE_STATE_XOFF, &txq->state))
962 __netif_schedule(dev); 988 __netif_schedule(txq->qdisc);
989}
990
991static inline void netif_tx_schedule_all(struct net_device *dev)
992{
993 unsigned int i;
994
995 for (i = 0; i < dev->num_tx_queues; i++)
996 netif_schedule_queue(netdev_get_tx_queue(dev, i));
963} 997}
964 998
965/** 999/**
@@ -968,9 +1002,24 @@ static inline void netif_schedule(struct net_device *dev)
968 * 1002 *
969 * Allow upper layers to call the device hard_start_xmit routine. 1003 * Allow upper layers to call the device hard_start_xmit routine.
970 */ 1004 */
1005static inline void netif_tx_start_queue(struct netdev_queue *dev_queue)
1006{
1007 clear_bit(__QUEUE_STATE_XOFF, &dev_queue->state);
1008}
1009
971static inline void netif_start_queue(struct net_device *dev) 1010static inline void netif_start_queue(struct net_device *dev)
972{ 1011{
973 clear_bit(__LINK_STATE_XOFF, &dev->state); 1012 netif_tx_start_queue(netdev_get_tx_queue(dev, 0));
1013}
1014
1015static inline void netif_tx_start_all_queues(struct net_device *dev)
1016{
1017 unsigned int i;
1018
1019 for (i = 0; i < dev->num_tx_queues; i++) {
1020 struct netdev_queue *txq = netdev_get_tx_queue(dev, i);
1021 netif_tx_start_queue(txq);
1022 }
974} 1023}
975 1024
976/** 1025/**
@@ -980,16 +1029,31 @@ static inline void netif_start_queue(struct net_device *dev)
980 * Allow upper layers to call the device hard_start_xmit routine. 1029 * Allow upper layers to call the device hard_start_xmit routine.
981 * Used for flow control when transmit resources are available. 1030 * Used for flow control when transmit resources are available.
982 */ 1031 */
983static inline void netif_wake_queue(struct net_device *dev) 1032static inline void netif_tx_wake_queue(struct netdev_queue *dev_queue)
984{ 1033{
985#ifdef CONFIG_NETPOLL_TRAP 1034#ifdef CONFIG_NETPOLL_TRAP
986 if (netpoll_trap()) { 1035 if (netpoll_trap()) {
987 clear_bit(__LINK_STATE_XOFF, &dev->state); 1036 clear_bit(__QUEUE_STATE_XOFF, &dev_queue->state);
988 return; 1037 return;
989 } 1038 }
990#endif 1039#endif
991 if (test_and_clear_bit(__LINK_STATE_XOFF, &dev->state)) 1040 if (test_and_clear_bit(__QUEUE_STATE_XOFF, &dev_queue->state))
992 __netif_schedule(dev); 1041 __netif_schedule(dev_queue->qdisc);
1042}
1043
1044static inline void netif_wake_queue(struct net_device *dev)
1045{
1046 netif_tx_wake_queue(netdev_get_tx_queue(dev, 0));
1047}
1048
1049static inline void netif_tx_wake_all_queues(struct net_device *dev)
1050{
1051 unsigned int i;
1052
1053 for (i = 0; i < dev->num_tx_queues; i++) {
1054 struct netdev_queue *txq = netdev_get_tx_queue(dev, i);
1055 netif_tx_wake_queue(txq);
1056 }
993} 1057}
994 1058
995/** 1059/**
@@ -999,9 +1063,24 @@ static inline void netif_wake_queue(struct net_device *dev)
999 * Stop upper layers calling the device hard_start_xmit routine. 1063 * Stop upper layers calling the device hard_start_xmit routine.
1000 * Used for flow control when transmit resources are unavailable. 1064 * Used for flow control when transmit resources are unavailable.
1001 */ 1065 */
1066static inline void netif_tx_stop_queue(struct netdev_queue *dev_queue)
1067{
1068 set_bit(__QUEUE_STATE_XOFF, &dev_queue->state);
1069}
1070
1002static inline void netif_stop_queue(struct net_device *dev) 1071static inline void netif_stop_queue(struct net_device *dev)
1003{ 1072{
1004 set_bit(__LINK_STATE_XOFF, &dev->state); 1073 netif_tx_stop_queue(netdev_get_tx_queue(dev, 0));
1074}
1075
1076static inline void netif_tx_stop_all_queues(struct net_device *dev)
1077{
1078 unsigned int i;
1079
1080 for (i = 0; i < dev->num_tx_queues; i++) {
1081 struct netdev_queue *txq = netdev_get_tx_queue(dev, i);
1082 netif_tx_stop_queue(txq);
1083 }
1005} 1084}
1006 1085
1007/** 1086/**
@@ -1010,9 +1089,14 @@ static inline void netif_stop_queue(struct net_device *dev)
1010 * 1089 *
1011 * Test if transmit queue on device is currently unable to send. 1090 * Test if transmit queue on device is currently unable to send.
1012 */ 1091 */
1092static inline int netif_tx_queue_stopped(const struct netdev_queue *dev_queue)
1093{
1094 return test_bit(__QUEUE_STATE_XOFF, &dev_queue->state);
1095}
1096
1013static inline int netif_queue_stopped(const struct net_device *dev) 1097static inline int netif_queue_stopped(const struct net_device *dev)
1014{ 1098{
1015 return test_bit(__LINK_STATE_XOFF, &dev->state); 1099 return netif_tx_queue_stopped(netdev_get_tx_queue(dev, 0));
1016} 1100}
1017 1101
1018/** 1102/**
@@ -1042,9 +1126,8 @@ static inline int netif_running(const struct net_device *dev)
1042 */ 1126 */
1043static inline void netif_start_subqueue(struct net_device *dev, u16 queue_index) 1127static inline void netif_start_subqueue(struct net_device *dev, u16 queue_index)
1044{ 1128{
1045#ifdef CONFIG_NETDEVICES_MULTIQUEUE 1129 struct netdev_queue *txq = netdev_get_tx_queue(dev, queue_index);
1046 clear_bit(__LINK_STATE_XOFF, &dev->egress_subqueue[queue_index].state); 1130 clear_bit(__QUEUE_STATE_XOFF, &txq->state);
1047#endif
1048} 1131}
1049 1132
1050/** 1133/**
@@ -1056,13 +1139,12 @@ static inline void netif_start_subqueue(struct net_device *dev, u16 queue_index)
1056 */ 1139 */
1057static inline void netif_stop_subqueue(struct net_device *dev, u16 queue_index) 1140static inline void netif_stop_subqueue(struct net_device *dev, u16 queue_index)
1058{ 1141{
1059#ifdef CONFIG_NETDEVICES_MULTIQUEUE 1142 struct netdev_queue *txq = netdev_get_tx_queue(dev, queue_index);
1060#ifdef CONFIG_NETPOLL_TRAP 1143#ifdef CONFIG_NETPOLL_TRAP
1061 if (netpoll_trap()) 1144 if (netpoll_trap())
1062 return; 1145 return;
1063#endif 1146#endif
1064 set_bit(__LINK_STATE_XOFF, &dev->egress_subqueue[queue_index].state); 1147 set_bit(__QUEUE_STATE_XOFF, &txq->state);
1065#endif
1066} 1148}
1067 1149
1068/** 1150/**
@@ -1075,12 +1157,8 @@ static inline void netif_stop_subqueue(struct net_device *dev, u16 queue_index)
1075static inline int __netif_subqueue_stopped(const struct net_device *dev, 1157static inline int __netif_subqueue_stopped(const struct net_device *dev,
1076 u16 queue_index) 1158 u16 queue_index)
1077{ 1159{
1078#ifdef CONFIG_NETDEVICES_MULTIQUEUE 1160 struct netdev_queue *txq = netdev_get_tx_queue(dev, queue_index);
1079 return test_bit(__LINK_STATE_XOFF, 1161 return test_bit(__QUEUE_STATE_XOFF, &txq->state);
1080 &dev->egress_subqueue[queue_index].state);
1081#else
1082 return 0;
1083#endif
1084} 1162}
1085 1163
1086static inline int netif_subqueue_stopped(const struct net_device *dev, 1164static inline int netif_subqueue_stopped(const struct net_device *dev,
@@ -1098,15 +1176,13 @@ static inline int netif_subqueue_stopped(const struct net_device *dev,
1098 */ 1176 */
1099static inline void netif_wake_subqueue(struct net_device *dev, u16 queue_index) 1177static inline void netif_wake_subqueue(struct net_device *dev, u16 queue_index)
1100{ 1178{
1101#ifdef CONFIG_NETDEVICES_MULTIQUEUE 1179 struct netdev_queue *txq = netdev_get_tx_queue(dev, queue_index);
1102#ifdef CONFIG_NETPOLL_TRAP 1180#ifdef CONFIG_NETPOLL_TRAP
1103 if (netpoll_trap()) 1181 if (netpoll_trap())
1104 return; 1182 return;
1105#endif 1183#endif
1106 if (test_and_clear_bit(__LINK_STATE_XOFF, 1184 if (test_and_clear_bit(__QUEUE_STATE_XOFF, &txq->state))
1107 &dev->egress_subqueue[queue_index].state)) 1185 __netif_schedule(txq->qdisc);
1108 __netif_schedule(dev);
1109#endif
1110} 1186}
1111 1187
1112/** 1188/**
@@ -1114,15 +1190,10 @@ static inline void netif_wake_subqueue(struct net_device *dev, u16 queue_index)
1114 * @dev: network device 1190 * @dev: network device
1115 * 1191 *
1116 * Check if device has multiple transmit queues 1192 * Check if device has multiple transmit queues
1117 * Always falls if NETDEVICE_MULTIQUEUE is not configured
1118 */ 1193 */
1119static inline int netif_is_multiqueue(const struct net_device *dev) 1194static inline int netif_is_multiqueue(const struct net_device *dev)
1120{ 1195{
1121#ifdef CONFIG_NETDEVICES_MULTIQUEUE 1196 return (dev->num_tx_queues > 1);
1122 return (!!(NETIF_F_MULTI_QUEUE & dev->features));
1123#else
1124 return 0;
1125#endif
1126} 1197}
1127 1198
1128/* Use this variant when it is known for sure that it 1199/* Use this variant when it is known for sure that it
@@ -1142,6 +1213,7 @@ extern int netif_rx(struct sk_buff *skb);
1142extern int netif_rx_ni(struct sk_buff *skb); 1213extern int netif_rx_ni(struct sk_buff *skb);
1143#define HAVE_NETIF_RECEIVE_SKB 1 1214#define HAVE_NETIF_RECEIVE_SKB 1
1144extern int netif_receive_skb(struct sk_buff *skb); 1215extern int netif_receive_skb(struct sk_buff *skb);
1216extern void netif_nit_deliver(struct sk_buff *skb);
1145extern int dev_valid_name(const char *name); 1217extern int dev_valid_name(const char *name);
1146extern int dev_ioctl(struct net *net, unsigned int cmd, void __user *); 1218extern int dev_ioctl(struct net *net, unsigned int cmd, void __user *);
1147extern int dev_ethtool(struct net *net, struct ifreq *); 1219extern int dev_ethtool(struct net *net, struct ifreq *);
@@ -1154,7 +1226,8 @@ extern int dev_set_mtu(struct net_device *, int);
1154extern int dev_set_mac_address(struct net_device *, 1226extern int dev_set_mac_address(struct net_device *,
1155 struct sockaddr *); 1227 struct sockaddr *);
1156extern int dev_hard_start_xmit(struct sk_buff *skb, 1228extern int dev_hard_start_xmit(struct sk_buff *skb,
1157 struct net_device *dev); 1229 struct net_device *dev,
1230 struct netdev_queue *txq);
1158 1231
1159extern int netdev_budget; 1232extern int netdev_budget;
1160 1233
@@ -1397,62 +1470,121 @@ static inline void netif_rx_complete(struct net_device *dev,
1397 * 1470 *
1398 * Get network device transmit lock 1471 * Get network device transmit lock
1399 */ 1472 */
1400static inline void __netif_tx_lock(struct net_device *dev, int cpu) 1473static inline void __netif_tx_lock(struct netdev_queue *txq, int cpu)
1401{ 1474{
1402 spin_lock(&dev->_xmit_lock); 1475 spin_lock(&txq->_xmit_lock);
1403 dev->xmit_lock_owner = cpu; 1476 txq->xmit_lock_owner = cpu;
1477}
1478
1479static inline void __netif_tx_lock_bh(struct netdev_queue *txq)
1480{
1481 spin_lock_bh(&txq->_xmit_lock);
1482 txq->xmit_lock_owner = smp_processor_id();
1404} 1483}
1405 1484
1406static inline void netif_tx_lock(struct net_device *dev) 1485static inline void netif_tx_lock(struct net_device *dev)
1407{ 1486{
1408 __netif_tx_lock(dev, smp_processor_id()); 1487 int cpu = smp_processor_id();
1488 unsigned int i;
1489
1490 for (i = 0; i < dev->num_tx_queues; i++) {
1491 struct netdev_queue *txq = netdev_get_tx_queue(dev, i);
1492 __netif_tx_lock(txq, cpu);
1493 }
1409} 1494}
1410 1495
1411static inline void netif_tx_lock_bh(struct net_device *dev) 1496static inline void netif_tx_lock_bh(struct net_device *dev)
1412{ 1497{
1413 spin_lock_bh(&dev->_xmit_lock); 1498 local_bh_disable();
1414 dev->xmit_lock_owner = smp_processor_id(); 1499 netif_tx_lock(dev);
1415} 1500}
1416 1501
1417static inline int netif_tx_trylock(struct net_device *dev) 1502static inline int __netif_tx_trylock(struct netdev_queue *txq)
1418{ 1503{
1419 int ok = spin_trylock(&dev->_xmit_lock); 1504 int ok = spin_trylock(&txq->_xmit_lock);
1420 if (likely(ok)) 1505 if (likely(ok))
1421 dev->xmit_lock_owner = smp_processor_id(); 1506 txq->xmit_lock_owner = smp_processor_id();
1422 return ok; 1507 return ok;
1423} 1508}
1424 1509
1510static inline int netif_tx_trylock(struct net_device *dev)
1511{
1512 return __netif_tx_trylock(netdev_get_tx_queue(dev, 0));
1513}
1514
1515static inline void __netif_tx_unlock(struct netdev_queue *txq)
1516{
1517 txq->xmit_lock_owner = -1;
1518 spin_unlock(&txq->_xmit_lock);
1519}
1520
1521static inline void __netif_tx_unlock_bh(struct netdev_queue *txq)
1522{
1523 txq->xmit_lock_owner = -1;
1524 spin_unlock_bh(&txq->_xmit_lock);
1525}
1526
1425static inline void netif_tx_unlock(struct net_device *dev) 1527static inline void netif_tx_unlock(struct net_device *dev)
1426{ 1528{
1427 dev->xmit_lock_owner = -1; 1529 unsigned int i;
1428 spin_unlock(&dev->_xmit_lock); 1530
1531 for (i = 0; i < dev->num_tx_queues; i++) {
1532 struct netdev_queue *txq = netdev_get_tx_queue(dev, i);
1533 __netif_tx_unlock(txq);
1534 }
1535
1429} 1536}
1430 1537
1431static inline void netif_tx_unlock_bh(struct net_device *dev) 1538static inline void netif_tx_unlock_bh(struct net_device *dev)
1432{ 1539{
1433 dev->xmit_lock_owner = -1; 1540 netif_tx_unlock(dev);
1434 spin_unlock_bh(&dev->_xmit_lock); 1541 local_bh_enable();
1435} 1542}
1436 1543
1437#define HARD_TX_LOCK(dev, cpu) { \ 1544#define HARD_TX_LOCK(dev, txq, cpu) { \
1438 if ((dev->features & NETIF_F_LLTX) == 0) { \ 1545 if ((dev->features & NETIF_F_LLTX) == 0) { \
1439 __netif_tx_lock(dev, cpu); \ 1546 __netif_tx_lock(txq, cpu); \
1440 } \ 1547 } \
1441} 1548}
1442 1549
1443#define HARD_TX_UNLOCK(dev) { \ 1550#define HARD_TX_UNLOCK(dev, txq) { \
1444 if ((dev->features & NETIF_F_LLTX) == 0) { \ 1551 if ((dev->features & NETIF_F_LLTX) == 0) { \
1445 netif_tx_unlock(dev); \ 1552 __netif_tx_unlock(txq); \
1446 } \ 1553 } \
1447} 1554}
1448 1555
1449static inline void netif_tx_disable(struct net_device *dev) 1556static inline void netif_tx_disable(struct net_device *dev)
1450{ 1557{
1558 unsigned int i;
1559
1451 netif_tx_lock_bh(dev); 1560 netif_tx_lock_bh(dev);
1452 netif_stop_queue(dev); 1561 for (i = 0; i < dev->num_tx_queues; i++) {
1562 struct netdev_queue *txq = netdev_get_tx_queue(dev, i);
1563 netif_tx_stop_queue(txq);
1564 }
1453 netif_tx_unlock_bh(dev); 1565 netif_tx_unlock_bh(dev);
1454} 1566}
1455 1567
1568static inline void netif_addr_lock(struct net_device *dev)
1569{
1570 spin_lock(&dev->addr_list_lock);
1571}
1572
1573static inline void netif_addr_lock_bh(struct net_device *dev)
1574{
1575 spin_lock_bh(&dev->addr_list_lock);
1576}
1577
1578static inline void netif_addr_unlock(struct net_device *dev)
1579{
1580 spin_unlock(&dev->addr_list_lock);
1581}
1582
1583static inline void netif_addr_unlock_bh(struct net_device *dev)
1584{
1585 spin_unlock_bh(&dev->addr_list_lock);
1586}
1587
1456/* These functions live elsewhere (drivers/net/net_init.c, but related) */ 1588/* These functions live elsewhere (drivers/net/net_init.c, but related) */
1457 1589
1458extern void ether_setup(struct net_device *dev); 1590extern void ether_setup(struct net_device *dev);
@@ -1480,9 +1612,10 @@ extern int __dev_addr_delete(struct dev_addr_list **list, int *count, void *ad
1480extern int __dev_addr_add(struct dev_addr_list **list, int *count, void *addr, int alen, int newonly); 1612extern int __dev_addr_add(struct dev_addr_list **list, int *count, void *addr, int alen, int newonly);
1481extern int __dev_addr_sync(struct dev_addr_list **to, int *to_count, struct dev_addr_list **from, int *from_count); 1613extern int __dev_addr_sync(struct dev_addr_list **to, int *to_count, struct dev_addr_list **from, int *from_count);
1482extern void __dev_addr_unsync(struct dev_addr_list **to, int *to_count, struct dev_addr_list **from, int *from_count); 1614extern void __dev_addr_unsync(struct dev_addr_list **to, int *to_count, struct dev_addr_list **from, int *from_count);
1483extern void dev_set_promiscuity(struct net_device *dev, int inc); 1615extern int dev_set_promiscuity(struct net_device *dev, int inc);
1484extern void dev_set_allmulti(struct net_device *dev, int inc); 1616extern int dev_set_allmulti(struct net_device *dev, int inc);
1485extern void netdev_state_change(struct net_device *dev); 1617extern void netdev_state_change(struct net_device *dev);
1618extern void netdev_bonding_change(struct net_device *dev);
1486extern void netdev_features_change(struct net_device *dev); 1619extern void netdev_features_change(struct net_device *dev);
1487/* Load a device via the kmod */ 1620/* Load a device via the kmod */
1488extern void dev_load(struct net *net, const char *name); 1621extern void dev_load(struct net *net, const char *name);
@@ -1509,6 +1642,9 @@ extern void *dev_seq_next(struct seq_file *seq, void *v, loff_t *pos);
1509extern void dev_seq_stop(struct seq_file *seq, void *v); 1642extern void dev_seq_stop(struct seq_file *seq, void *v);
1510#endif 1643#endif
1511 1644
1645extern int netdev_class_create_file(struct class_attribute *class_attr);
1646extern void netdev_class_remove_file(struct class_attribute *class_attr);
1647
1512extern void linkwatch_run_queue(void); 1648extern void linkwatch_run_queue(void);
1513 1649
1514extern int netdev_compute_features(unsigned long all, unsigned long one); 1650extern int netdev_compute_features(unsigned long all, unsigned long one);
diff --git a/include/linux/netfilter/nfnetlink_conntrack.h b/include/linux/netfilter/nfnetlink_conntrack.h
index 0a383ac083cb..759bc043dc65 100644
--- a/include/linux/netfilter/nfnetlink_conntrack.h
+++ b/include/linux/netfilter/nfnetlink_conntrack.h
@@ -81,6 +81,7 @@ enum 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_DCCP,
84 CTA_PROTOINFO_SCTP,
84 __CTA_PROTOINFO_MAX 85 __CTA_PROTOINFO_MAX
85}; 86};
86#define CTA_PROTOINFO_MAX (__CTA_PROTOINFO_MAX - 1) 87#define CTA_PROTOINFO_MAX (__CTA_PROTOINFO_MAX - 1)
@@ -103,6 +104,15 @@ enum ctattr_protoinfo_dccp {
103}; 104};
104#define CTA_PROTOINFO_DCCP_MAX (__CTA_PROTOINFO_DCCP_MAX - 1) 105#define CTA_PROTOINFO_DCCP_MAX (__CTA_PROTOINFO_DCCP_MAX - 1)
105 106
107enum ctattr_protoinfo_sctp {
108 CTA_PROTOINFO_SCTP_UNSPEC,
109 CTA_PROTOINFO_SCTP_STATE,
110 CTA_PROTOINFO_SCTP_VTAG_ORIGINAL,
111 CTA_PROTOINFO_SCTP_VTAG_REPLY,
112 __CTA_PROTOINFO_SCTP_MAX
113};
114#define CTA_PROTOINFO_SCTP_MAX (__CTA_PROTOINFO_SCTP_MAX - 1)
115
106enum ctattr_counters { 116enum ctattr_counters {
107 CTA_COUNTERS_UNSPEC, 117 CTA_COUNTERS_UNSPEC,
108 CTA_COUNTERS_PACKETS, /* old 64bit counters */ 118 CTA_COUNTERS_PACKETS, /* old 64bit counters */
diff --git a/include/linux/netfilter/xt_string.h b/include/linux/netfilter/xt_string.h
index bb21dd1aee2d..8a6ba7bbef9f 100644
--- a/include/linux/netfilter/xt_string.h
+++ b/include/linux/netfilter/xt_string.h
@@ -4,6 +4,11 @@
4#define XT_STRING_MAX_PATTERN_SIZE 128 4#define XT_STRING_MAX_PATTERN_SIZE 128
5#define XT_STRING_MAX_ALGO_NAME_SIZE 16 5#define XT_STRING_MAX_ALGO_NAME_SIZE 16
6 6
7enum {
8 XT_STRING_FLAG_INVERT = 0x01,
9 XT_STRING_FLAG_IGNORECASE = 0x02
10};
11
7struct xt_string_info 12struct xt_string_info
8{ 13{
9 u_int16_t from_offset; 14 u_int16_t from_offset;
@@ -11,7 +16,15 @@ struct xt_string_info
11 char algo[XT_STRING_MAX_ALGO_NAME_SIZE]; 16 char algo[XT_STRING_MAX_ALGO_NAME_SIZE];
12 char pattern[XT_STRING_MAX_PATTERN_SIZE]; 17 char pattern[XT_STRING_MAX_PATTERN_SIZE];
13 u_int8_t patlen; 18 u_int8_t patlen;
14 u_int8_t invert; 19 union {
20 struct {
21 u_int8_t invert;
22 } v0;
23
24 struct {
25 u_int8_t flags;
26 } v1;
27 } u;
15 28
16 /* Used internally by the kernel */ 29 /* Used internally by the kernel */
17 struct ts_config __attribute__((aligned(8))) *config; 30 struct ts_config __attribute__((aligned(8))) *config;
diff --git a/include/linux/netfilter_bridge/ebt_ip6.h b/include/linux/netfilter_bridge/ebt_ip6.h
new file mode 100644
index 000000000000..2273c3ae33ca
--- /dev/null
+++ b/include/linux/netfilter_bridge/ebt_ip6.h
@@ -0,0 +1,40 @@
1/*
2 * ebt_ip6
3 *
4 * Authors:
5 * Kuo-Lang Tseng <kuo-lang.tseng@intel.com>
6 * Manohar Castelino <manohar.r.castelino@intel.com>
7 *
8 * Jan 11, 2008
9 *
10 */
11
12#ifndef __LINUX_BRIDGE_EBT_IP6_H
13#define __LINUX_BRIDGE_EBT_IP6_H
14
15#define EBT_IP6_SOURCE 0x01
16#define EBT_IP6_DEST 0x02
17#define EBT_IP6_TCLASS 0x04
18#define EBT_IP6_PROTO 0x08
19#define EBT_IP6_SPORT 0x10
20#define EBT_IP6_DPORT 0x20
21#define EBT_IP6_MASK (EBT_IP6_SOURCE | EBT_IP6_DEST | EBT_IP6_TCLASS |\
22 EBT_IP6_PROTO | EBT_IP6_SPORT | EBT_IP6_DPORT)
23#define EBT_IP6_MATCH "ip6"
24
25/* the same values are used for the invflags */
26struct ebt_ip6_info
27{
28 struct in6_addr saddr;
29 struct in6_addr daddr;
30 struct in6_addr smsk;
31 struct in6_addr dmsk;
32 uint8_t tclass;
33 uint8_t protocol;
34 uint8_t bitmask;
35 uint8_t invflags;
36 uint16_t sport[2];
37 uint16_t dport[2];
38};
39
40#endif
diff --git a/include/linux/netfilter_bridge/ebt_log.h b/include/linux/netfilter_bridge/ebt_log.h
index 96e231ae7554..b76e653157e5 100644
--- a/include/linux/netfilter_bridge/ebt_log.h
+++ b/include/linux/netfilter_bridge/ebt_log.h
@@ -4,7 +4,8 @@
4#define EBT_LOG_IP 0x01 /* if the frame is made by ip, log the ip information */ 4#define EBT_LOG_IP 0x01 /* if the frame is made by ip, log the ip information */
5#define EBT_LOG_ARP 0x02 5#define EBT_LOG_ARP 0x02
6#define EBT_LOG_NFLOG 0x04 6#define EBT_LOG_NFLOG 0x04
7#define EBT_LOG_MASK (EBT_LOG_IP | EBT_LOG_ARP) 7#define EBT_LOG_IP6 0x08
8#define EBT_LOG_MASK (EBT_LOG_IP | EBT_LOG_ARP | EBT_LOG_IP6)
8#define EBT_LOG_PREFIX_SIZE 30 9#define EBT_LOG_PREFIX_SIZE 30
9#define EBT_LOG_WATCHER "log" 10#define EBT_LOG_WATCHER "log"
10 11
diff --git a/include/linux/netfilter_ipv4.h b/include/linux/netfilter_ipv4.h
index 650318b0c405..29c7727ff0e8 100644
--- a/include/linux/netfilter_ipv4.h
+++ b/include/linux/netfilter_ipv4.h
@@ -60,6 +60,7 @@ enum nf_ip_hook_priorities {
60 NF_IP_PRI_MANGLE = -150, 60 NF_IP_PRI_MANGLE = -150,
61 NF_IP_PRI_NAT_DST = -100, 61 NF_IP_PRI_NAT_DST = -100,
62 NF_IP_PRI_FILTER = 0, 62 NF_IP_PRI_FILTER = 0,
63 NF_IP_PRI_SECURITY = 50,
63 NF_IP_PRI_NAT_SRC = 100, 64 NF_IP_PRI_NAT_SRC = 100,
64 NF_IP_PRI_SELINUX_LAST = 225, 65 NF_IP_PRI_SELINUX_LAST = 225,
65 NF_IP_PRI_CONNTRACK_CONFIRM = INT_MAX, 66 NF_IP_PRI_CONNTRACK_CONFIRM = INT_MAX,
diff --git a/include/linux/netfilter_ipv6.h b/include/linux/netfilter_ipv6.h
index 3475a65dae9b..d654873aa25a 100644
--- a/include/linux/netfilter_ipv6.h
+++ b/include/linux/netfilter_ipv6.h
@@ -64,11 +64,14 @@ enum nf_ip6_hook_priorities {
64 NF_IP6_PRI_MANGLE = -150, 64 NF_IP6_PRI_MANGLE = -150,
65 NF_IP6_PRI_NAT_DST = -100, 65 NF_IP6_PRI_NAT_DST = -100,
66 NF_IP6_PRI_FILTER = 0, 66 NF_IP6_PRI_FILTER = 0,
67 NF_IP6_PRI_SECURITY = 50,
67 NF_IP6_PRI_NAT_SRC = 100, 68 NF_IP6_PRI_NAT_SRC = 100,
68 NF_IP6_PRI_SELINUX_LAST = 225, 69 NF_IP6_PRI_SELINUX_LAST = 225,
69 NF_IP6_PRI_LAST = INT_MAX, 70 NF_IP6_PRI_LAST = INT_MAX,
70}; 71};
71 72
73#ifdef __KERNEL__
74
72#ifdef CONFIG_NETFILTER 75#ifdef CONFIG_NETFILTER
73extern int ip6_route_me_harder(struct sk_buff *skb); 76extern int ip6_route_me_harder(struct sk_buff *skb);
74extern __sum16 nf_ip6_checksum(struct sk_buff *skb, unsigned int hook, 77extern __sum16 nf_ip6_checksum(struct sk_buff *skb, unsigned int hook,
@@ -81,4 +84,6 @@ static inline int ipv6_netfilter_init(void) { return 0; }
81static inline void ipv6_netfilter_fini(void) { return; } 84static inline void ipv6_netfilter_fini(void) { return; }
82#endif /* CONFIG_NETFILTER */ 85#endif /* CONFIG_NETFILTER */
83 86
87#endif /* __KERNEL__ */
88
84#endif /*__LINUX_IP6_NETFILTER_H*/ 89#endif /*__LINUX_IP6_NETFILTER_H*/
diff --git a/include/linux/netlink.h b/include/linux/netlink.h
index bec1062a25a1..9ff1b54908f3 100644
--- a/include/linux/netlink.h
+++ b/include/linux/netlink.h
@@ -193,7 +193,7 @@ extern int netlink_unregister_notifier(struct notifier_block *nb);
193 193
194/* finegrained unicast helpers: */ 194/* finegrained unicast helpers: */
195struct sock *netlink_getsockbyfilp(struct file *filp); 195struct sock *netlink_getsockbyfilp(struct file *filp);
196int netlink_attachskb(struct sock *sk, struct sk_buff *skb, int nonblock, 196int netlink_attachskb(struct sock *sk, struct sk_buff *skb,
197 long *timeo, struct sock *ssk); 197 long *timeo, struct sock *ssk);
198void netlink_detachskb(struct sock *sk, struct sk_buff *skb); 198void netlink_detachskb(struct sock *sk, struct sk_buff *skb);
199int netlink_sendskb(struct sock *sk, struct sk_buff *skb); 199int netlink_sendskb(struct sock *sk, struct sk_buff *skb);
diff --git a/include/linux/nfs4.h b/include/linux/nfs4.h
index 8726491de154..ea0366769484 100644
--- a/include/linux/nfs4.h
+++ b/include/linux/nfs4.h
@@ -65,9 +65,6 @@
65#define NFS4_ACE_SUCCESSFUL_ACCESS_ACE_FLAG 0x00000010 65#define NFS4_ACE_SUCCESSFUL_ACCESS_ACE_FLAG 0x00000010
66#define NFS4_ACE_FAILED_ACCESS_ACE_FLAG 0x00000020 66#define NFS4_ACE_FAILED_ACCESS_ACE_FLAG 0x00000020
67#define NFS4_ACE_IDENTIFIER_GROUP 0x00000040 67#define NFS4_ACE_IDENTIFIER_GROUP 0x00000040
68#define NFS4_ACE_OWNER 0x00000080
69#define NFS4_ACE_GROUP 0x00000100
70#define NFS4_ACE_EVERYONE 0x00000200
71 68
72#define NFS4_ACE_READ_DATA 0x00000001 69#define NFS4_ACE_READ_DATA 0x00000001
73#define NFS4_ACE_LIST_DIRECTORY 0x00000001 70#define NFS4_ACE_LIST_DIRECTORY 0x00000001
diff --git a/include/linux/nfsd/nfsd.h b/include/linux/nfsd/nfsd.h
index 41d30c9c9de6..a2861d95ecc3 100644
--- a/include/linux/nfsd/nfsd.h
+++ b/include/linux/nfsd/nfsd.h
@@ -28,20 +28,20 @@
28#define NFSD_SUPPORTED_MINOR_VERSION 0 28#define NFSD_SUPPORTED_MINOR_VERSION 0
29 29
30/* 30/*
31 * Special flags for nfsd_permission. These must be different from MAY_READ, 31 * Flags for nfsd_permission
32 * MAY_WRITE, and MAY_EXEC.
33 */ 32 */
34#define MAY_NOP 0 33#define NFSD_MAY_NOP 0
35#define MAY_SATTR 8 34#define NFSD_MAY_EXEC 1 /* == MAY_EXEC */
36#define MAY_TRUNC 16 35#define NFSD_MAY_WRITE 2 /* == MAY_WRITE */
37#define MAY_LOCK 32 36#define NFSD_MAY_READ 4 /* == MAY_READ */
38#define MAY_OWNER_OVERRIDE 64 37#define NFSD_MAY_SATTR 8
39#define MAY_LOCAL_ACCESS 128 /* IRIX doing local access check on device special file*/ 38#define NFSD_MAY_TRUNC 16
40#if (MAY_SATTR | MAY_TRUNC | MAY_LOCK | MAY_OWNER_OVERRIDE | MAY_LOCAL_ACCESS) & (MAY_READ | MAY_WRITE | MAY_EXEC) 39#define NFSD_MAY_LOCK 32
41# error "please use a different value for MAY_SATTR or MAY_TRUNC or MAY_LOCK or MAY_LOCAL_ACCESS or MAY_OWNER_OVERRIDE." 40#define NFSD_MAY_OWNER_OVERRIDE 64
42#endif 41#define NFSD_MAY_LOCAL_ACCESS 128 /* IRIX doing local access check on device special file*/
43#define MAY_CREATE (MAY_EXEC|MAY_WRITE) 42
44#define MAY_REMOVE (MAY_EXEC|MAY_WRITE|MAY_TRUNC) 43#define NFSD_MAY_CREATE (NFSD_MAY_EXEC|NFSD_MAY_WRITE)
44#define NFSD_MAY_REMOVE (NFSD_MAY_EXEC|NFSD_MAY_WRITE|NFSD_MAY_TRUNC)
45 45
46/* 46/*
47 * Callback function for readdir 47 * Callback function for readdir
@@ -54,6 +54,7 @@ typedef int (*nfsd_dirop_t)(struct inode *, struct dentry *, int, int);
54extern struct svc_program nfsd_program; 54extern struct svc_program nfsd_program;
55extern struct svc_version nfsd_version2, nfsd_version3, 55extern struct svc_version nfsd_version2, nfsd_version3,
56 nfsd_version4; 56 nfsd_version4;
57extern struct mutex nfsd_mutex;
57extern struct svc_serv *nfsd_serv; 58extern struct svc_serv *nfsd_serv;
58 59
59extern struct seq_operations nfs_exports_op; 60extern struct seq_operations nfs_exports_op;
diff --git a/include/linux/nfsd/state.h b/include/linux/nfsd/state.h
index db348f749376..d0fe2e378452 100644
--- a/include/linux/nfsd/state.h
+++ b/include/linux/nfsd/state.h
@@ -98,8 +98,6 @@ struct nfs4_callback {
98 u32 cb_ident; 98 u32 cb_ident;
99 /* RPC client info */ 99 /* RPC client info */
100 atomic_t cb_set; /* successful CB_NULL call */ 100 atomic_t cb_set; /* successful CB_NULL call */
101 struct rpc_program cb_program;
102 struct rpc_stat cb_stat;
103 struct rpc_clnt * cb_client; 101 struct rpc_clnt * cb_client;
104}; 102};
105 103
diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h
index ea6517e58b04..2be7c63bc0f2 100644
--- a/include/linux/nl80211.h
+++ b/include/linux/nl80211.h
@@ -122,13 +122,13 @@ enum nl80211_commands {
122 NL80211_CMD_NEW_STATION, 122 NL80211_CMD_NEW_STATION,
123 NL80211_CMD_DEL_STATION, 123 NL80211_CMD_DEL_STATION,
124 124
125 /* add commands here */
126
127 NL80211_CMD_GET_MPATH, 125 NL80211_CMD_GET_MPATH,
128 NL80211_CMD_SET_MPATH, 126 NL80211_CMD_SET_MPATH,
129 NL80211_CMD_NEW_MPATH, 127 NL80211_CMD_NEW_MPATH,
130 NL80211_CMD_DEL_MPATH, 128 NL80211_CMD_DEL_MPATH,
131 129
130 /* add commands here */
131
132 /* used to define NL80211_CMD_MAX below */ 132 /* used to define NL80211_CMD_MAX below */
133 __NL80211_CMD_AFTER_LAST, 133 __NL80211_CMD_AFTER_LAST,
134 NL80211_CMD_MAX = __NL80211_CMD_AFTER_LAST - 1 134 NL80211_CMD_MAX = __NL80211_CMD_AFTER_LAST - 1
@@ -230,18 +230,21 @@ enum nl80211_attrs {
230 230
231 NL80211_ATTR_MNTR_FLAGS, 231 NL80211_ATTR_MNTR_FLAGS,
232 232
233 /* add attributes here, update the policy in nl80211.c */
234
235 NL80211_ATTR_MESH_ID, 233 NL80211_ATTR_MESH_ID,
236 NL80211_ATTR_STA_PLINK_ACTION, 234 NL80211_ATTR_STA_PLINK_ACTION,
237 NL80211_ATTR_MPATH_NEXT_HOP, 235 NL80211_ATTR_MPATH_NEXT_HOP,
238 NL80211_ATTR_MPATH_INFO, 236 NL80211_ATTR_MPATH_INFO,
239 237
238 /* add attributes here, update the policy in nl80211.c */
239
240 __NL80211_ATTR_AFTER_LAST, 240 __NL80211_ATTR_AFTER_LAST,
241 NL80211_ATTR_MAX = __NL80211_ATTR_AFTER_LAST - 1 241 NL80211_ATTR_MAX = __NL80211_ATTR_AFTER_LAST - 1
242}; 242};
243 243
244#define NL80211_MAX_SUPP_RATES 32 244#define NL80211_MAX_SUPP_RATES 32
245#define NL80211_TKIP_DATA_OFFSET_ENCR_KEY 0
246#define NL80211_TKIP_DATA_OFFSET_TX_MIC_KEY 16
247#define NL80211_TKIP_DATA_OFFSET_RX_MIC_KEY 24
245 248
246/** 249/**
247 * enum nl80211_iftype - (virtual) interface types 250 * enum nl80211_iftype - (virtual) interface types
diff --git a/include/linux/notifier.h b/include/linux/notifier.h
index 0ff6224d172a..bd3d72ddf333 100644
--- a/include/linux/notifier.h
+++ b/include/linux/notifier.h
@@ -197,6 +197,7 @@ static inline int notifier_to_errno(int ret)
197#define NETDEV_GOING_DOWN 0x0009 197#define NETDEV_GOING_DOWN 0x0009
198#define NETDEV_CHANGENAME 0x000A 198#define NETDEV_CHANGENAME 0x000A
199#define NETDEV_FEAT_CHANGE 0x000B 199#define NETDEV_FEAT_CHANGE 0x000B
200#define NETDEV_BONDING_FAILOVER 0x000C
200 201
201#define SYS_DOWN 0x0001 /* Notify of system down */ 202#define SYS_DOWN 0x0001 /* Notify of system down */
202#define SYS_RESTART SYS_DOWN 203#define SYS_RESTART SYS_DOWN
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index 6be6a7943d8b..d8507eb394cf 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -1950,6 +1950,8 @@
1950#define PCI_DEVICE_ID_NX2_5708 0x164c 1950#define PCI_DEVICE_ID_NX2_5708 0x164c
1951#define PCI_DEVICE_ID_TIGON3_5702FE 0x164d 1951#define PCI_DEVICE_ID_TIGON3_5702FE 0x164d
1952#define PCI_DEVICE_ID_NX2_57710 0x164e 1952#define PCI_DEVICE_ID_NX2_57710 0x164e
1953#define PCI_DEVICE_ID_NX2_57711 0x164f
1954#define PCI_DEVICE_ID_NX2_57711E 0x1650
1953#define PCI_DEVICE_ID_TIGON3_5705 0x1653 1955#define PCI_DEVICE_ID_TIGON3_5705 0x1653
1954#define PCI_DEVICE_ID_TIGON3_5705_2 0x1654 1956#define PCI_DEVICE_ID_TIGON3_5705_2 0x1654
1955#define PCI_DEVICE_ID_TIGON3_5720 0x1658 1957#define PCI_DEVICE_ID_TIGON3_5720 0x1658
@@ -1982,6 +1984,7 @@
1982#define PCI_DEVICE_ID_TIGON3_5787M 0x1693 1984#define PCI_DEVICE_ID_TIGON3_5787M 0x1693
1983#define PCI_DEVICE_ID_TIGON3_5782 0x1696 1985#define PCI_DEVICE_ID_TIGON3_5782 0x1696
1984#define PCI_DEVICE_ID_TIGON3_5784 0x1698 1986#define PCI_DEVICE_ID_TIGON3_5784 0x1698
1987#define PCI_DEVICE_ID_TIGON3_5785 0x1699
1985#define PCI_DEVICE_ID_TIGON3_5786 0x169a 1988#define PCI_DEVICE_ID_TIGON3_5786 0x169a
1986#define PCI_DEVICE_ID_TIGON3_5787 0x169b 1989#define PCI_DEVICE_ID_TIGON3_5787 0x169b
1987#define PCI_DEVICE_ID_TIGON3_5788 0x169c 1990#define PCI_DEVICE_ID_TIGON3_5788 0x169c
diff --git a/include/linux/pkt_cls.h b/include/linux/pkt_cls.h
index 99efbed81fa2..7cf7824df778 100644
--- a/include/linux/pkt_cls.h
+++ b/include/linux/pkt_cls.h
@@ -374,6 +374,7 @@ enum
374 TCA_FLOW_ACT, 374 TCA_FLOW_ACT,
375 TCA_FLOW_POLICE, 375 TCA_FLOW_POLICE,
376 TCA_FLOW_EMATCHES, 376 TCA_FLOW_EMATCHES,
377 TCA_FLOW_PERTURB,
377 __TCA_FLOW_MAX 378 __TCA_FLOW_MAX
378}; 379};
379 380
diff --git a/include/linux/pkt_sched.h b/include/linux/pkt_sched.h
index dbb7ac37960d..e5de421ac7b4 100644
--- a/include/linux/pkt_sched.h
+++ b/include/linux/pkt_sched.h
@@ -85,6 +85,26 @@ struct tc_ratespec
85 85
86#define TC_RTAB_SIZE 1024 86#define TC_RTAB_SIZE 1024
87 87
88struct tc_sizespec {
89 unsigned char cell_log;
90 unsigned char size_log;
91 short cell_align;
92 int overhead;
93 unsigned int linklayer;
94 unsigned int mpu;
95 unsigned int mtu;
96 unsigned int tsize;
97};
98
99enum {
100 TCA_STAB_UNSPEC,
101 TCA_STAB_BASE,
102 TCA_STAB_DATA,
103 __TCA_STAB_MAX
104};
105
106#define TCA_STAB_MAX (__TCA_STAB_MAX - 1)
107
88/* FIFO section */ 108/* FIFO section */
89 109
90struct tc_fifo_qopt 110struct tc_fifo_qopt
@@ -103,15 +123,6 @@ struct tc_prio_qopt
103 __u8 priomap[TC_PRIO_MAX+1]; /* Map: logical priority -> PRIO band */ 123 __u8 priomap[TC_PRIO_MAX+1]; /* Map: logical priority -> PRIO band */
104}; 124};
105 125
106enum
107{
108 TCA_PRIO_UNSPEC,
109 TCA_PRIO_MQ,
110 __TCA_PRIO_MAX
111};
112
113#define TCA_PRIO_MAX (__TCA_PRIO_MAX - 1)
114
115/* TBF section */ 126/* TBF section */
116 127
117struct tc_tbf_qopt 128struct tc_tbf_qopt
diff --git a/include/linux/ppp-comp.h b/include/linux/ppp-comp.h
index e86a7a5cf355..b8d4ddd22736 100644
--- a/include/linux/ppp-comp.h
+++ b/include/linux/ppp-comp.h
@@ -23,8 +23,6 @@
23 * ON AN "AS IS" BASIS, AND THE AUSTRALIAN NATIONAL UNIVERSITY HAS NO 23 * ON AN "AS IS" BASIS, AND THE AUSTRALIAN NATIONAL UNIVERSITY HAS NO
24 * OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, 24 * OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS,
25 * OR MODIFICATIONS. 25 * OR MODIFICATIONS.
26 *
27 * $Id: ppp-comp.h,v 1.6 1997/11/27 06:04:44 paulus Exp $
28 */ 26 */
29 27
30/* 28/*
diff --git a/include/linux/ppp_defs.h b/include/linux/ppp_defs.h
index c6b13ff85028..6e8adc77522c 100644
--- a/include/linux/ppp_defs.h
+++ b/include/linux/ppp_defs.h
@@ -1,5 +1,3 @@
1/* $Id: ppp_defs.h,v 1.2 1994/09/21 01:31:06 paulus Exp $ */
2
3/* 1/*
4 * ppp_defs.h - PPP definitions. 2 * ppp_defs.h - PPP definitions.
5 * 3 *
diff --git a/include/linux/rfkill.h b/include/linux/rfkill.h
index e3ab21d7fc7f..c5f6e54ec6ae 100644
--- a/include/linux/rfkill.h
+++ b/include/linux/rfkill.h
@@ -34,26 +34,37 @@
34 * RFKILL_TYPE_BLUETOOTH: switch is on a bluetooth device. 34 * RFKILL_TYPE_BLUETOOTH: switch is on a bluetooth device.
35 * RFKILL_TYPE_UWB: switch is on a ultra wideband device. 35 * RFKILL_TYPE_UWB: switch is on a ultra wideband device.
36 * RFKILL_TYPE_WIMAX: switch is on a WiMAX device. 36 * RFKILL_TYPE_WIMAX: switch is on a WiMAX device.
37 * RFKILL_TYPE_WWAN: switch is on a wireless WAN device.
37 */ 38 */
38enum rfkill_type { 39enum rfkill_type {
39 RFKILL_TYPE_WLAN , 40 RFKILL_TYPE_WLAN ,
40 RFKILL_TYPE_BLUETOOTH, 41 RFKILL_TYPE_BLUETOOTH,
41 RFKILL_TYPE_UWB, 42 RFKILL_TYPE_UWB,
42 RFKILL_TYPE_WIMAX, 43 RFKILL_TYPE_WIMAX,
44 RFKILL_TYPE_WWAN,
43 RFKILL_TYPE_MAX, 45 RFKILL_TYPE_MAX,
44}; 46};
45 47
46enum rfkill_state { 48enum rfkill_state {
47 RFKILL_STATE_OFF = 0, 49 RFKILL_STATE_SOFT_BLOCKED = 0, /* Radio output blocked */
48 RFKILL_STATE_ON = 1, 50 RFKILL_STATE_UNBLOCKED = 1, /* Radio output allowed */
51 RFKILL_STATE_HARD_BLOCKED = 2, /* Output blocked, non-overrideable */
49}; 52};
50 53
54/*
55 * These are DEPRECATED, drivers using them should be verified to
56 * comply with the rfkill usage guidelines in Documentation/rfkill.txt
57 * and then converted to use the new names for rfkill_state
58 */
59#define RFKILL_STATE_OFF RFKILL_STATE_SOFT_BLOCKED
60#define RFKILL_STATE_ON RFKILL_STATE_UNBLOCKED
61
51/** 62/**
52 * struct rfkill - rfkill control structure. 63 * struct rfkill - rfkill control structure.
53 * @name: Name of the switch. 64 * @name: Name of the switch.
54 * @type: Radio type which the button controls, the value stored 65 * @type: Radio type which the button controls, the value stored
55 * here should be a value from enum rfkill_type. 66 * here should be a value from enum rfkill_type.
56 * @state: State of the switch (on/off). 67 * @state: State of the switch, "UNBLOCKED" means radio can operate.
57 * @user_claim_unsupported: Whether the hardware supports exclusive 68 * @user_claim_unsupported: Whether the hardware supports exclusive
58 * RF-kill control by userspace. Set this before registering. 69 * RF-kill control by userspace. Set this before registering.
59 * @user_claim: Set when the switch is controlled exlusively by userspace. 70 * @user_claim: Set when the switch is controlled exlusively by userspace.
@@ -61,6 +72,12 @@ enum rfkill_state {
61 * @data: Pointer to the RF button drivers private data which will be 72 * @data: Pointer to the RF button drivers private data which will be
62 * passed along when toggling radio state. 73 * passed along when toggling radio state.
63 * @toggle_radio(): Mandatory handler to control state of the radio. 74 * @toggle_radio(): Mandatory handler to control state of the radio.
75 * only RFKILL_STATE_SOFT_BLOCKED and RFKILL_STATE_UNBLOCKED are
76 * valid parameters.
77 * @get_state(): handler to read current radio state from hardware,
78 * may be called from atomic context, should return 0 on success.
79 * Either this handler OR judicious use of rfkill_force_state() is
80 * MANDATORY for any driver capable of RFKILL_STATE_HARD_BLOCKED.
64 * @led_trigger: A LED trigger for this button's LED. 81 * @led_trigger: A LED trigger for this button's LED.
65 * @dev: Device structure integrating the switch into device tree. 82 * @dev: Device structure integrating the switch into device tree.
66 * @node: Used to place switch into list of all switches known to the 83 * @node: Used to place switch into list of all switches known to the
@@ -80,6 +97,7 @@ struct rfkill {
80 97
81 void *data; 98 void *data;
82 int (*toggle_radio)(void *data, enum rfkill_state state); 99 int (*toggle_radio)(void *data, enum rfkill_state state);
100 int (*get_state)(void *data, enum rfkill_state *state);
83 101
84#ifdef CONFIG_RFKILL_LEDS 102#ifdef CONFIG_RFKILL_LEDS
85 struct led_trigger led_trigger; 103 struct led_trigger led_trigger;
@@ -95,6 +113,21 @@ void rfkill_free(struct rfkill *rfkill);
95int rfkill_register(struct rfkill *rfkill); 113int rfkill_register(struct rfkill *rfkill);
96void rfkill_unregister(struct rfkill *rfkill); 114void rfkill_unregister(struct rfkill *rfkill);
97 115
116int rfkill_force_state(struct rfkill *rfkill, enum rfkill_state state);
117
118/**
119 * rfkill_state_complement - return complementar state
120 * @state: state to return the complement of
121 *
122 * Returns RFKILL_STATE_SOFT_BLOCKED if @state is RFKILL_STATE_UNBLOCKED,
123 * returns RFKILL_STATE_UNBLOCKED otherwise.
124 */
125static inline enum rfkill_state rfkill_state_complement(enum rfkill_state state)
126{
127 return (state == RFKILL_STATE_UNBLOCKED) ?
128 RFKILL_STATE_SOFT_BLOCKED : RFKILL_STATE_UNBLOCKED;
129}
130
98/** 131/**
99 * rfkill_get_led_name - Get the LED trigger name for the button's LED. 132 * rfkill_get_led_name - Get the LED trigger name for the button's LED.
100 * This function might return a NULL pointer if registering of the 133 * This function might return a NULL pointer if registering of the
@@ -110,4 +143,11 @@ static inline char *rfkill_get_led_name(struct rfkill *rfkill)
110#endif 143#endif
111} 144}
112 145
146/* rfkill notification chain */
147#define RFKILL_STATE_CHANGED 0x0001 /* state of a normal rfkill
148 switch has changed */
149
150int register_rfkill_notifier(struct notifier_block *nb);
151int unregister_rfkill_notifier(struct notifier_block *nb);
152
113#endif /* RFKILL_H */ 153#endif /* RFKILL_H */
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h
index b358c704d102..f4d386c191f5 100644
--- a/include/linux/rtnetlink.h
+++ b/include/linux/rtnetlink.h
@@ -482,6 +482,7 @@ enum
482 TCA_RATE, 482 TCA_RATE,
483 TCA_FCNT, 483 TCA_FCNT,
484 TCA_STATS2, 484 TCA_STATS2,
485 TCA_STAB,
485 __TCA_MAX 486 __TCA_MAX
486}; 487};
487 488
diff --git a/include/linux/seq_file_net.h b/include/linux/seq_file_net.h
index 4ac52542a563..32c89bbe24a2 100644
--- a/include/linux/seq_file_net.h
+++ b/include/linux/seq_file_net.h
@@ -14,7 +14,10 @@ struct seq_net_private {
14 14
15int seq_open_net(struct inode *, struct file *, 15int seq_open_net(struct inode *, struct file *,
16 const struct seq_operations *, int); 16 const struct seq_operations *, int);
17int single_open_net(struct inode *, struct file *file,
18 int (*show)(struct seq_file *, void *));
17int seq_release_net(struct inode *, struct file *); 19int seq_release_net(struct inode *, struct file *);
20int single_release_net(struct inode *, struct file *);
18static inline struct net *seq_file_net(struct seq_file *seq) 21static inline struct net *seq_file_net(struct seq_file *seq)
19{ 22{
20#ifdef CONFIG_NET_NS 23#ifdef CONFIG_NET_NS
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
index d8f31de632c5..f3a1c0e45021 100644
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
@@ -190,6 +190,7 @@ struct uart_ops {
190 void (*break_ctl)(struct uart_port *, int ctl); 190 void (*break_ctl)(struct uart_port *, int ctl);
191 int (*startup)(struct uart_port *); 191 int (*startup)(struct uart_port *);
192 void (*shutdown)(struct uart_port *); 192 void (*shutdown)(struct uart_port *);
193 void (*flush_buffer)(struct uart_port *);
193 void (*set_termios)(struct uart_port *, struct ktermios *new, 194 void (*set_termios)(struct uart_port *, struct ktermios *new,
194 struct ktermios *old); 195 struct ktermios *old);
195 void (*set_ldisc)(struct uart_port *); 196 void (*set_ldisc)(struct uart_port *);
@@ -343,13 +344,15 @@ typedef unsigned int __bitwise__ uif_t;
343 * stuff here. 344 * stuff here.
344 */ 345 */
345struct uart_info { 346struct uart_info {
346 struct tty_struct *tty; 347 struct tty_port port;
347 struct circ_buf xmit; 348 struct circ_buf xmit;
348 uif_t flags; 349 uif_t flags;
349 350
350/* 351/*
351 * Definitions for info->flags. These are _private_ to serial_core, and 352 * Definitions for info->flags. These are _private_ to serial_core, and
352 * are specific to this structure. They may be queried by low level drivers. 353 * are specific to this structure. They may be queried by low level drivers.
354 *
355 * FIXME: use the ASY_ definitions
353 */ 356 */
354#define UIF_CHECK_CD ((__force uif_t) (1 << 25)) 357#define UIF_CHECK_CD ((__force uif_t) (1 << 25))
355#define UIF_CTS_FLOW ((__force uif_t) (1 << 26)) 358#define UIF_CTS_FLOW ((__force uif_t) (1 << 26))
@@ -357,11 +360,7 @@ struct uart_info {
357#define UIF_INITIALIZED ((__force uif_t) (1 << 31)) 360#define UIF_INITIALIZED ((__force uif_t) (1 << 31))
358#define UIF_SUSPENDED ((__force uif_t) (1 << 30)) 361#define UIF_SUSPENDED ((__force uif_t) (1 << 30))
359 362
360 int blocked_open;
361
362 struct tasklet_struct tlet; 363 struct tasklet_struct tlet;
363
364 wait_queue_head_t open_wait;
365 wait_queue_head_t delta_msr_wait; 364 wait_queue_head_t delta_msr_wait;
366}; 365};
367 366
@@ -438,8 +437,8 @@ int uart_resume_port(struct uart_driver *reg, struct uart_port *port);
438#define uart_circ_chars_free(circ) \ 437#define uart_circ_chars_free(circ) \
439 (CIRC_SPACE((circ)->head, (circ)->tail, UART_XMIT_SIZE)) 438 (CIRC_SPACE((circ)->head, (circ)->tail, UART_XMIT_SIZE))
440 439
441#define uart_tx_stopped(port) \ 440#define uart_tx_stopped(portp) \
442 ((port)->info->tty->stopped || (port)->info->tty->hw_stopped) 441 ((portp)->info->port.tty->stopped || (portp)->info->port.tty->hw_stopped)
443 442
444/* 443/*
445 * The following are helper functions for the low level drivers. 444 * The following are helper functions for the low level drivers.
@@ -450,7 +449,7 @@ uart_handle_sysrq_char(struct uart_port *port, unsigned int ch)
450#ifdef SUPPORT_SYSRQ 449#ifdef SUPPORT_SYSRQ
451 if (port->sysrq) { 450 if (port->sysrq) {
452 if (ch && time_before(jiffies, port->sysrq)) { 451 if (ch && time_before(jiffies, port->sysrq)) {
453 handle_sysrq(ch, port->info ? port->info->tty : NULL); 452 handle_sysrq(ch, port->info ? port->info->port.tty : NULL);
454 port->sysrq = 0; 453 port->sysrq = 0;
455 return 1; 454 return 1;
456 } 455 }
@@ -479,7 +478,7 @@ static inline int uart_handle_break(struct uart_port *port)
479 } 478 }
480#endif 479#endif
481 if (port->flags & UPF_SAK) 480 if (port->flags & UPF_SAK)
482 do_SAK(info->tty); 481 do_SAK(info->port.tty);
483 return 0; 482 return 0;
484} 483}
485 484
@@ -502,9 +501,9 @@ uart_handle_dcd_change(struct uart_port *port, unsigned int status)
502 501
503 if (info->flags & UIF_CHECK_CD) { 502 if (info->flags & UIF_CHECK_CD) {
504 if (status) 503 if (status)
505 wake_up_interruptible(&info->open_wait); 504 wake_up_interruptible(&info->port.open_wait);
506 else if (info->tty) 505 else if (info->port.tty)
507 tty_hangup(info->tty); 506 tty_hangup(info->port.tty);
508 } 507 }
509} 508}
510 509
@@ -517,7 +516,7 @@ static inline void
517uart_handle_cts_change(struct uart_port *port, unsigned int status) 516uart_handle_cts_change(struct uart_port *port, unsigned int status)
518{ 517{
519 struct uart_info *info = port->info; 518 struct uart_info *info = port->info;
520 struct tty_struct *tty = info->tty; 519 struct tty_struct *tty = info->port.tty;
521 520
522 port->icount.cts++; 521 port->icount.cts++;
523 522
@@ -543,7 +542,7 @@ static inline void
543uart_insert_char(struct uart_port *port, unsigned int status, 542uart_insert_char(struct uart_port *port, unsigned int status,
544 unsigned int overrun, unsigned int ch, unsigned int flag) 543 unsigned int overrun, unsigned int ch, unsigned int flag)
545{ 544{
546 struct tty_struct *tty = port->info->tty; 545 struct tty_struct *tty = port->info->port.tty;
547 546
548 if ((status & port->ignore_status_mask & ~overrun) == 0) 547 if ((status & port->ignore_status_mask & ~overrun) == 0)
549 tty_insert_flip_char(tty, ch, flag); 548 tty_insert_flip_char(tty, ch, flag);
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 299ec4b31412..7ea44f6621f2 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -246,6 +246,7 @@ typedef unsigned char *sk_buff_data_t;
246 * @dma_cookie: a cookie to one of several possible DMA operations 246 * @dma_cookie: a cookie to one of several possible DMA operations
247 * done by skb DMA functions 247 * done by skb DMA functions
248 * @secmark: security marking 248 * @secmark: security marking
249 * @vlan_tci: vlan tag control information
249 */ 250 */
250 251
251struct sk_buff { 252struct sk_buff {
@@ -305,9 +306,7 @@ struct sk_buff {
305#endif 306#endif
306 307
307 int iif; 308 int iif;
308#ifdef CONFIG_NETDEVICES_MULTIQUEUE
309 __u16 queue_mapping; 309 __u16 queue_mapping;
310#endif
311#ifdef CONFIG_NET_SCHED 310#ifdef CONFIG_NET_SCHED
312 __u16 tc_index; /* traffic control index */ 311 __u16 tc_index; /* traffic control index */
313#ifdef CONFIG_NET_CLS_ACT 312#ifdef CONFIG_NET_CLS_ACT
@@ -328,6 +327,8 @@ struct sk_buff {
328 327
329 __u32 mark; 328 __u32 mark;
330 329
330 __u16 vlan_tci;
331
331 sk_buff_data_t transport_header; 332 sk_buff_data_t transport_header;
332 sk_buff_data_t network_header; 333 sk_buff_data_t network_header;
333 sk_buff_data_t mac_header; 334 sk_buff_data_t mac_header;
@@ -1671,25 +1672,17 @@ static inline void skb_init_secmark(struct sk_buff *skb)
1671 1672
1672static inline void skb_set_queue_mapping(struct sk_buff *skb, u16 queue_mapping) 1673static inline void skb_set_queue_mapping(struct sk_buff *skb, u16 queue_mapping)
1673{ 1674{
1674#ifdef CONFIG_NETDEVICES_MULTIQUEUE
1675 skb->queue_mapping = queue_mapping; 1675 skb->queue_mapping = queue_mapping;
1676#endif
1677} 1676}
1678 1677
1679static inline u16 skb_get_queue_mapping(struct sk_buff *skb) 1678static inline u16 skb_get_queue_mapping(struct sk_buff *skb)
1680{ 1679{
1681#ifdef CONFIG_NETDEVICES_MULTIQUEUE
1682 return skb->queue_mapping; 1680 return skb->queue_mapping;
1683#else
1684 return 0;
1685#endif
1686} 1681}
1687 1682
1688static inline void skb_copy_queue_mapping(struct sk_buff *to, const struct sk_buff *from) 1683static inline void skb_copy_queue_mapping(struct sk_buff *to, const struct sk_buff *from)
1689{ 1684{
1690#ifdef CONFIG_NETDEVICES_MULTIQUEUE
1691 to->queue_mapping = from->queue_mapping; 1685 to->queue_mapping = from->queue_mapping;
1692#endif
1693} 1686}
1694 1687
1695static inline int skb_is_gso(const struct sk_buff *skb) 1688static inline int skb_is_gso(const struct sk_buff *skb)
@@ -1702,6 +1695,20 @@ static inline int skb_is_gso_v6(const struct sk_buff *skb)
1702 return skb_shinfo(skb)->gso_type & SKB_GSO_TCPV6; 1695 return skb_shinfo(skb)->gso_type & SKB_GSO_TCPV6;
1703} 1696}
1704 1697
1698extern void __skb_warn_lro_forwarding(const struct sk_buff *skb);
1699
1700static inline bool skb_warn_if_lro(const struct sk_buff *skb)
1701{
1702 /* LRO sets gso_size but not gso_type, whereas if GSO is really
1703 * wanted then gso_type will be set. */
1704 struct skb_shared_info *shinfo = skb_shinfo(skb);
1705 if (shinfo->gso_size != 0 && unlikely(shinfo->gso_type == 0)) {
1706 __skb_warn_lro_forwarding(skb);
1707 return true;
1708 }
1709 return false;
1710}
1711
1705static inline void skb_forward_csum(struct sk_buff *skb) 1712static inline void skb_forward_csum(struct sk_buff *skb)
1706{ 1713{
1707 /* Unfortunately we don't support this one. Any brave souls? */ 1714 /* Unfortunately we don't support this one. Any brave souls? */
diff --git a/include/linux/smc911x.h b/include/linux/smc911x.h
new file mode 100644
index 000000000000..b58f54c24183
--- /dev/null
+++ b/include/linux/smc911x.h
@@ -0,0 +1,12 @@
1#ifndef __SMC911X_H__
2#define __SMC911X_H__
3
4#define SMC911X_USE_16BIT (1 << 0)
5#define SMC911X_USE_32BIT (1 << 1)
6
7struct smc911x_platdata {
8 unsigned long flags;
9 unsigned long irq_flags; /* IRQF_... */
10};
11
12#endif /* __SMC911X_H__ */
diff --git a/include/linux/socket.h b/include/linux/socket.h
index bd2b30a74e76..950af631e7fb 100644
--- a/include/linux/socket.h
+++ b/include/linux/socket.h
@@ -306,10 +306,10 @@ extern int csum_partial_copy_fromiovecend(unsigned char *kdata,
306 int offset, 306 int offset,
307 unsigned int len, __wsum *csump); 307 unsigned int len, __wsum *csump);
308 308
309extern int verify_iovec(struct msghdr *m, struct iovec *iov, char *address, int mode); 309extern int verify_iovec(struct msghdr *m, struct iovec *iov, struct sockaddr *address, int mode);
310extern int memcpy_toiovec(struct iovec *v, unsigned char *kdata, int len); 310extern int memcpy_toiovec(struct iovec *v, unsigned char *kdata, int len);
311extern int move_addr_to_user(void *kaddr, int klen, void __user *uaddr, int __user *ulen); 311extern int move_addr_to_user(struct sockaddr *kaddr, int klen, void __user *uaddr, int __user *ulen);
312extern int move_addr_to_kernel(void __user *uaddr, int ulen, void *kaddr); 312extern int move_addr_to_kernel(void __user *uaddr, int ulen, struct sockaddr *kaddr);
313extern int put_cmsg(struct msghdr*, int level, int type, int len, void *data); 313extern int put_cmsg(struct msghdr*, int level, int type, int len, void *data);
314 314
315#endif 315#endif
diff --git a/include/linux/sonet.h b/include/linux/sonet.h
index 753680296e17..67ad11fcf88b 100644
--- a/include/linux/sonet.h
+++ b/include/linux/sonet.h
@@ -34,7 +34,7 @@ struct sonet_stats {
34 /* clear error insertion */ 34 /* clear error insertion */
35#define SONET_GETDIAG _IOR('a',ATMIOC_PHYTYP+4,int) 35#define SONET_GETDIAG _IOR('a',ATMIOC_PHYTYP+4,int)
36 /* query error insertion */ 36 /* query error insertion */
37#define SONET_SETFRAMING _IO('a',ATMIOC_PHYTYP+5) 37#define SONET_SETFRAMING _IOW('a',ATMIOC_PHYTYP+5,int)
38 /* set framing mode (SONET/SDH) */ 38 /* set framing mode (SONET/SDH) */
39#define SONET_GETFRAMING _IOR('a',ATMIOC_PHYTYP+6,int) 39#define SONET_GETFRAMING _IOR('a',ATMIOC_PHYTYP+6,int)
40 /* get framing mode */ 40 /* get framing mode */
diff --git a/include/linux/ssb/ssb.h b/include/linux/ssb/ssb.h
index 50dfd0dc4093..4bf8cade9dbc 100644
--- a/include/linux/ssb/ssb.h
+++ b/include/linux/ssb/ssb.h
@@ -7,6 +7,7 @@
7#include <linux/spinlock.h> 7#include <linux/spinlock.h>
8#include <linux/pci.h> 8#include <linux/pci.h>
9#include <linux/mod_devicetable.h> 9#include <linux/mod_devicetable.h>
10#include <linux/dma-mapping.h>
10 11
11#include <linux/ssb/ssb_regs.h> 12#include <linux/ssb/ssb_regs.h>
12 13
@@ -137,9 +138,6 @@ struct ssb_device {
137 const struct ssb_bus_ops *ops; 138 const struct ssb_bus_ops *ops;
138 139
139 struct device *dev; 140 struct device *dev;
140 /* Pointer to the device that has to be used for
141 * any DMA related operation. */
142 struct device *dma_dev;
143 141
144 struct ssb_bus *bus; 142 struct ssb_bus *bus;
145 struct ssb_device_id id; 143 struct ssb_device_id id;
@@ -399,13 +397,151 @@ static inline void ssb_block_write(struct ssb_device *dev, const void *buffer,
399#endif /* CONFIG_SSB_BLOCKIO */ 397#endif /* CONFIG_SSB_BLOCKIO */
400 398
401 399
400/* The SSB DMA API. Use this API for any DMA operation on the device.
401 * This API basically is a wrapper that calls the correct DMA API for
402 * the host device type the SSB device is attached to. */
403
402/* Translation (routing) bits that need to be ORed to DMA 404/* Translation (routing) bits that need to be ORed to DMA
403 * addresses before they are given to a device. */ 405 * addresses before they are given to a device. */
404extern u32 ssb_dma_translation(struct ssb_device *dev); 406extern u32 ssb_dma_translation(struct ssb_device *dev);
405#define SSB_DMA_TRANSLATION_MASK 0xC0000000 407#define SSB_DMA_TRANSLATION_MASK 0xC0000000
406#define SSB_DMA_TRANSLATION_SHIFT 30 408#define SSB_DMA_TRANSLATION_SHIFT 30
407 409
408extern int ssb_dma_set_mask(struct ssb_device *ssb_dev, u64 mask); 410extern int ssb_dma_set_mask(struct ssb_device *dev, u64 mask);
411
412extern void * ssb_dma_alloc_consistent(struct ssb_device *dev, size_t size,
413 dma_addr_t *dma_handle, gfp_t gfp_flags);
414extern void ssb_dma_free_consistent(struct ssb_device *dev, size_t size,
415 void *vaddr, dma_addr_t dma_handle,
416 gfp_t gfp_flags);
417
418static inline void __cold __ssb_dma_not_implemented(struct ssb_device *dev)
419{
420#ifdef CONFIG_SSB_DEBUG
421 printk(KERN_ERR "SSB: BUG! Calling DMA API for "
422 "unsupported bustype %d\n", dev->bus->bustype);
423#endif /* DEBUG */
424}
425
426static inline int ssb_dma_mapping_error(struct ssb_device *dev, dma_addr_t addr)
427{
428 switch (dev->bus->bustype) {
429 case SSB_BUSTYPE_PCI:
430 return pci_dma_mapping_error(addr);
431 case SSB_BUSTYPE_SSB:
432 return dma_mapping_error(addr);
433 default:
434 __ssb_dma_not_implemented(dev);
435 }
436 return -ENOSYS;
437}
438
439static inline dma_addr_t ssb_dma_map_single(struct ssb_device *dev, void *p,
440 size_t size, enum dma_data_direction dir)
441{
442 switch (dev->bus->bustype) {
443 case SSB_BUSTYPE_PCI:
444 return pci_map_single(dev->bus->host_pci, p, size, dir);
445 case SSB_BUSTYPE_SSB:
446 return dma_map_single(dev->dev, p, size, dir);
447 default:
448 __ssb_dma_not_implemented(dev);
449 }
450 return 0;
451}
452
453static inline void ssb_dma_unmap_single(struct ssb_device *dev, dma_addr_t dma_addr,
454 size_t size, enum dma_data_direction dir)
455{
456 switch (dev->bus->bustype) {
457 case SSB_BUSTYPE_PCI:
458 pci_unmap_single(dev->bus->host_pci, dma_addr, size, dir);
459 return;
460 case SSB_BUSTYPE_SSB:
461 dma_unmap_single(dev->dev, dma_addr, size, dir);
462 return;
463 default:
464 __ssb_dma_not_implemented(dev);
465 }
466}
467
468static inline void ssb_dma_sync_single_for_cpu(struct ssb_device *dev,
469 dma_addr_t dma_addr,
470 size_t size,
471 enum dma_data_direction dir)
472{
473 switch (dev->bus->bustype) {
474 case SSB_BUSTYPE_PCI:
475 pci_dma_sync_single_for_cpu(dev->bus->host_pci, dma_addr,
476 size, dir);
477 return;
478 case SSB_BUSTYPE_SSB:
479 dma_sync_single_for_cpu(dev->dev, dma_addr, size, dir);
480 return;
481 default:
482 __ssb_dma_not_implemented(dev);
483 }
484}
485
486static inline void ssb_dma_sync_single_for_device(struct ssb_device *dev,
487 dma_addr_t dma_addr,
488 size_t size,
489 enum dma_data_direction dir)
490{
491 switch (dev->bus->bustype) {
492 case SSB_BUSTYPE_PCI:
493 pci_dma_sync_single_for_device(dev->bus->host_pci, dma_addr,
494 size, dir);
495 return;
496 case SSB_BUSTYPE_SSB:
497 dma_sync_single_for_device(dev->dev, dma_addr, size, dir);
498 return;
499 default:
500 __ssb_dma_not_implemented(dev);
501 }
502}
503
504static inline void ssb_dma_sync_single_range_for_cpu(struct ssb_device *dev,
505 dma_addr_t dma_addr,
506 unsigned long offset,
507 size_t size,
508 enum dma_data_direction dir)
509{
510 switch (dev->bus->bustype) {
511 case SSB_BUSTYPE_PCI:
512 /* Just sync everything. That's all the PCI API can do. */
513 pci_dma_sync_single_for_cpu(dev->bus->host_pci, dma_addr,
514 offset + size, dir);
515 return;
516 case SSB_BUSTYPE_SSB:
517 dma_sync_single_range_for_cpu(dev->dev, dma_addr, offset,
518 size, dir);
519 return;
520 default:
521 __ssb_dma_not_implemented(dev);
522 }
523}
524
525static inline void ssb_dma_sync_single_range_for_device(struct ssb_device *dev,
526 dma_addr_t dma_addr,
527 unsigned long offset,
528 size_t size,
529 enum dma_data_direction dir)
530{
531 switch (dev->bus->bustype) {
532 case SSB_BUSTYPE_PCI:
533 /* Just sync everything. That's all the PCI API can do. */
534 pci_dma_sync_single_for_device(dev->bus->host_pci, dma_addr,
535 offset + size, dir);
536 return;
537 case SSB_BUSTYPE_SSB:
538 dma_sync_single_range_for_device(dev->dev, dma_addr, offset,
539 size, dir);
540 return;
541 default:
542 __ssb_dma_not_implemented(dev);
543 }
544}
409 545
410 546
411#ifdef CONFIG_SSB_PCIHOST 547#ifdef CONFIG_SSB_PCIHOST
diff --git a/include/linux/stallion.h b/include/linux/stallion.h
index 0424d75a5aaa..336af33c6ea4 100644
--- a/include/linux/stallion.h
+++ b/include/linux/stallion.h
@@ -69,6 +69,7 @@ struct stlrq {
69 */ 69 */
70struct stlport { 70struct stlport {
71 unsigned long magic; 71 unsigned long magic;
72 struct tty_port port;
72 unsigned int portnr; 73 unsigned int portnr;
73 unsigned int panelnr; 74 unsigned int panelnr;
74 unsigned int brdnr; 75 unsigned int brdnr;
@@ -76,12 +77,10 @@ struct stlport {
76 int uartaddr; 77 int uartaddr;
77 unsigned int pagenr; 78 unsigned int pagenr;
78 unsigned long istate; 79 unsigned long istate;
79 int flags;
80 int baud_base; 80 int baud_base;
81 int custom_divisor; 81 int custom_divisor;
82 int close_delay; 82 int close_delay;
83 int closing_wait; 83 int closing_wait;
84 int refcount;
85 int openwaitcnt; 84 int openwaitcnt;
86 int brklen; 85 int brklen;
87 unsigned int sigs; 86 unsigned int sigs;
@@ -92,9 +91,6 @@ struct stlport {
92 unsigned long clk; 91 unsigned long clk;
93 unsigned long hwid; 92 unsigned long hwid;
94 void *uartp; 93 void *uartp;
95 struct tty_struct *tty;
96 wait_queue_head_t open_wait;
97 wait_queue_head_t close_wait;
98 comstats_t stats; 94 comstats_t stats;
99 struct stlrq tx; 95 struct stlrq tx;
100}; 96};
diff --git a/include/linux/sunrpc/auth_gss.h b/include/linux/sunrpc/auth_gss.h
index fec6899bf355..d48d4e605f74 100644
--- a/include/linux/sunrpc/auth_gss.h
+++ b/include/linux/sunrpc/auth_gss.h
@@ -7,8 +7,6 @@
7 * Andy Adamson <andros@umich.edu> 7 * Andy Adamson <andros@umich.edu>
8 * Bruce Fields <bfields@umich.edu> 8 * Bruce Fields <bfields@umich.edu>
9 * Copyright (c) 2000 The Regents of the University of Michigan 9 * Copyright (c) 2000 The Regents of the University of Michigan
10 *
11 * $Id$
12 */ 10 */
13 11
14#ifndef _LINUX_SUNRPC_AUTH_GSS_H 12#ifndef _LINUX_SUNRPC_AUTH_GSS_H
diff --git a/include/linux/sunrpc/gss_api.h b/include/linux/sunrpc/gss_api.h
index 459c5fc11d51..03f33330ece2 100644
--- a/include/linux/sunrpc/gss_api.h
+++ b/include/linux/sunrpc/gss_api.h
@@ -7,8 +7,6 @@
7 * Andy Adamson <andros@umich.edu> 7 * Andy Adamson <andros@umich.edu>
8 * Bruce Fields <bfields@umich.edu> 8 * Bruce Fields <bfields@umich.edu>
9 * Copyright (c) 2000 The Regents of the University of Michigan 9 * Copyright (c) 2000 The Regents of the University of Michigan
10 *
11 * $Id$
12 */ 10 */
13 11
14#ifndef _LINUX_SUNRPC_GSS_API_H 12#ifndef _LINUX_SUNRPC_GSS_API_H
diff --git a/include/linux/sunrpc/gss_krb5.h b/include/linux/sunrpc/gss_krb5.h
index a10f1fb0bf7c..e7bbdba474d5 100644
--- a/include/linux/sunrpc/gss_krb5.h
+++ b/include/linux/sunrpc/gss_krb5.h
@@ -51,6 +51,9 @@ struct krb5_ctx {
51 51
52extern spinlock_t krb5_seq_lock; 52extern spinlock_t krb5_seq_lock;
53 53
54/* The length of the Kerberos GSS token header */
55#define GSS_KRB5_TOK_HDR_LEN (16)
56
54#define KG_TOK_MIC_MSG 0x0101 57#define KG_TOK_MIC_MSG 0x0101
55#define KG_TOK_WRAP_MSG 0x0201 58#define KG_TOK_WRAP_MSG 0x0201
56 59
diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h
index 4b54c5fdcfd9..dc69068d94c7 100644
--- a/include/linux/sunrpc/svc.h
+++ b/include/linux/sunrpc/svc.h
@@ -22,7 +22,7 @@
22/* 22/*
23 * This is the RPC server thread function prototype 23 * This is the RPC server thread function prototype
24 */ 24 */
25typedef void (*svc_thread_fn)(struct svc_rqst *); 25typedef int (*svc_thread_fn)(void *);
26 26
27/* 27/*
28 * 28 *
@@ -80,7 +80,6 @@ struct svc_serv {
80 struct module * sv_module; /* optional module to count when 80 struct module * sv_module; /* optional module to count when
81 * adding threads */ 81 * adding threads */
82 svc_thread_fn sv_function; /* main function for threads */ 82 svc_thread_fn sv_function; /* main function for threads */
83 int sv_kill_signal; /* signal to kill threads */
84}; 83};
85 84
86/* 85/*
@@ -388,8 +387,8 @@ struct svc_rqst *svc_prepare_thread(struct svc_serv *serv,
388 struct svc_pool *pool); 387 struct svc_pool *pool);
389void svc_exit_thread(struct svc_rqst *); 388void svc_exit_thread(struct svc_rqst *);
390struct svc_serv * svc_create_pooled(struct svc_program *, unsigned int, 389struct svc_serv * svc_create_pooled(struct svc_program *, unsigned int,
391 void (*shutdown)(struct svc_serv*), 390 void (*shutdown)(struct svc_serv*), svc_thread_fn,
392 svc_thread_fn, int sig, struct module *); 391 struct module *);
393int svc_set_num_threads(struct svc_serv *, struct svc_pool *, int); 392int svc_set_num_threads(struct svc_serv *, struct svc_pool *, int);
394void svc_destroy(struct svc_serv *); 393void svc_destroy(struct svc_serv *);
395int svc_process(struct svc_rqst *); 394int svc_process(struct svc_rqst *);
diff --git a/include/linux/sunrpc/svc_rdma.h b/include/linux/sunrpc/svc_rdma.h
index 05eb4664d0dd..ef2e3a20bf3b 100644
--- a/include/linux/sunrpc/svc_rdma.h
+++ b/include/linux/sunrpc/svc_rdma.h
@@ -72,7 +72,7 @@ extern atomic_t rdma_stat_sq_prod;
72 */ 72 */
73struct svc_rdma_op_ctxt { 73struct svc_rdma_op_ctxt {
74 struct svc_rdma_op_ctxt *read_hdr; 74 struct svc_rdma_op_ctxt *read_hdr;
75 struct list_head free_list; 75 int hdr_count;
76 struct xdr_buf arg; 76 struct xdr_buf arg;
77 struct list_head dto_q; 77 struct list_head dto_q;
78 enum ib_wr_opcode wr_op; 78 enum ib_wr_opcode wr_op;
@@ -86,6 +86,31 @@ struct svc_rdma_op_ctxt {
86 struct page *pages[RPCSVC_MAXPAGES]; 86 struct page *pages[RPCSVC_MAXPAGES];
87}; 87};
88 88
89/*
90 * NFS_ requests are mapped on the client side by the chunk lists in
91 * the RPCRDMA header. During the fetching of the RPC from the client
92 * and the writing of the reply to the client, the memory in the
93 * client and the memory in the server must be mapped as contiguous
94 * vaddr/len for access by the hardware. These data strucures keep
95 * these mappings.
96 *
97 * For an RDMA_WRITE, the 'sge' maps the RPC REPLY. For RDMA_READ, the
98 * 'sge' in the svc_rdma_req_map maps the server side RPC reply and the
99 * 'ch' field maps the read-list of the RPCRDMA header to the 'sge'
100 * mapping of the reply.
101 */
102struct svc_rdma_chunk_sge {
103 int start; /* sge no for this chunk */
104 int count; /* sge count for this chunk */
105};
106struct svc_rdma_req_map {
107 unsigned long count;
108 union {
109 struct kvec sge[RPCSVC_MAXPAGES];
110 struct svc_rdma_chunk_sge ch[RPCSVC_MAXPAGES];
111 };
112};
113
89#define RDMACTXT_F_LAST_CTXT 2 114#define RDMACTXT_F_LAST_CTXT 2
90 115
91struct svcxprt_rdma { 116struct svcxprt_rdma {
@@ -93,7 +118,6 @@ struct svcxprt_rdma {
93 struct rdma_cm_id *sc_cm_id; /* RDMA connection id */ 118 struct rdma_cm_id *sc_cm_id; /* RDMA connection id */
94 struct list_head sc_accept_q; /* Conn. waiting accept */ 119 struct list_head sc_accept_q; /* Conn. waiting accept */
95 int sc_ord; /* RDMA read limit */ 120 int sc_ord; /* RDMA read limit */
96 wait_queue_head_t sc_read_wait;
97 int sc_max_sge; 121 int sc_max_sge;
98 122
99 int sc_sq_depth; /* Depth of SQ */ 123 int sc_sq_depth; /* Depth of SQ */
@@ -104,12 +128,8 @@ struct svcxprt_rdma {
104 128
105 struct ib_pd *sc_pd; 129 struct ib_pd *sc_pd;
106 130
131 atomic_t sc_dma_used;
107 atomic_t sc_ctxt_used; 132 atomic_t sc_ctxt_used;
108 struct list_head sc_ctxt_free;
109 int sc_ctxt_cnt;
110 int sc_ctxt_bump;
111 int sc_ctxt_max;
112 spinlock_t sc_ctxt_lock;
113 struct list_head sc_rq_dto_q; 133 struct list_head sc_rq_dto_q;
114 spinlock_t sc_rq_dto_lock; 134 spinlock_t sc_rq_dto_lock;
115 struct ib_qp *sc_qp; 135 struct ib_qp *sc_qp;
@@ -173,6 +193,8 @@ extern int svc_rdma_post_recv(struct svcxprt_rdma *);
173extern int svc_rdma_create_listen(struct svc_serv *, int, struct sockaddr *); 193extern int svc_rdma_create_listen(struct svc_serv *, int, struct sockaddr *);
174extern struct svc_rdma_op_ctxt *svc_rdma_get_context(struct svcxprt_rdma *); 194extern struct svc_rdma_op_ctxt *svc_rdma_get_context(struct svcxprt_rdma *);
175extern void svc_rdma_put_context(struct svc_rdma_op_ctxt *, int); 195extern void svc_rdma_put_context(struct svc_rdma_op_ctxt *, int);
196extern struct svc_rdma_req_map *svc_rdma_get_req_map(void);
197extern void svc_rdma_put_req_map(struct svc_rdma_req_map *);
176extern void svc_sq_reap(struct svcxprt_rdma *); 198extern void svc_sq_reap(struct svcxprt_rdma *);
177extern void svc_rq_reap(struct svcxprt_rdma *); 199extern void svc_rq_reap(struct svcxprt_rdma *);
178extern struct svc_xprt_class svc_rdma_class; 200extern struct svc_xprt_class svc_rdma_class;
diff --git a/include/linux/sunrpc/svcauth_gss.h b/include/linux/sunrpc/svcauth_gss.h
index 417a1def56db..c9165d9771a8 100644
--- a/include/linux/sunrpc/svcauth_gss.h
+++ b/include/linux/sunrpc/svcauth_gss.h
@@ -3,9 +3,6 @@
3 * 3 *
4 * Bruce Fields <bfields@umich.edu> 4 * Bruce Fields <bfields@umich.edu>
5 * Copyright (c) 2002 The Regents of the Unviersity of Michigan 5 * Copyright (c) 2002 The Regents of the Unviersity of Michigan
6 *
7 * $Id$
8 *
9 */ 6 */
10 7
11#ifndef _LINUX_SUNRPC_SVCAUTH_GSS_H 8#ifndef _LINUX_SUNRPC_SVCAUTH_GSS_H
diff --git a/include/linux/tcp.h b/include/linux/tcp.h
index b31b6b74aa28..2e2557388e36 100644
--- a/include/linux/tcp.h
+++ b/include/linux/tcp.h
@@ -224,6 +224,12 @@ struct tcp_options_received {
224 u16 mss_clamp; /* Maximal mss, negotiated at connection setup */ 224 u16 mss_clamp; /* Maximal mss, negotiated at connection setup */
225}; 225};
226 226
227/* This is the max number of SACKS that we'll generate and process. It's safe
228 * to increse this, although since:
229 * size = TCPOLEN_SACK_BASE_ALIGNED (4) + n * TCPOLEN_SACK_PERBLOCK (8)
230 * only four options will fit in a standard TCP header */
231#define TCP_NUM_SACKS 4
232
227struct tcp_request_sock { 233struct tcp_request_sock {
228 struct inet_request_sock req; 234 struct inet_request_sock req;
229#ifdef CONFIG_TCP_MD5SIG 235#ifdef CONFIG_TCP_MD5SIG
@@ -291,10 +297,9 @@ struct tcp_sock {
291 u32 rcv_ssthresh; /* Current window clamp */ 297 u32 rcv_ssthresh; /* Current window clamp */
292 298
293 u32 frto_highmark; /* snd_nxt when RTO occurred */ 299 u32 frto_highmark; /* snd_nxt when RTO occurred */
294 u8 reordering; /* Packet reordering metric. */ 300 u16 advmss; /* Advertised MSS */
295 u8 frto_counter; /* Number of new acks after RTO */ 301 u8 frto_counter; /* Number of new acks after RTO */
296 u8 nonagle; /* Disable Nagle algorithm? */ 302 u8 nonagle; /* Disable Nagle algorithm? */
297 u8 keepalive_probes; /* num of allowed keep alive probes */
298 303
299/* RTT measurement */ 304/* RTT measurement */
300 u32 srtt; /* smoothed round trip time << 3 */ 305 u32 srtt; /* smoothed round trip time << 3 */
@@ -305,6 +310,10 @@ struct tcp_sock {
305 310
306 u32 packets_out; /* Packets which are "in flight" */ 311 u32 packets_out; /* Packets which are "in flight" */
307 u32 retrans_out; /* Retransmitted packets out */ 312 u32 retrans_out; /* Retransmitted packets out */
313
314 u16 urg_data; /* Saved octet of OOB data and control flags */
315 u8 urg_mode; /* In urgent mode */
316 u8 ecn_flags; /* ECN status bits. */
308/* 317/*
309 * Options received (usually on last packet, some only on SYN packets). 318 * Options received (usually on last packet, some only on SYN packets).
310 */ 319 */
@@ -320,13 +329,24 @@ struct tcp_sock {
320 u32 snd_cwnd_used; 329 u32 snd_cwnd_used;
321 u32 snd_cwnd_stamp; 330 u32 snd_cwnd_stamp;
322 331
323 struct sk_buff_head out_of_order_queue; /* Out of order segments go here */
324
325 u32 rcv_wnd; /* Current receiver window */ 332 u32 rcv_wnd; /* Current receiver window */
326 u32 write_seq; /* Tail(+1) of data held in tcp send buffer */ 333 u32 write_seq; /* Tail(+1) of data held in tcp send buffer */
327 u32 pushed_seq; /* Last pushed seq, required to talk to windows */ 334 u32 pushed_seq; /* Last pushed seq, required to talk to windows */
335 u32 lost_out; /* Lost packets */
336 u32 sacked_out; /* SACK'd packets */
337 u32 fackets_out; /* FACK'd packets */
338 u32 tso_deferred;
339 u32 bytes_acked; /* Appropriate Byte Counting - RFC3465 */
328 340
329/* SACKs data */ 341 /* from STCP, retrans queue hinting */
342 struct sk_buff* lost_skb_hint;
343 struct sk_buff *scoreboard_skb_hint;
344 struct sk_buff *retransmit_skb_hint;
345 struct sk_buff *forward_skb_hint;
346
347 struct sk_buff_head out_of_order_queue; /* Out of order segments go here */
348
349 /* SACKs data, these 2 need to be together (see tcp_build_and_update_options) */
330 struct tcp_sack_block duplicate_sack[1]; /* D-SACK block */ 350 struct tcp_sack_block duplicate_sack[1]; /* D-SACK block */
331 struct tcp_sack_block selective_acks[4]; /* The SACKS themselves*/ 351 struct tcp_sack_block selective_acks[4]; /* The SACKS themselves*/
332 352
@@ -337,23 +357,14 @@ struct tcp_sock {
337 * sacked_out > 0) 357 * sacked_out > 0)
338 */ 358 */
339 359
340 /* from STCP, retrans queue hinting */
341 struct sk_buff* lost_skb_hint;
342
343 struct sk_buff *scoreboard_skb_hint;
344 struct sk_buff *retransmit_skb_hint;
345 struct sk_buff *forward_skb_hint;
346
347 int lost_cnt_hint; 360 int lost_cnt_hint;
348 int retransmit_cnt_hint; 361 int retransmit_cnt_hint;
349 362
350 u32 lost_retrans_low; /* Sent seq after any rxmit (lowest) */ 363 u32 lost_retrans_low; /* Sent seq after any rxmit (lowest) */
351 364
352 u16 advmss; /* Advertised MSS */ 365 u8 reordering; /* Packet reordering metric. */
366 u8 keepalive_probes; /* num of allowed keep alive probes */
353 u32 prior_ssthresh; /* ssthresh saved at recovery start */ 367 u32 prior_ssthresh; /* ssthresh saved at recovery start */
354 u32 lost_out; /* Lost packets */
355 u32 sacked_out; /* SACK'd packets */
356 u32 fackets_out; /* FACK'd packets */
357 u32 high_seq; /* snd_nxt at onset of congestion */ 368 u32 high_seq; /* snd_nxt at onset of congestion */
358 369
359 u32 retrans_stamp; /* Timestamp of the last retransmit, 370 u32 retrans_stamp; /* Timestamp of the last retransmit,
@@ -361,23 +372,16 @@ struct tcp_sock {
361 * the first SYN. */ 372 * the first SYN. */
362 u32 undo_marker; /* tracking retrans started here. */ 373 u32 undo_marker; /* tracking retrans started here. */
363 int undo_retrans; /* number of undoable retransmissions. */ 374 int undo_retrans; /* number of undoable retransmissions. */
375 u32 total_retrans; /* Total retransmits for entire connection */
376
364 u32 urg_seq; /* Seq of received urgent pointer */ 377 u32 urg_seq; /* Seq of received urgent pointer */
365 u16 urg_data; /* Saved octet of OOB data and control flags */
366 u8 urg_mode; /* In urgent mode */
367 u8 ecn_flags; /* ECN status bits. */
368 u32 snd_up; /* Urgent pointer */ 378 u32 snd_up; /* Urgent pointer */
369 379
370 u32 total_retrans; /* Total retransmits for entire connection */
371 u32 bytes_acked; /* Appropriate Byte Counting - RFC3465 */
372
373 unsigned int keepalive_time; /* time before keep alive takes place */ 380 unsigned int keepalive_time; /* time before keep alive takes place */
374 unsigned int keepalive_intvl; /* time interval between keep alive probes */ 381 unsigned int keepalive_intvl; /* time interval between keep alive probes */
375 int linger2;
376 382
377 unsigned long last_synq_overflow; 383 unsigned long last_synq_overflow;
378 384
379 u32 tso_deferred;
380
381/* Receiver side RTT estimation */ 385/* Receiver side RTT estimation */
382 struct { 386 struct {
383 u32 rtt; 387 u32 rtt;
@@ -405,6 +409,8 @@ struct tcp_sock {
405/* TCP MD5 Signagure Option information */ 409/* TCP MD5 Signagure Option information */
406 struct tcp_md5sig_info *md5sig_info; 410 struct tcp_md5sig_info *md5sig_info;
407#endif 411#endif
412
413 int linger2;
408}; 414};
409 415
410static inline struct tcp_sock *tcp_sk(const struct sock *sk) 416static inline struct tcp_sock *tcp_sk(const struct sock *sk)
diff --git a/include/linux/textsearch.h b/include/linux/textsearch.h
index 6f371f24160b..d9a85d616385 100644
--- a/include/linux/textsearch.h
+++ b/include/linux/textsearch.h
@@ -10,10 +10,8 @@
10 10
11struct ts_config; 11struct ts_config;
12 12
13/** 13#define TS_AUTOLOAD 1 /* Automatically load textsearch modules when needed */
14 * TS_AUTOLOAD - Automatically load textsearch modules when needed 14#define TS_IGNORECASE 2 /* Searches string case insensitively */
15 */
16#define TS_AUTOLOAD 1
17 15
18/** 16/**
19 * struct ts_state - search state 17 * struct ts_state - search state
@@ -39,7 +37,7 @@ struct ts_state
39struct ts_ops 37struct ts_ops
40{ 38{
41 const char *name; 39 const char *name;
42 struct ts_config * (*init)(const void *, unsigned int, gfp_t); 40 struct ts_config * (*init)(const void *, unsigned int, gfp_t, int);
43 unsigned int (*find)(struct ts_config *, 41 unsigned int (*find)(struct ts_config *,
44 struct ts_state *); 42 struct ts_state *);
45 void (*destroy)(struct ts_config *); 43 void (*destroy)(struct ts_config *);
@@ -52,12 +50,14 @@ struct ts_ops
52/** 50/**
53 * struct ts_config - search configuration 51 * struct ts_config - search configuration
54 * @ops: operations of chosen algorithm 52 * @ops: operations of chosen algorithm
53 * @flags: flags
55 * @get_next_block: callback to fetch the next block to search in 54 * @get_next_block: callback to fetch the next block to search in
56 * @finish: callback to finalize a search 55 * @finish: callback to finalize a search
57 */ 56 */
58struct ts_config 57struct ts_config
59{ 58{
60 struct ts_ops *ops; 59 struct ts_ops *ops;
60 int flags;
61 61
62 /** 62 /**
63 * get_next_block - fetch next block of data 63 * get_next_block - fetch next block of data
@@ -162,11 +162,10 @@ static inline struct ts_config *alloc_ts_config(size_t payload,
162{ 162{
163 struct ts_config *conf; 163 struct ts_config *conf;
164 164
165 conf = kmalloc(TS_PRIV_ALIGN(sizeof(*conf)) + payload, gfp_mask); 165 conf = kzalloc(TS_PRIV_ALIGN(sizeof(*conf)) + payload, gfp_mask);
166 if (conf == NULL) 166 if (conf == NULL)
167 return ERR_PTR(-ENOMEM); 167 return ERR_PTR(-ENOMEM);
168 168
169 memset(conf, 0, TS_PRIV_ALIGN(sizeof(*conf)) + payload);
170 return conf; 169 return conf;
171} 170}
172 171
diff --git a/include/linux/tipc_config.h b/include/linux/tipc_config.h
index b0c916d1f375..2bc6fa4adeb5 100644
--- a/include/linux/tipc_config.h
+++ b/include/linux/tipc_config.h
@@ -2,7 +2,7 @@
2 * include/linux/tipc_config.h: Include file for TIPC configuration interface 2 * include/linux/tipc_config.h: Include file for TIPC configuration interface
3 * 3 *
4 * Copyright (c) 2003-2006, Ericsson AB 4 * Copyright (c) 2003-2006, Ericsson AB
5 * Copyright (c) 2005, Wind River Systems 5 * Copyright (c) 2005-2007, Wind River Systems
6 * All rights reserved. 6 * All rights reserved.
7 * 7 *
8 * Redistribution and use in source and binary forms, with or without 8 * Redistribution and use in source and binary forms, with or without
@@ -136,6 +136,14 @@
136#define TIPC_CMD_SET_NETID 0x800B /* tx unsigned, rx none */ 136#define TIPC_CMD_SET_NETID 0x800B /* tx unsigned, rx none */
137 137
138/* 138/*
139 * Reserved commands:
140 * May not be issued by any process.
141 * Used internally by TIPC.
142 */
143
144#define TIPC_CMD_NOT_NET_ADMIN 0xC001 /* tx none, rx none */
145
146/*
139 * TLV types defined for TIPC 147 * TLV types defined for TIPC
140 */ 148 */
141 149
diff --git a/include/linux/tty.h b/include/linux/tty.h
index 324a3b231d40..4e5833073aa6 100644
--- a/include/linux/tty.h
+++ b/include/linux/tty.h
@@ -71,7 +71,8 @@ struct tty_bufhead {
71 struct tty_buffer *head; /* Queue head */ 71 struct tty_buffer *head; /* Queue head */
72 struct tty_buffer *tail; /* Active buffer */ 72 struct tty_buffer *tail; /* Active buffer */
73 struct tty_buffer *free; /* Free queue head */ 73 struct tty_buffer *free; /* Free queue head */
74 int memory_used; /* Buffer space used excluding free queue */ 74 int memory_used; /* Buffer space used excluding
75 free queue */
75}; 76};
76/* 77/*
77 * When a break, frame error, or parity error happens, these codes are 78 * When a break, frame error, or parity error happens, these codes are
@@ -101,71 +102,96 @@ struct tty_bufhead {
101#define LNEXT_CHAR(tty) ((tty)->termios->c_cc[VLNEXT]) 102#define LNEXT_CHAR(tty) ((tty)->termios->c_cc[VLNEXT])
102#define EOL2_CHAR(tty) ((tty)->termios->c_cc[VEOL2]) 103#define EOL2_CHAR(tty) ((tty)->termios->c_cc[VEOL2])
103 104
104#define _I_FLAG(tty,f) ((tty)->termios->c_iflag & (f)) 105#define _I_FLAG(tty, f) ((tty)->termios->c_iflag & (f))
105#define _O_FLAG(tty,f) ((tty)->termios->c_oflag & (f)) 106#define _O_FLAG(tty, f) ((tty)->termios->c_oflag & (f))
106#define _C_FLAG(tty,f) ((tty)->termios->c_cflag & (f)) 107#define _C_FLAG(tty, f) ((tty)->termios->c_cflag & (f))
107#define _L_FLAG(tty,f) ((tty)->termios->c_lflag & (f)) 108#define _L_FLAG(tty, f) ((tty)->termios->c_lflag & (f))
108 109
109#define I_IGNBRK(tty) _I_FLAG((tty),IGNBRK) 110#define I_IGNBRK(tty) _I_FLAG((tty), IGNBRK)
110#define I_BRKINT(tty) _I_FLAG((tty),BRKINT) 111#define I_BRKINT(tty) _I_FLAG((tty), BRKINT)
111#define I_IGNPAR(tty) _I_FLAG((tty),IGNPAR) 112#define I_IGNPAR(tty) _I_FLAG((tty), IGNPAR)
112#define I_PARMRK(tty) _I_FLAG((tty),PARMRK) 113#define I_PARMRK(tty) _I_FLAG((tty), PARMRK)
113#define I_INPCK(tty) _I_FLAG((tty),INPCK) 114#define I_INPCK(tty) _I_FLAG((tty), INPCK)
114#define I_ISTRIP(tty) _I_FLAG((tty),ISTRIP) 115#define I_ISTRIP(tty) _I_FLAG((tty), ISTRIP)
115#define I_INLCR(tty) _I_FLAG((tty),INLCR) 116#define I_INLCR(tty) _I_FLAG((tty), INLCR)
116#define I_IGNCR(tty) _I_FLAG((tty),IGNCR) 117#define I_IGNCR(tty) _I_FLAG((tty), IGNCR)
117#define I_ICRNL(tty) _I_FLAG((tty),ICRNL) 118#define I_ICRNL(tty) _I_FLAG((tty), ICRNL)
118#define I_IUCLC(tty) _I_FLAG((tty),IUCLC) 119#define I_IUCLC(tty) _I_FLAG((tty), IUCLC)
119#define I_IXON(tty) _I_FLAG((tty),IXON) 120#define I_IXON(tty) _I_FLAG((tty), IXON)
120#define I_IXANY(tty) _I_FLAG((tty),IXANY) 121#define I_IXANY(tty) _I_FLAG((tty), IXANY)
121#define I_IXOFF(tty) _I_FLAG((tty),IXOFF) 122#define I_IXOFF(tty) _I_FLAG((tty), IXOFF)
122#define I_IMAXBEL(tty) _I_FLAG((tty),IMAXBEL) 123#define I_IMAXBEL(tty) _I_FLAG((tty), IMAXBEL)
123#define I_IUTF8(tty) _I_FLAG((tty),IUTF8) 124#define I_IUTF8(tty) _I_FLAG((tty), IUTF8)
124 125
125#define O_OPOST(tty) _O_FLAG((tty),OPOST) 126#define O_OPOST(tty) _O_FLAG((tty), OPOST)
126#define O_OLCUC(tty) _O_FLAG((tty),OLCUC) 127#define O_OLCUC(tty) _O_FLAG((tty), OLCUC)
127#define O_ONLCR(tty) _O_FLAG((tty),ONLCR) 128#define O_ONLCR(tty) _O_FLAG((tty), ONLCR)
128#define O_OCRNL(tty) _O_FLAG((tty),OCRNL) 129#define O_OCRNL(tty) _O_FLAG((tty), OCRNL)
129#define O_ONOCR(tty) _O_FLAG((tty),ONOCR) 130#define O_ONOCR(tty) _O_FLAG((tty), ONOCR)
130#define O_ONLRET(tty) _O_FLAG((tty),ONLRET) 131#define O_ONLRET(tty) _O_FLAG((tty), ONLRET)
131#define O_OFILL(tty) _O_FLAG((tty),OFILL) 132#define O_OFILL(tty) _O_FLAG((tty), OFILL)
132#define O_OFDEL(tty) _O_FLAG((tty),OFDEL) 133#define O_OFDEL(tty) _O_FLAG((tty), OFDEL)
133#define O_NLDLY(tty) _O_FLAG((tty),NLDLY) 134#define O_NLDLY(tty) _O_FLAG((tty), NLDLY)
134#define O_CRDLY(tty) _O_FLAG((tty),CRDLY) 135#define O_CRDLY(tty) _O_FLAG((tty), CRDLY)
135#define O_TABDLY(tty) _O_FLAG((tty),TABDLY) 136#define O_TABDLY(tty) _O_FLAG((tty), TABDLY)
136#define O_BSDLY(tty) _O_FLAG((tty),BSDLY) 137#define O_BSDLY(tty) _O_FLAG((tty), BSDLY)
137#define O_VTDLY(tty) _O_FLAG((tty),VTDLY) 138#define O_VTDLY(tty) _O_FLAG((tty), VTDLY)
138#define O_FFDLY(tty) _O_FLAG((tty),FFDLY) 139#define O_FFDLY(tty) _O_FLAG((tty), FFDLY)
139 140
140#define C_BAUD(tty) _C_FLAG((tty),CBAUD) 141#define C_BAUD(tty) _C_FLAG((tty), CBAUD)
141#define C_CSIZE(tty) _C_FLAG((tty),CSIZE) 142#define C_CSIZE(tty) _C_FLAG((tty), CSIZE)
142#define C_CSTOPB(tty) _C_FLAG((tty),CSTOPB) 143#define C_CSTOPB(tty) _C_FLAG((tty), CSTOPB)
143#define C_CREAD(tty) _C_FLAG((tty),CREAD) 144#define C_CREAD(tty) _C_FLAG((tty), CREAD)
144#define C_PARENB(tty) _C_FLAG((tty),PARENB) 145#define C_PARENB(tty) _C_FLAG((tty), PARENB)
145#define C_PARODD(tty) _C_FLAG((tty),PARODD) 146#define C_PARODD(tty) _C_FLAG((tty), PARODD)
146#define C_HUPCL(tty) _C_FLAG((tty),HUPCL) 147#define C_HUPCL(tty) _C_FLAG((tty), HUPCL)
147#define C_CLOCAL(tty) _C_FLAG((tty),CLOCAL) 148#define C_CLOCAL(tty) _C_FLAG((tty), CLOCAL)
148#define C_CIBAUD(tty) _C_FLAG((tty),CIBAUD) 149#define C_CIBAUD(tty) _C_FLAG((tty), CIBAUD)
149#define C_CRTSCTS(tty) _C_FLAG((tty),CRTSCTS) 150#define C_CRTSCTS(tty) _C_FLAG((tty), CRTSCTS)
150 151
151#define L_ISIG(tty) _L_FLAG((tty),ISIG) 152#define L_ISIG(tty) _L_FLAG((tty), ISIG)
152#define L_ICANON(tty) _L_FLAG((tty),ICANON) 153#define L_ICANON(tty) _L_FLAG((tty), ICANON)
153#define L_XCASE(tty) _L_FLAG((tty),XCASE) 154#define L_XCASE(tty) _L_FLAG((tty), XCASE)
154#define L_ECHO(tty) _L_FLAG((tty),ECHO) 155#define L_ECHO(tty) _L_FLAG((tty), ECHO)
155#define L_ECHOE(tty) _L_FLAG((tty),ECHOE) 156#define L_ECHOE(tty) _L_FLAG((tty), ECHOE)
156#define L_ECHOK(tty) _L_FLAG((tty),ECHOK) 157#define L_ECHOK(tty) _L_FLAG((tty), ECHOK)
157#define L_ECHONL(tty) _L_FLAG((tty),ECHONL) 158#define L_ECHONL(tty) _L_FLAG((tty), ECHONL)
158#define L_NOFLSH(tty) _L_FLAG((tty),NOFLSH) 159#define L_NOFLSH(tty) _L_FLAG((tty), NOFLSH)
159#define L_TOSTOP(tty) _L_FLAG((tty),TOSTOP) 160#define L_TOSTOP(tty) _L_FLAG((tty), TOSTOP)
160#define L_ECHOCTL(tty) _L_FLAG((tty),ECHOCTL) 161#define L_ECHOCTL(tty) _L_FLAG((tty), ECHOCTL)
161#define L_ECHOPRT(tty) _L_FLAG((tty),ECHOPRT) 162#define L_ECHOPRT(tty) _L_FLAG((tty), ECHOPRT)
162#define L_ECHOKE(tty) _L_FLAG((tty),ECHOKE) 163#define L_ECHOKE(tty) _L_FLAG((tty), ECHOKE)
163#define L_FLUSHO(tty) _L_FLAG((tty),FLUSHO) 164#define L_FLUSHO(tty) _L_FLAG((tty), FLUSHO)
164#define L_PENDIN(tty) _L_FLAG((tty),PENDIN) 165#define L_PENDIN(tty) _L_FLAG((tty), PENDIN)
165#define L_IEXTEN(tty) _L_FLAG((tty),IEXTEN) 166#define L_IEXTEN(tty) _L_FLAG((tty), IEXTEN)
166 167
167struct device; 168struct device;
168struct signal_struct; 169struct signal_struct;
170
171/*
172 * Port level information. Each device keeps its own port level information
173 * so provide a common structure for those ports wanting to use common support
174 * routines.
175 *
176 * The tty port has a different lifetime to the tty so must be kept apart.
177 * In addition be careful as tty -> port mappings are valid for the life
178 * of the tty object but in many cases port -> tty mappings are valid only
179 * until a hangup so don't use the wrong path.
180 */
181
182struct tty_port {
183 struct tty_struct *tty; /* Back pointer */
184 int blocked_open; /* Waiting to open */
185 int count; /* Usage count */
186 wait_queue_head_t open_wait; /* Open waiters */
187 wait_queue_head_t close_wait; /* Close waiters */
188 unsigned long flags; /* TTY flags ASY_*/
189 struct mutex mutex; /* Locking */
190 unsigned char *xmit_buf; /* Optional buffer */
191 int close_delay; /* Close port delay */
192 int closing_wait; /* Delay for output */
193};
194
169/* 195/*
170 * Where all of the state associated with a tty is kept while the tty 196 * Where all of the state associated with a tty is kept while the tty
171 * is open. Since the termios state should be kept even if the tty 197 * is open. Since the termios state should be kept even if the tty
@@ -185,6 +211,7 @@ struct tty_struct {
185 struct tty_driver *driver; 211 struct tty_driver *driver;
186 const struct tty_operations *ops; 212 const struct tty_operations *ops;
187 int index; 213 int index;
214 /* The ldisc objects are protected by tty_ldisc_lock at the moment */
188 struct tty_ldisc ldisc; 215 struct tty_ldisc ldisc;
189 struct mutex termios_mutex; 216 struct mutex termios_mutex;
190 spinlock_t ctrl_lock; 217 spinlock_t ctrl_lock;
@@ -213,7 +240,7 @@ struct tty_struct {
213 struct list_head tty_files; 240 struct list_head tty_files;
214 241
215#define N_TTY_BUF_SIZE 4096 242#define N_TTY_BUF_SIZE 4096
216 243
217 /* 244 /*
218 * The following is data for the N_TTY line discipline. For 245 * The following is data for the N_TTY line discipline. For
219 * historical reasons, this is included in the tty structure. 246 * historical reasons, this is included in the tty structure.
@@ -241,6 +268,7 @@ struct tty_struct {
241 spinlock_t read_lock; 268 spinlock_t read_lock;
242 /* If the tty has a pending do_SAK, queue it here - akpm */ 269 /* If the tty has a pending do_SAK, queue it here - akpm */
243 struct work_struct SAK_work; 270 struct work_struct SAK_work;
271 struct tty_port *port;
244}; 272};
245 273
246/* tty magic number */ 274/* tty magic number */
@@ -248,14 +276,14 @@ struct tty_struct {
248 276
249/* 277/*
250 * These bits are used in the flags field of the tty structure. 278 * These bits are used in the flags field of the tty structure.
251 * 279 *
252 * So that interrupts won't be able to mess up the queues, 280 * So that interrupts won't be able to mess up the queues,
253 * copy_to_cooked must be atomic with respect to itself, as must 281 * copy_to_cooked must be atomic with respect to itself, as must
254 * tty->write. Thus, you must use the inline functions set_bit() and 282 * tty->write. Thus, you must use the inline functions set_bit() and
255 * clear_bit() to make things atomic. 283 * clear_bit() to make things atomic.
256 */ 284 */
257#define TTY_THROTTLED 0 /* Call unthrottle() at threshold min */ 285#define TTY_THROTTLED 0 /* Call unthrottle() at threshold min */
258#define TTY_IO_ERROR 1 /* Canse an I/O error (may be no ldisc too) */ 286#define TTY_IO_ERROR 1 /* Cause an I/O error (may be no ldisc too) */
259#define TTY_OTHER_CLOSED 2 /* Other side (if any) has closed */ 287#define TTY_OTHER_CLOSED 2 /* Other side (if any) has closed */
260#define TTY_EXCLUSIVE 3 /* Exclusive open mode */ 288#define TTY_EXCLUSIVE 3 /* Exclusive open mode */
261#define TTY_DEBUG 4 /* Debugging */ 289#define TTY_DEBUG 4 /* Debugging */
@@ -285,11 +313,11 @@ extern int vcs_init(void);
285extern int tty_paranoia_check(struct tty_struct *tty, struct inode *inode, 313extern int tty_paranoia_check(struct tty_struct *tty, struct inode *inode,
286 const char *routine); 314 const char *routine);
287extern char *tty_name(struct tty_struct *tty, char *buf); 315extern char *tty_name(struct tty_struct *tty, char *buf);
288extern void tty_wait_until_sent(struct tty_struct * tty, long timeout); 316extern void tty_wait_until_sent(struct tty_struct *tty, long timeout);
289extern int tty_check_change(struct tty_struct * tty); 317extern int tty_check_change(struct tty_struct *tty);
290extern void stop_tty(struct tty_struct * tty); 318extern void stop_tty(struct tty_struct *tty);
291extern void start_tty(struct tty_struct * tty); 319extern void start_tty(struct tty_struct *tty);
292extern int tty_register_ldisc(int disc, struct tty_ldisc *new_ldisc); 320extern int tty_register_ldisc(int disc, struct tty_ldisc_ops *new_ldisc);
293extern int tty_unregister_ldisc(int disc); 321extern int tty_unregister_ldisc(int disc);
294extern int tty_register_driver(struct tty_driver *driver); 322extern int tty_register_driver(struct tty_driver *driver);
295extern int tty_unregister_driver(struct tty_driver *driver); 323extern int tty_unregister_driver(struct tty_driver *driver);
@@ -310,10 +338,10 @@ extern int is_current_pgrp_orphaned(void);
310extern struct pid *tty_get_pgrp(struct tty_struct *tty); 338extern struct pid *tty_get_pgrp(struct tty_struct *tty);
311extern int is_ignored(int sig); 339extern int is_ignored(int sig);
312extern int tty_signal(int sig, struct tty_struct *tty); 340extern int tty_signal(int sig, struct tty_struct *tty);
313extern void tty_hangup(struct tty_struct * tty); 341extern void tty_hangup(struct tty_struct *tty);
314extern void tty_vhangup(struct tty_struct * tty); 342extern void tty_vhangup(struct tty_struct *tty);
315extern void tty_unhangup(struct file *filp); 343extern void tty_unhangup(struct file *filp);
316extern int tty_hung_up_p(struct file * filp); 344extern int tty_hung_up_p(struct file *filp);
317extern void do_SAK(struct tty_struct *tty); 345extern void do_SAK(struct tty_struct *tty);
318extern void __do_SAK(struct tty_struct *tty); 346extern void __do_SAK(struct tty_struct *tty);
319extern void disassociate_ctty(int priv); 347extern void disassociate_ctty(int priv);
@@ -322,17 +350,17 @@ extern void tty_flip_buffer_push(struct tty_struct *tty);
322extern speed_t tty_get_baud_rate(struct tty_struct *tty); 350extern speed_t tty_get_baud_rate(struct tty_struct *tty);
323extern speed_t tty_termios_baud_rate(struct ktermios *termios); 351extern speed_t tty_termios_baud_rate(struct ktermios *termios);
324extern speed_t tty_termios_input_baud_rate(struct ktermios *termios); 352extern speed_t tty_termios_input_baud_rate(struct ktermios *termios);
325extern void tty_termios_encode_baud_rate(struct ktermios *termios, speed_t ibaud, speed_t obaud); 353extern void tty_termios_encode_baud_rate(struct ktermios *termios,
326extern void tty_encode_baud_rate(struct tty_struct *tty, speed_t ibaud, speed_t obaud); 354 speed_t ibaud, speed_t obaud);
355extern void tty_encode_baud_rate(struct tty_struct *tty,
356 speed_t ibaud, speed_t obaud);
327extern void tty_termios_copy_hw(struct ktermios *new, struct ktermios *old); 357extern void tty_termios_copy_hw(struct ktermios *new, struct ktermios *old);
328extern int tty_termios_hw_change(struct ktermios *a, struct ktermios *b); 358extern int tty_termios_hw_change(struct ktermios *a, struct ktermios *b);
329 359
330extern struct tty_ldisc *tty_ldisc_ref(struct tty_struct *); 360extern struct tty_ldisc *tty_ldisc_ref(struct tty_struct *);
331extern void tty_ldisc_deref(struct tty_ldisc *); 361extern void tty_ldisc_deref(struct tty_ldisc *);
332extern struct tty_ldisc *tty_ldisc_ref_wait(struct tty_struct *); 362extern struct tty_ldisc *tty_ldisc_ref_wait(struct tty_struct *);
333 363extern const struct file_operations tty_ldiscs_proc_fops;
334extern struct tty_ldisc *tty_ldisc_get(int);
335extern void tty_ldisc_put(int);
336 364
337extern void tty_wakeup(struct tty_struct *tty); 365extern void tty_wakeup(struct tty_struct *tty);
338extern void tty_ldisc_flush(struct tty_struct *tty); 366extern void tty_ldisc_flush(struct tty_struct *tty);
@@ -351,10 +379,14 @@ extern void tty_write_unlock(struct tty_struct *tty);
351extern int tty_write_lock(struct tty_struct *tty, int ndelay); 379extern int tty_write_lock(struct tty_struct *tty, int ndelay);
352#define tty_is_writelocked(tty) (mutex_is_locked(&tty->atomic_write_lock)) 380#define tty_is_writelocked(tty) (mutex_is_locked(&tty->atomic_write_lock))
353 381
382extern void tty_port_init(struct tty_port *port);
383extern int tty_port_alloc_xmit_buf(struct tty_port *port);
384extern void tty_port_free_xmit_buf(struct tty_port *port);
385
354 386
355 387
356/* n_tty.c */ 388/* n_tty.c */
357extern struct tty_ldisc tty_ldisc_N_TTY; 389extern struct tty_ldisc_ops tty_ldisc_N_TTY;
358 390
359/* tty_audit.c */ 391/* tty_audit.c */
360#ifdef CONFIG_AUDIT 392#ifdef CONFIG_AUDIT
@@ -363,7 +395,8 @@ extern void tty_audit_add_data(struct tty_struct *tty, unsigned char *data,
363extern void tty_audit_exit(void); 395extern void tty_audit_exit(void);
364extern void tty_audit_fork(struct signal_struct *sig); 396extern void tty_audit_fork(struct signal_struct *sig);
365extern void tty_audit_push(struct tty_struct *tty); 397extern void tty_audit_push(struct tty_struct *tty);
366extern void tty_audit_push_task(struct task_struct *tsk, uid_t loginuid, u32 sessionid); 398extern void tty_audit_push_task(struct task_struct *tsk,
399 uid_t loginuid, u32 sessionid);
367#else 400#else
368static inline void tty_audit_add_data(struct tty_struct *tty, 401static inline void tty_audit_add_data(struct tty_struct *tty,
369 unsigned char *data, size_t size) 402 unsigned char *data, size_t size)
@@ -378,19 +411,20 @@ static inline void tty_audit_fork(struct signal_struct *sig)
378static inline void tty_audit_push(struct tty_struct *tty) 411static inline void tty_audit_push(struct tty_struct *tty)
379{ 412{
380} 413}
381static inline void tty_audit_push_task(struct task_struct *tsk, uid_t loginuid, u32 sessionid) 414static inline void tty_audit_push_task(struct task_struct *tsk,
415 uid_t loginuid, u32 sessionid)
382{ 416{
383} 417}
384#endif 418#endif
385 419
386/* tty_ioctl.c */ 420/* tty_ioctl.c */
387extern int n_tty_ioctl(struct tty_struct * tty, struct file * file, 421extern int n_tty_ioctl(struct tty_struct *tty, struct file *file,
388 unsigned int cmd, unsigned long arg); 422 unsigned int cmd, unsigned long arg);
389 423
390/* serial.c */ 424/* serial.c */
391 425
392extern void serial_console_init(void); 426extern void serial_console_init(void);
393 427
394/* pcxx.c */ 428/* pcxx.c */
395 429
396extern int pcxe_open(struct tty_struct *tty, struct file *filp); 430extern int pcxe_open(struct tty_struct *tty, struct file *filp);
@@ -401,7 +435,7 @@ extern void console_print(const char *);
401 435
402/* vt.c */ 436/* vt.c */
403 437
404extern int vt_ioctl(struct tty_struct *tty, struct file * file, 438extern int vt_ioctl(struct tty_struct *tty, struct file *file,
405 unsigned int cmd, unsigned long arg); 439 unsigned int cmd, unsigned long arg);
406 440
407#endif /* __KERNEL__ */ 441#endif /* __KERNEL__ */
diff --git a/include/linux/tty_ldisc.h b/include/linux/tty_ldisc.h
index 6226504d9108..40f38d896777 100644
--- a/include/linux/tty_ldisc.h
+++ b/include/linux/tty_ldisc.h
@@ -104,7 +104,7 @@
104#include <linux/fs.h> 104#include <linux/fs.h>
105#include <linux/wait.h> 105#include <linux/wait.h>
106 106
107struct tty_ldisc { 107struct tty_ldisc_ops {
108 int magic; 108 int magic;
109 char *name; 109 char *name;
110 int num; 110 int num;
@@ -142,6 +142,11 @@ struct tty_ldisc {
142 int refcount; 142 int refcount;
143}; 143};
144 144
145struct tty_ldisc {
146 struct tty_ldisc_ops *ops;
147 int refcount;
148};
149
145#define TTY_LDISC_MAGIC 0x5403 150#define TTY_LDISC_MAGIC 0x5403
146 151
147#define LDISC_FLAG_DEFINED 0x00000001 152#define LDISC_FLAG_DEFINED 0x00000001
diff --git a/include/linux/udp.h b/include/linux/udp.h
index 581ca2c14c52..0cf5c4c0ec81 100644
--- a/include/linux/udp.h
+++ b/include/linux/udp.h
@@ -38,6 +38,7 @@ struct udphdr {
38#ifdef __KERNEL__ 38#ifdef __KERNEL__
39#include <net/inet_sock.h> 39#include <net/inet_sock.h>
40#include <linux/skbuff.h> 40#include <linux/skbuff.h>
41#include <net/netns/hash.h>
41 42
42static inline struct udphdr *udp_hdr(const struct sk_buff *skb) 43static inline struct udphdr *udp_hdr(const struct sk_buff *skb)
43{ 44{
@@ -46,6 +47,11 @@ static inline struct udphdr *udp_hdr(const struct sk_buff *skb)
46 47
47#define UDP_HTABLE_SIZE 128 48#define UDP_HTABLE_SIZE 128
48 49
50static inline int udp_hashfn(struct net *net, const unsigned num)
51{
52 return (num + net_hash_mix(net)) & (UDP_HTABLE_SIZE - 1);
53}
54
49struct udp_sock { 55struct udp_sock {
50 /* inet_sock has to be the first member */ 56 /* inet_sock has to be the first member */
51 struct inet_sock inet; 57 struct inet_sock inet;
diff --git a/include/linux/usb/rndis_host.h b/include/linux/usb/rndis_host.h
index 29d6458ecb8d..0a6e6d4b929a 100644
--- a/include/linux/usb/rndis_host.h
+++ b/include/linux/usb/rndis_host.h
@@ -260,7 +260,8 @@ struct rndis_keepalive_c { /* IN (optionally OUT) */
260 260
261 261
262extern void rndis_status(struct usbnet *dev, struct urb *urb); 262extern void rndis_status(struct usbnet *dev, struct urb *urb);
263extern int rndis_command(struct usbnet *dev, struct rndis_msg_hdr *buf); 263extern int
264rndis_command(struct usbnet *dev, struct rndis_msg_hdr *buf, int buflen);
264extern int 265extern int
265generic_rndis_bind(struct usbnet *dev, struct usb_interface *intf, int flags); 266generic_rndis_bind(struct usbnet *dev, struct usb_interface *intf, int flags);
266extern void rndis_unbind(struct usbnet *dev, struct usb_interface *intf); 267extern void rndis_unbind(struct usbnet *dev, struct usb_interface *intf);
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h
index 4a535ea1e123..2e66a95e8d32 100644
--- a/include/linux/videodev2.h
+++ b/include/linux/videodev2.h
@@ -246,6 +246,7 @@ struct v4l2_capability
246#define V4L2_CAP_SLICED_VBI_OUTPUT 0x00000080 /* Is a sliced VBI output device */ 246#define V4L2_CAP_SLICED_VBI_OUTPUT 0x00000080 /* Is a sliced VBI output device */
247#define V4L2_CAP_RDS_CAPTURE 0x00000100 /* RDS data capture */ 247#define V4L2_CAP_RDS_CAPTURE 0x00000100 /* RDS data capture */
248#define V4L2_CAP_VIDEO_OUTPUT_OVERLAY 0x00000200 /* Can do video output overlay */ 248#define V4L2_CAP_VIDEO_OUTPUT_OVERLAY 0x00000200 /* Can do video output overlay */
249#define V4L2_CAP_HW_FREQ_SEEK 0x00000400 /* Can do hardware frequency seek */
249 250
250#define V4L2_CAP_TUNER 0x00010000 /* has a tuner */ 251#define V4L2_CAP_TUNER 0x00010000 /* has a tuner */
251#define V4L2_CAP_AUDIO 0x00020000 /* has audio support */ 252#define V4L2_CAP_AUDIO 0x00020000 /* has audio support */
@@ -309,6 +310,7 @@ struct v4l2_pix_format
309 310
310/* see http://www.siliconimaging.com/RGB%20Bayer.htm */ 311/* see http://www.siliconimaging.com/RGB%20Bayer.htm */
311#define V4L2_PIX_FMT_SBGGR8 v4l2_fourcc('B','A','8','1') /* 8 BGBG.. GRGR.. */ 312#define V4L2_PIX_FMT_SBGGR8 v4l2_fourcc('B','A','8','1') /* 8 BGBG.. GRGR.. */
313#define V4L2_PIX_FMT_SGBRG8 v4l2_fourcc('G','B','R','G') /* 8 GBGB.. RGRG.. */
312#define V4L2_PIX_FMT_SBGGR16 v4l2_fourcc('B','Y','R','2') /* 16 BGBG.. GRGR.. */ 314#define V4L2_PIX_FMT_SBGGR16 v4l2_fourcc('B','Y','R','2') /* 16 BGBG.. GRGR.. */
313 315
314/* compressed formats */ 316/* compressed formats */
@@ -323,6 +325,9 @@ struct v4l2_pix_format
323#define V4L2_PIX_FMT_PWC1 v4l2_fourcc('P','W','C','1') /* pwc older webcam */ 325#define V4L2_PIX_FMT_PWC1 v4l2_fourcc('P','W','C','1') /* pwc older webcam */
324#define V4L2_PIX_FMT_PWC2 v4l2_fourcc('P','W','C','2') /* pwc newer webcam */ 326#define V4L2_PIX_FMT_PWC2 v4l2_fourcc('P','W','C','2') /* pwc newer webcam */
325#define V4L2_PIX_FMT_ET61X251 v4l2_fourcc('E','6','2','5') /* ET61X251 compression */ 327#define V4L2_PIX_FMT_ET61X251 v4l2_fourcc('E','6','2','5') /* ET61X251 compression */
328#define V4L2_PIX_FMT_SPCA501 v4l2_fourcc('S','5','0','1') /* YUYV per line */
329#define V4L2_PIX_FMT_SPCA561 v4l2_fourcc('S','5','6','1') /* compressed GBRG bayer */
330#define V4L2_PIX_FMT_PAC207 v4l2_fourcc('P','2','0','7') /* compressed BGGR bayer */
326 331
327/* 332/*
328 * F O R M A T E N U M E R A T I O N 333 * F O R M A T E N U M E R A T I O N
@@ -1156,6 +1161,14 @@ struct v4l2_frequency
1156 __u32 reserved[8]; 1161 __u32 reserved[8];
1157}; 1162};
1158 1163
1164struct v4l2_hw_freq_seek {
1165 __u32 tuner;
1166 enum v4l2_tuner_type type;
1167 __u32 seek_upward;
1168 __u32 wrap_around;
1169 __u32 reserved[8];
1170};
1171
1159/* 1172/*
1160 * A U D I O 1173 * A U D I O
1161 */ 1174 */
@@ -1441,6 +1454,7 @@ struct v4l2_chip_ident {
1441 1454
1442#define VIDIOC_G_CHIP_IDENT _IOWR ('V', 81, struct v4l2_chip_ident) 1455#define VIDIOC_G_CHIP_IDENT _IOWR ('V', 81, struct v4l2_chip_ident)
1443#endif 1456#endif
1457#define VIDIOC_S_HW_FREQ_SEEK _IOW ('V', 82, struct v4l2_hw_freq_seek)
1444 1458
1445#ifdef __OLD_VIDIOC_ 1459#ifdef __OLD_VIDIOC_
1446/* for compatibility, will go away some day */ 1460/* for compatibility, will go away some day */
diff --git a/include/linux/wanrouter.h b/include/linux/wanrouter.h
index 3add87465b1f..e0aa39612eba 100644
--- a/include/linux/wanrouter.h
+++ b/include/linux/wanrouter.h
@@ -522,7 +522,7 @@ extern int wanrouter_proc_init(void);
522extern void wanrouter_proc_cleanup(void); 522extern void wanrouter_proc_cleanup(void);
523extern int wanrouter_proc_add(struct wan_device *wandev); 523extern int wanrouter_proc_add(struct wan_device *wandev);
524extern int wanrouter_proc_delete(struct wan_device *wandev); 524extern int wanrouter_proc_delete(struct wan_device *wandev);
525extern int wanrouter_ioctl( struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg); 525extern long wanrouter_ioctl(struct file *file, unsigned int cmd, unsigned long arg);
526 526
527/* Public Data */ 527/* Public Data */
528/* list of registered devices */ 528/* list of registered devices */
diff --git a/include/linux/wireless.h b/include/linux/wireless.h
index 0a9b5b41ed67..d7958f9b52cb 100644
--- a/include/linux/wireless.h
+++ b/include/linux/wireless.h
@@ -611,6 +611,7 @@
611#define IW_ENCODE_ALG_WEP 1 611#define IW_ENCODE_ALG_WEP 1
612#define IW_ENCODE_ALG_TKIP 2 612#define IW_ENCODE_ALG_TKIP 2
613#define IW_ENCODE_ALG_CCMP 3 613#define IW_ENCODE_ALG_CCMP 3
614#define IW_ENCODE_ALG_PMK 4
614/* struct iw_encode_ext ->ext_flags */ 615/* struct iw_encode_ext ->ext_flags */
615#define IW_ENCODE_EXT_TX_SEQ_VALID 0x00000001 616#define IW_ENCODE_EXT_TX_SEQ_VALID 0x00000001
616#define IW_ENCODE_EXT_RX_SEQ_VALID 0x00000002 617#define IW_ENCODE_EXT_RX_SEQ_VALID 0x00000002
@@ -630,6 +631,7 @@
630#define IW_ENC_CAPA_WPA2 0x00000002 631#define IW_ENC_CAPA_WPA2 0x00000002
631#define IW_ENC_CAPA_CIPHER_TKIP 0x00000004 632#define IW_ENC_CAPA_CIPHER_TKIP 0x00000004
632#define IW_ENC_CAPA_CIPHER_CCMP 0x00000008 633#define IW_ENC_CAPA_CIPHER_CCMP 0x00000008
634#define IW_ENC_CAPA_4WAY_HANDSHAKE 0x00000010
633 635
634/* Event capability macros - in (struct iw_range *)->event_capa 636/* Event capability macros - in (struct iw_range *)->event_capa
635 * Because we have more than 32 possible events, we use an array of 637 * Because we have more than 32 possible events, we use an array of
@@ -675,6 +677,19 @@ struct iw_point
675 __u16 flags; /* Optional params */ 677 __u16 flags; /* Optional params */
676}; 678};
677 679
680#ifdef __KERNEL__
681#ifdef CONFIG_COMPAT
682
683#include <linux/compat.h>
684
685struct compat_iw_point {
686 compat_caddr_t pointer;
687 __u16 length;
688 __u16 flags;
689};
690#endif
691#endif
692
678/* 693/*
679 * A frequency 694 * A frequency
680 * For numbers lower than 10^9, we encode the number in 'm' and 695 * For numbers lower than 10^9, we encode the number in 'm' and
@@ -1098,6 +1113,21 @@ struct iw_event
1098#define IW_EV_POINT_LEN (IW_EV_LCP_LEN + sizeof(struct iw_point) - \ 1113#define IW_EV_POINT_LEN (IW_EV_LCP_LEN + sizeof(struct iw_point) - \
1099 IW_EV_POINT_OFF) 1114 IW_EV_POINT_OFF)
1100 1115
1116#ifdef __KERNEL__
1117#ifdef CONFIG_COMPAT
1118struct __compat_iw_event {
1119 __u16 len; /* Real length of this stuff */
1120 __u16 cmd; /* Wireless IOCTL */
1121 compat_caddr_t pointer;
1122};
1123#define IW_EV_COMPAT_LCP_LEN offsetof(struct __compat_iw_event, pointer)
1124#define IW_EV_COMPAT_POINT_OFF offsetof(struct compat_iw_point, length)
1125#define IW_EV_COMPAT_POINT_LEN \
1126 (IW_EV_COMPAT_LCP_LEN + sizeof(struct compat_iw_point) - \
1127 IW_EV_COMPAT_POINT_OFF)
1128#endif
1129#endif
1130
1101/* Size of the Event prefix when packed in stream */ 1131/* Size of the Event prefix when packed in stream */
1102#define IW_EV_LCP_PK_LEN (4) 1132#define IW_EV_LCP_PK_LEN (4)
1103/* Size of the various events when packed in stream */ 1133/* Size of the various events when packed in stream */
diff --git a/include/media/cx2341x.h b/include/media/cx2341x.h
index 5f4608e88476..9ec4d5889ef5 100644
--- a/include/media/cx2341x.h
+++ b/include/media/cx2341x.h
@@ -27,6 +27,7 @@ enum cx2341x_port {
27 27
28enum cx2341x_cap { 28enum cx2341x_cap {
29 CX2341X_CAP_HAS_SLICED_VBI = 1 << 0, 29 CX2341X_CAP_HAS_SLICED_VBI = 1 << 0,
30 CX2341X_CAP_HAS_TS = 1 << 1,
30}; 31};
31 32
32struct cx2341x_mpeg_params { 33struct cx2341x_mpeg_params {
@@ -88,13 +89,13 @@ typedef int (*cx2341x_mbox_func)(void *priv, u32 cmd, int in, int out,
88int cx2341x_update(void *priv, cx2341x_mbox_func func, 89int cx2341x_update(void *priv, cx2341x_mbox_func func,
89 const struct cx2341x_mpeg_params *old, 90 const struct cx2341x_mpeg_params *old,
90 const struct cx2341x_mpeg_params *new); 91 const struct cx2341x_mpeg_params *new);
91int cx2341x_ctrl_query(struct cx2341x_mpeg_params *params, 92int cx2341x_ctrl_query(const struct cx2341x_mpeg_params *params,
92 struct v4l2_queryctrl *qctrl); 93 struct v4l2_queryctrl *qctrl);
93const char **cx2341x_ctrl_get_menu(u32 id); 94const char **cx2341x_ctrl_get_menu(const struct cx2341x_mpeg_params *p, u32 id);
94int cx2341x_ext_ctrls(struct cx2341x_mpeg_params *params, int busy, 95int cx2341x_ext_ctrls(struct cx2341x_mpeg_params *params, int busy,
95 struct v4l2_ext_controls *ctrls, unsigned int cmd); 96 struct v4l2_ext_controls *ctrls, unsigned int cmd);
96void cx2341x_fill_defaults(struct cx2341x_mpeg_params *p); 97void cx2341x_fill_defaults(struct cx2341x_mpeg_params *p);
97void cx2341x_log_status(struct cx2341x_mpeg_params *p, const char *prefix); 98void cx2341x_log_status(const struct cx2341x_mpeg_params *p, const char *prefix);
98 99
99/* Firmware names */ 100/* Firmware names */
100#define CX2341X_FIRM_ENC_FILENAME "v4l-cx2341x-enc.fw" 101#define CX2341X_FIRM_ENC_FILENAME "v4l-cx2341x-enc.fw"
diff --git a/include/media/ir-kbd-i2c.h b/include/media/ir-kbd-i2c.h
index a455f7ce5ee8..00fa57eb9fde 100644
--- a/include/media/ir-kbd-i2c.h
+++ b/include/media/ir-kbd-i2c.h
@@ -19,7 +19,4 @@ struct IR_i2c {
19 char phys[32]; 19 char phys[32];
20 int (*get_key)(struct IR_i2c*, u32*, u32*); 20 int (*get_key)(struct IR_i2c*, u32*, u32*);
21}; 21};
22
23int get_key_pinnacle_grey(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw);
24int get_key_pinnacle_color(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw);
25#endif 22#endif
diff --git a/include/media/pwc-ioctl.h b/include/media/pwc-ioctl.h
index adc1254e887e..0f19779c4634 100644
--- a/include/media/pwc-ioctl.h
+++ b/include/media/pwc-ioctl.h
@@ -55,8 +55,7 @@
55#include <linux/types.h> 55#include <linux/types.h>
56#include <linux/version.h> 56#include <linux/version.h>
57 57
58 58/* Enumeration of image sizes */
59 /* Enumeration of image sizes */
60#define PSZ_SQCIF 0x00 59#define PSZ_SQCIF 0x00
61#define PSZ_QSIF 0x01 60#define PSZ_QSIF 0x01
62#define PSZ_QCIF 0x02 61#define PSZ_QCIF 0x02
diff --git a/include/media/saa7146.h b/include/media/saa7146.h
index 88b2b5a619aa..2f68f4cd0037 100644
--- a/include/media/saa7146.h
+++ b/include/media/saa7146.h
@@ -53,7 +53,7 @@ struct saa7146_vv;
53/* saa7146 page table */ 53/* saa7146 page table */
54struct saa7146_pgtable { 54struct saa7146_pgtable {
55 unsigned int size; 55 unsigned int size;
56 u32 *cpu; 56 __le32 *cpu;
57 dma_addr_t dma; 57 dma_addr_t dma;
58 /* used for offsets for u,v planes for planar capture modes */ 58 /* used for offsets for u,v planes for planar capture modes */
59 unsigned long offset; 59 unsigned long offset;
@@ -101,7 +101,7 @@ struct saa7146_extension
101struct saa7146_dma 101struct saa7146_dma
102{ 102{
103 dma_addr_t dma_handle; 103 dma_addr_t dma_handle;
104 u32 *cpu_addr; 104 __le32 *cpu_addr;
105}; 105};
106 106
107struct saa7146_dev 107struct saa7146_dev
diff --git a/include/media/sh_mobile_ceu.h b/include/media/sh_mobile_ceu.h
new file mode 100644
index 000000000000..234a4711d2ec
--- /dev/null
+++ b/include/media/sh_mobile_ceu.h
@@ -0,0 +1,12 @@
1#ifndef __ASM_SH_MOBILE_CEU_H__
2#define __ASM_SH_MOBILE_CEU_H__
3
4#include <media/soc_camera.h>
5
6struct sh_mobile_ceu_info {
7 unsigned long flags; /* SOCAM_... */
8 void (*enable_camera)(void);
9 void (*disable_camera)(void);
10};
11
12#endif /* __ASM_SH_MOBILE_CEU_H__ */
diff --git a/include/media/soc_camera.h b/include/media/soc_camera.h
index 6a8c8be7a1ae..1de98f150e99 100644
--- a/include/media/soc_camera.h
+++ b/include/media/soc_camera.h
@@ -13,7 +13,7 @@
13#define SOC_CAMERA_H 13#define SOC_CAMERA_H
14 14
15#include <linux/videodev2.h> 15#include <linux/videodev2.h>
16#include <media/videobuf-dma-sg.h> 16#include <media/videobuf-core.h>
17 17
18struct soc_camera_device { 18struct soc_camera_device {
19 struct list_head list; 19 struct list_head list;
@@ -48,15 +48,12 @@ struct soc_camera_device {
48struct soc_camera_file { 48struct soc_camera_file {
49 struct soc_camera_device *icd; 49 struct soc_camera_device *icd;
50 struct videobuf_queue vb_vidq; 50 struct videobuf_queue vb_vidq;
51 spinlock_t *lock;
52}; 51};
53 52
54struct soc_camera_host { 53struct soc_camera_host {
55 struct list_head list; 54 struct list_head list;
56 struct device dev; 55 struct device dev;
57 unsigned char nr; /* Host number */ 56 unsigned char nr; /* Host number */
58 size_t msize;
59 struct videobuf_queue_ops *vbq_ops;
60 void *priv; 57 void *priv;
61 char *drv_name; 58 char *drv_name;
62 struct soc_camera_host_ops *ops; 59 struct soc_camera_host_ops *ops;
@@ -69,13 +66,13 @@ struct soc_camera_host_ops {
69 int (*set_fmt_cap)(struct soc_camera_device *, __u32, 66 int (*set_fmt_cap)(struct soc_camera_device *, __u32,
70 struct v4l2_rect *); 67 struct v4l2_rect *);
71 int (*try_fmt_cap)(struct soc_camera_device *, struct v4l2_format *); 68 int (*try_fmt_cap)(struct soc_camera_device *, struct v4l2_format *);
69 void (*init_videobuf)(struct videobuf_queue *,
70 struct soc_camera_device *);
72 int (*reqbufs)(struct soc_camera_file *, struct v4l2_requestbuffers *); 71 int (*reqbufs)(struct soc_camera_file *, struct v4l2_requestbuffers *);
73 int (*querycap)(struct soc_camera_host *, struct v4l2_capability *); 72 int (*querycap)(struct soc_camera_host *, struct v4l2_capability *);
74 int (*try_bus_param)(struct soc_camera_device *, __u32); 73 int (*try_bus_param)(struct soc_camera_device *, __u32);
75 int (*set_bus_param)(struct soc_camera_device *, __u32); 74 int (*set_bus_param)(struct soc_camera_device *, __u32);
76 unsigned int (*poll)(struct file *, poll_table *); 75 unsigned int (*poll)(struct file *, poll_table *);
77 spinlock_t* (*spinlock_alloc)(struct soc_camera_file *);
78 void (*spinlock_free)(spinlock_t *);
79}; 76};
80 77
81struct soc_camera_link { 78struct soc_camera_link {
@@ -156,11 +153,12 @@ static inline struct v4l2_queryctrl const *soc_camera_find_qctrl(
156#define SOCAM_DATAWIDTH_8 (1 << 6) 153#define SOCAM_DATAWIDTH_8 (1 << 6)
157#define SOCAM_DATAWIDTH_9 (1 << 7) 154#define SOCAM_DATAWIDTH_9 (1 << 7)
158#define SOCAM_DATAWIDTH_10 (1 << 8) 155#define SOCAM_DATAWIDTH_10 (1 << 8)
159#define SOCAM_PCLK_SAMPLE_RISING (1 << 9) 156#define SOCAM_DATAWIDTH_16 (1 << 9)
160#define SOCAM_PCLK_SAMPLE_FALLING (1 << 10) 157#define SOCAM_PCLK_SAMPLE_RISING (1 << 10)
158#define SOCAM_PCLK_SAMPLE_FALLING (1 << 11)
161 159
162#define SOCAM_DATAWIDTH_MASK (SOCAM_DATAWIDTH_8 | SOCAM_DATAWIDTH_9 | \ 160#define SOCAM_DATAWIDTH_MASK (SOCAM_DATAWIDTH_8 | SOCAM_DATAWIDTH_9 | \
163 SOCAM_DATAWIDTH_10) 161 SOCAM_DATAWIDTH_10 | SOCAM_DATAWIDTH_16)
164 162
165static inline unsigned long soc_camera_bus_param_compatible( 163static inline unsigned long soc_camera_bus_param_compatible(
166 unsigned long camera_flags, unsigned long bus_flags) 164 unsigned long camera_flags, unsigned long bus_flags)
diff --git a/include/media/soc_camera_platform.h b/include/media/soc_camera_platform.h
new file mode 100644
index 000000000000..851f18220984
--- /dev/null
+++ b/include/media/soc_camera_platform.h
@@ -0,0 +1,15 @@
1#ifndef __SOC_CAMERA_H__
2#define __SOC_CAMERA_H__
3
4#include <linux/videodev2.h>
5
6struct soc_camera_platform_info {
7 int iface;
8 char *format_name;
9 unsigned long format_depth;
10 struct v4l2_pix_format format;
11 unsigned long bus_param;
12 int (*set_capture)(struct soc_camera_platform_info *info, int enable);
13};
14
15#endif /* __SOC_CAMERA_H__ */
diff --git a/include/media/v4l2-dev.h b/include/media/v4l2-dev.h
index 859f7a6f6f67..33f379b1ecfe 100644
--- a/include/media/v4l2-dev.h
+++ b/include/media/v4l2-dev.h
@@ -59,8 +59,8 @@ enum v4l2_priority v4l2_prio_max(struct v4l2_prio_state *global);
59int v4l2_prio_check(struct v4l2_prio_state *global, enum v4l2_priority *local); 59int v4l2_prio_check(struct v4l2_prio_state *global, enum v4l2_priority *local);
60 60
61/* names for fancy debug output */ 61/* names for fancy debug output */
62extern char *v4l2_field_names[]; 62extern const char *v4l2_field_names[];
63extern char *v4l2_type_names[]; 63extern const char *v4l2_type_names[];
64 64
65/* Compatibility layer interface -- v4l1-compat module */ 65/* Compatibility layer interface -- v4l1-compat module */
66typedef int (*v4l2_kioctl)(struct inode *inode, struct file *file, 66typedef int (*v4l2_kioctl)(struct inode *inode, struct file *file,
@@ -96,6 +96,8 @@ struct video_device
96 int type; /* v4l1 */ 96 int type; /* v4l1 */
97 int type2; /* v4l2 */ 97 int type2; /* v4l2 */
98 int minor; 98 int minor;
99 /* attribute to diferentiate multiple indexs on one physical device */
100 int index;
99 101
100 int debug; /* Activates debug level*/ 102 int debug; /* Activates debug level*/
101 103
@@ -118,74 +120,76 @@ struct video_device
118 enum v4l2_priority p); 120 enum v4l2_priority p);
119 121
120 /* VIDIOC_ENUM_FMT handlers */ 122 /* VIDIOC_ENUM_FMT handlers */
121 int (*vidioc_enum_fmt_cap) (struct file *file, void *fh, 123 int (*vidioc_enum_fmt_vid_cap) (struct file *file, void *fh,
122 struct v4l2_fmtdesc *f); 124 struct v4l2_fmtdesc *f);
123 int (*vidioc_enum_fmt_overlay) (struct file *file, void *fh, 125 int (*vidioc_enum_fmt_vid_overlay) (struct file *file, void *fh,
124 struct v4l2_fmtdesc *f); 126 struct v4l2_fmtdesc *f);
125 int (*vidioc_enum_fmt_vbi) (struct file *file, void *fh, 127 int (*vidioc_enum_fmt_vid_out) (struct file *file, void *fh,
126 struct v4l2_fmtdesc *f); 128 struct v4l2_fmtdesc *f);
127 int (*vidioc_enum_fmt_vbi_capture) (struct file *file, void *fh, 129#if 1
128 struct v4l2_fmtdesc *f); 130 /* deprecated, will be removed in 2.6.28 */
129 int (*vidioc_enum_fmt_video_output)(struct file *file, void *fh, 131 int (*vidioc_enum_fmt_vbi_cap) (struct file *file, void *fh,
130 struct v4l2_fmtdesc *f);
131 int (*vidioc_enum_fmt_output_overlay) (struct file *file, void *fh,
132 struct v4l2_fmtdesc *f);
133 int (*vidioc_enum_fmt_vbi_output) (struct file *file, void *fh,
134 struct v4l2_fmtdesc *f); 132 struct v4l2_fmtdesc *f);
133#endif
135 int (*vidioc_enum_fmt_type_private)(struct file *file, void *fh, 134 int (*vidioc_enum_fmt_type_private)(struct file *file, void *fh,
136 struct v4l2_fmtdesc *f); 135 struct v4l2_fmtdesc *f);
137 136
138 /* VIDIOC_G_FMT handlers */ 137 /* VIDIOC_G_FMT handlers */
139 int (*vidioc_g_fmt_cap) (struct file *file, void *fh, 138 int (*vidioc_g_fmt_vid_cap) (struct file *file, void *fh,
140 struct v4l2_format *f); 139 struct v4l2_format *f);
141 int (*vidioc_g_fmt_overlay) (struct file *file, void *fh, 140 int (*vidioc_g_fmt_vid_overlay)(struct file *file, void *fh,
142 struct v4l2_format *f); 141 struct v4l2_format *f);
143 int (*vidioc_g_fmt_vbi) (struct file *file, void *fh, 142 int (*vidioc_g_fmt_vid_out) (struct file *file, void *fh,
144 struct v4l2_format *f); 143 struct v4l2_format *f);
145 int (*vidioc_g_fmt_vbi_output) (struct file *file, void *fh, 144 int (*vidioc_g_fmt_vid_out_overlay)(struct file *file, void *fh,
146 struct v4l2_format *f); 145 struct v4l2_format *f);
147 int (*vidioc_g_fmt_vbi_capture)(struct file *file, void *fh, 146 int (*vidioc_g_fmt_vbi_cap) (struct file *file, void *fh,
148 struct v4l2_format *f); 147 struct v4l2_format *f);
149 int (*vidioc_g_fmt_video_output)(struct file *file, void *fh, 148 int (*vidioc_g_fmt_vbi_out) (struct file *file, void *fh,
150 struct v4l2_format *f); 149 struct v4l2_format *f);
151 int (*vidioc_g_fmt_output_overlay) (struct file *file, void *fh, 150 int (*vidioc_g_fmt_sliced_vbi_cap)(struct file *file, void *fh,
151 struct v4l2_format *f);
152 int (*vidioc_g_fmt_sliced_vbi_out)(struct file *file, void *fh,
152 struct v4l2_format *f); 153 struct v4l2_format *f);
153 int (*vidioc_g_fmt_type_private)(struct file *file, void *fh, 154 int (*vidioc_g_fmt_type_private)(struct file *file, void *fh,
154 struct v4l2_format *f); 155 struct v4l2_format *f);
155 156
156 /* VIDIOC_S_FMT handlers */ 157 /* VIDIOC_S_FMT handlers */
157 int (*vidioc_s_fmt_cap) (struct file *file, void *fh, 158 int (*vidioc_s_fmt_vid_cap) (struct file *file, void *fh,
158 struct v4l2_format *f); 159 struct v4l2_format *f);
159 160 int (*vidioc_s_fmt_vid_overlay)(struct file *file, void *fh,
160 int (*vidioc_s_fmt_overlay) (struct file *file, void *fh,
161 struct v4l2_format *f); 161 struct v4l2_format *f);
162 int (*vidioc_s_fmt_vbi) (struct file *file, void *fh, 162 int (*vidioc_s_fmt_vid_out) (struct file *file, void *fh,
163 struct v4l2_format *f); 163 struct v4l2_format *f);
164 int (*vidioc_s_fmt_vbi_output) (struct file *file, void *fh, 164 int (*vidioc_s_fmt_vid_out_overlay)(struct file *file, void *fh,
165 struct v4l2_format *f); 165 struct v4l2_format *f);
166 int (*vidioc_s_fmt_vbi_capture)(struct file *file, void *fh, 166 int (*vidioc_s_fmt_vbi_cap) (struct file *file, void *fh,
167 struct v4l2_format *f); 167 struct v4l2_format *f);
168 int (*vidioc_s_fmt_video_output)(struct file *file, void *fh, 168 int (*vidioc_s_fmt_vbi_out) (struct file *file, void *fh,
169 struct v4l2_format *f); 169 struct v4l2_format *f);
170 int (*vidioc_s_fmt_output_overlay) (struct file *file, void *fh, 170 int (*vidioc_s_fmt_sliced_vbi_cap)(struct file *file, void *fh,
171 struct v4l2_format *f);
172 int (*vidioc_s_fmt_sliced_vbi_out)(struct file *file, void *fh,
171 struct v4l2_format *f); 173 struct v4l2_format *f);
172 int (*vidioc_s_fmt_type_private)(struct file *file, void *fh, 174 int (*vidioc_s_fmt_type_private)(struct file *file, void *fh,
173 struct v4l2_format *f); 175 struct v4l2_format *f);
174 176
175 /* VIDIOC_TRY_FMT handlers */ 177 /* VIDIOC_TRY_FMT handlers */
176 int (*vidioc_try_fmt_cap) (struct file *file, void *fh, 178 int (*vidioc_try_fmt_vid_cap) (struct file *file, void *fh,
179 struct v4l2_format *f);
180 int (*vidioc_try_fmt_vid_overlay)(struct file *file, void *fh,
177 struct v4l2_format *f); 181 struct v4l2_format *f);
178 int (*vidioc_try_fmt_overlay) (struct file *file, void *fh, 182 int (*vidioc_try_fmt_vid_out) (struct file *file, void *fh,
179 struct v4l2_format *f); 183 struct v4l2_format *f);
180 int (*vidioc_try_fmt_vbi) (struct file *file, void *fh, 184 int (*vidioc_try_fmt_vid_out_overlay)(struct file *file, void *fh,
181 struct v4l2_format *f); 185 struct v4l2_format *f);
182 int (*vidioc_try_fmt_vbi_output) (struct file *file, void *fh, 186 int (*vidioc_try_fmt_vbi_cap) (struct file *file, void *fh,
183 struct v4l2_format *f); 187 struct v4l2_format *f);
184 int (*vidioc_try_fmt_vbi_capture)(struct file *file, void *fh, 188 int (*vidioc_try_fmt_vbi_out) (struct file *file, void *fh,
185 struct v4l2_format *f); 189 struct v4l2_format *f);
186 int (*vidioc_try_fmt_video_output)(struct file *file, void *fh, 190 int (*vidioc_try_fmt_sliced_vbi_cap)(struct file *file, void *fh,
187 struct v4l2_format *f); 191 struct v4l2_format *f);
188 int (*vidioc_try_fmt_output_overlay)(struct file *file, void *fh, 192 int (*vidioc_try_fmt_sliced_vbi_out)(struct file *file, void *fh,
189 struct v4l2_format *f); 193 struct v4l2_format *f);
190 int (*vidioc_try_fmt_type_private)(struct file *file, void *fh, 194 int (*vidioc_try_fmt_type_private)(struct file *file, void *fh,
191 struct v4l2_format *f); 195 struct v4l2_format *f);
@@ -212,8 +216,9 @@ struct video_device
212 int (*vidioc_streamoff)(struct file *file, void *fh, enum v4l2_buf_type i); 216 int (*vidioc_streamoff)(struct file *file, void *fh, enum v4l2_buf_type i);
213 217
214 /* Standard handling 218 /* Standard handling
215 G_STD and ENUMSTD are handled by videodev.c 219 ENUMSTD is handled by videodev.c
216 */ 220 */
221 int (*vidioc_g_std) (struct file *file, void *fh, v4l2_std_id *norm);
217 int (*vidioc_s_std) (struct file *file, void *fh, v4l2_std_id *norm); 222 int (*vidioc_s_std) (struct file *file, void *fh, v4l2_std_id *norm);
218 int (*vidioc_querystd) (struct file *file, void *fh, v4l2_std_id *a); 223 int (*vidioc_querystd) (struct file *file, void *fh, v4l2_std_id *a);
219 224
@@ -224,7 +229,7 @@ struct video_device
224 int (*vidioc_s_input) (struct file *file, void *fh, unsigned int i); 229 int (*vidioc_s_input) (struct file *file, void *fh, unsigned int i);
225 230
226 /* Output handling */ 231 /* Output handling */
227 int (*vidioc_enumoutput) (struct file *file, void *fh, 232 int (*vidioc_enum_output) (struct file *file, void *fh,
228 struct v4l2_output *a); 233 struct v4l2_output *a);
229 int (*vidioc_g_output) (struct file *file, void *fh, unsigned int *i); 234 int (*vidioc_g_output) (struct file *file, void *fh, unsigned int *i);
230 int (*vidioc_s_output) (struct file *file, void *fh, unsigned int i); 235 int (*vidioc_s_output) (struct file *file, void *fh, unsigned int i);
@@ -306,6 +311,8 @@ struct video_device
306 /* Log status ioctl */ 311 /* Log status ioctl */
307 int (*vidioc_log_status) (struct file *file, void *fh); 312 int (*vidioc_log_status) (struct file *file, void *fh);
308 313
314 int (*vidioc_s_hw_freq_seek) (struct file *file, void *fh,
315 struct v4l2_hw_freq_seek *a);
309 316
310 /* Debugging ioctls */ 317 /* Debugging ioctls */
311#ifdef CONFIG_VIDEO_ADV_DEBUG 318#ifdef CONFIG_VIDEO_ADV_DEBUG
@@ -342,6 +349,8 @@ void *priv;
342 349
343/* Version 2 functions */ 350/* Version 2 functions */
344extern int video_register_device(struct video_device *vfd, int type, int nr); 351extern int video_register_device(struct video_device *vfd, int type, int nr);
352int video_register_device_index(struct video_device *vfd, int type, int nr,
353 int index);
345void video_unregister_device(struct video_device *); 354void video_unregister_device(struct video_device *);
346extern int video_ioctl2(struct inode *inode, struct file *file, 355extern int video_ioctl2(struct inode *inode, struct file *file,
347 unsigned int cmd, unsigned long arg); 356 unsigned int cmd, unsigned long arg);
@@ -366,7 +375,7 @@ video_device_create_file(struct video_device *vfd,
366{ 375{
367 int ret = device_create_file(&vfd->class_dev, attr); 376 int ret = device_create_file(&vfd->class_dev, attr);
368 if (ret < 0) 377 if (ret < 0)
369 printk(KERN_WARNING "%s error: %d\n", __FUNCTION__, ret); 378 printk(KERN_WARNING "%s error: %d\n", __func__, ret);
370 return ret; 379 return ret;
371} 380}
372static inline void 381static inline void
diff --git a/include/media/v4l2-i2c-drv-legacy.h b/include/media/v4l2-i2c-drv-legacy.h
index 878562278b67..975ffbf4e2c5 100644
--- a/include/media/v4l2-i2c-drv-legacy.h
+++ b/include/media/v4l2-i2c-drv-legacy.h
@@ -68,7 +68,6 @@ static int v4l2_i2c_drv_detach_legacy(struct i2c_client *client)
68 if (err) 68 if (err)
69 return err; 69 return err;
70 kfree(client); 70 kfree(client);
71
72 return 0; 71 return 0;
73} 72}
74 73
diff --git a/include/media/videobuf-dma-contig.h b/include/media/videobuf-dma-contig.h
new file mode 100644
index 000000000000..549386681aab
--- /dev/null
+++ b/include/media/videobuf-dma-contig.h
@@ -0,0 +1,32 @@
1/*
2 * helper functions for physically contiguous capture buffers
3 *
4 * The functions support hardware lacking scatter gather support
5 * (i.e. the buffers must be linear in physical memory)
6 *
7 * Copyright (c) 2008 Magnus Damm
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2
12 */
13#ifndef _VIDEOBUF_DMA_CONTIG_H
14#define _VIDEOBUF_DMA_CONTIG_H
15
16#include <linux/dma-mapping.h>
17#include <media/videobuf-core.h>
18
19void videobuf_queue_dma_contig_init(struct videobuf_queue *q,
20 struct videobuf_queue_ops *ops,
21 struct device *dev,
22 spinlock_t *irqlock,
23 enum v4l2_buf_type type,
24 enum v4l2_field field,
25 unsigned int msize,
26 void *priv);
27
28dma_addr_t videobuf_to_dma_contig(struct videobuf_buffer *buf);
29void videobuf_dma_contig_free(struct videobuf_queue *q,
30 struct videobuf_buffer *buf);
31
32#endif /* _VIDEOBUF_DMA_CONTIG_H */
diff --git a/include/media/videobuf-dma-sg.h b/include/media/videobuf-dma-sg.h
index be8da269ee33..90edd22d343c 100644
--- a/include/media/videobuf-dma-sg.h
+++ b/include/media/videobuf-dma-sg.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * helper functions for SG DMA video4linux capture buffers 2 * helper functions for SG DMA video4linux capture buffers
3 * 3 *
4 * The functions expect the hardware being able to scatter gatter 4 * The functions expect the hardware being able to scatter gather
5 * (i.e. the buffers are not linear in physical memory, but fragmented 5 * (i.e. the buffers are not linear in physical memory, but fragmented
6 * into PAGE_SIZE chunks). They also assume the driver does not need 6 * into PAGE_SIZE chunks). They also assume the driver does not need
7 * to touch the video data. 7 * to touch the video data.
diff --git a/include/media/videobuf-vmalloc.h b/include/media/videobuf-vmalloc.h
index aed39460c154..e87222c6a125 100644
--- a/include/media/videobuf-vmalloc.h
+++ b/include/media/videobuf-vmalloc.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * helper functions for vmalloc capture buffers 2 * helper functions for vmalloc capture buffers
3 * 3 *
4 * The functions expect the hardware being able to scatter gatter 4 * The functions expect the hardware being able to scatter gather
5 * (i.e. the buffers are not linear in physical memory, but fragmented 5 * (i.e. the buffers are not linear in physical memory, but fragmented
6 * into PAGE_SIZE chunks). They also assume the driver does not need 6 * into PAGE_SIZE chunks). They also assume the driver does not need
7 * to touch the video data. 7 * to touch the video data.
diff --git a/include/net/addrconf.h b/include/net/addrconf.h
index bbd3d583c6e6..06b28142b3ab 100644
--- a/include/net/addrconf.h
+++ b/include/net/addrconf.h
@@ -121,7 +121,8 @@ static inline int addrconf_finite_timeout(unsigned long timeout)
121 */ 121 */
122extern int ipv6_addr_label_init(void); 122extern int ipv6_addr_label_init(void);
123extern void ipv6_addr_label_rtnl_register(void); 123extern void ipv6_addr_label_rtnl_register(void);
124extern u32 ipv6_addr_label(const struct in6_addr *addr, 124extern u32 ipv6_addr_label(struct net *net,
125 const struct in6_addr *addr,
125 int type, int ifindex); 126 int type, int ifindex);
126 127
127/* 128/*
diff --git a/include/net/bluetooth/bluetooth.h b/include/net/bluetooth/bluetooth.h
index 750648df13f4..6f8418bf4241 100644
--- a/include/net/bluetooth/bluetooth.h
+++ b/include/net/bluetooth/bluetooth.h
@@ -121,6 +121,7 @@ void bt_sock_link(struct bt_sock_list *l, struct sock *s);
121void bt_sock_unlink(struct bt_sock_list *l, struct sock *s); 121void bt_sock_unlink(struct bt_sock_list *l, struct sock *s);
122int bt_sock_recvmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg, size_t len, int flags); 122int bt_sock_recvmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg, size_t len, int flags);
123uint bt_sock_poll(struct file * file, struct socket *sock, poll_table *wait); 123uint bt_sock_poll(struct file * file, struct socket *sock, poll_table *wait);
124int bt_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg);
124int bt_sock_wait_state(struct sock *sk, int state, unsigned long timeo); 125int bt_sock_wait_state(struct sock *sk, int state, unsigned long timeo);
125 126
126void bt_accept_enqueue(struct sock *parent, struct sock *sk); 127void bt_accept_enqueue(struct sock *parent, struct sock *sk);
diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h
index a8a9eb6af966..3cc294919312 100644
--- a/include/net/bluetooth/hci.h
+++ b/include/net/bluetooth/hci.h
@@ -72,8 +72,6 @@ enum {
72 HCI_INQUIRY, 72 HCI_INQUIRY,
73 73
74 HCI_RAW, 74 HCI_RAW,
75
76 HCI_SECMGR
77}; 75};
78 76
79/* HCI ioctl defines */ 77/* HCI ioctl defines */
@@ -86,6 +84,7 @@ enum {
86#define HCIGETDEVINFO _IOR('H', 211, int) 84#define HCIGETDEVINFO _IOR('H', 211, int)
87#define HCIGETCONNLIST _IOR('H', 212, int) 85#define HCIGETCONNLIST _IOR('H', 212, int)
88#define HCIGETCONNINFO _IOR('H', 213, int) 86#define HCIGETCONNINFO _IOR('H', 213, int)
87#define HCIGETAUTHINFO _IOR('H', 215, int)
89 88
90#define HCISETRAW _IOW('H', 220, int) 89#define HCISETRAW _IOW('H', 220, int)
91#define HCISETSCAN _IOW('H', 221, int) 90#define HCISETSCAN _IOW('H', 221, int)
@@ -97,8 +96,6 @@ enum {
97#define HCISETACLMTU _IOW('H', 227, int) 96#define HCISETACLMTU _IOW('H', 227, int)
98#define HCISETSCOMTU _IOW('H', 228, int) 97#define HCISETSCOMTU _IOW('H', 228, int)
99 98
100#define HCISETSECMGR _IOW('H', 230, int)
101
102#define HCIINQUIRY _IOR('H', 240, int) 99#define HCIINQUIRY _IOR('H', 240, int)
103 100
104/* HCI timeouts */ 101/* HCI timeouts */
@@ -137,6 +134,8 @@ enum {
137#define ESCO_EV4 0x0010 134#define ESCO_EV4 0x0010
138#define ESCO_EV5 0x0020 135#define ESCO_EV5 0x0020
139 136
137#define SCO_ESCO_MASK (ESCO_HV1 | ESCO_HV2 | ESCO_HV3)
138
140/* ACL flags */ 139/* ACL flags */
141#define ACL_CONT 0x01 140#define ACL_CONT 0x01
142#define ACL_START 0x02 141#define ACL_START 0x02
@@ -178,6 +177,8 @@ enum {
178 177
179#define LMP_SNIFF_SUBR 0x02 178#define LMP_SNIFF_SUBR 0x02
180 179
180#define LMP_SIMPLE_PAIR 0x08
181
181/* Connection modes */ 182/* Connection modes */
182#define HCI_CM_ACTIVE 0x0000 183#define HCI_CM_ACTIVE 0x0000
183#define HCI_CM_HOLD 0x0001 184#define HCI_CM_HOLD 0x0001
@@ -199,6 +200,14 @@ enum {
199#define HCI_LM_RELIABLE 0x0010 200#define HCI_LM_RELIABLE 0x0010
200#define HCI_LM_SECURE 0x0020 201#define HCI_LM_SECURE 0x0020
201 202
203/* Authentication types */
204#define HCI_AT_NO_BONDING 0x00
205#define HCI_AT_NO_BONDING_MITM 0x01
206#define HCI_AT_DEDICATED_BONDING 0x02
207#define HCI_AT_DEDICATED_BONDING_MITM 0x03
208#define HCI_AT_GENERAL_BONDING 0x04
209#define HCI_AT_GENERAL_BONDING_MITM 0x05
210
202/* ----- HCI Commands ---- */ 211/* ----- HCI Commands ---- */
203#define HCI_OP_INQUIRY 0x0401 212#define HCI_OP_INQUIRY 0x0401
204struct hci_cp_inquiry { 213struct hci_cp_inquiry {
@@ -402,6 +411,17 @@ struct hci_rp_write_link_policy {
402 __le16 handle; 411 __le16 handle;
403} __attribute__ ((packed)); 412} __attribute__ ((packed));
404 413
414#define HCI_OP_READ_DEF_LINK_POLICY 0x080e
415struct hci_rp_read_def_link_policy {
416 __u8 status;
417 __le16 policy;
418} __attribute__ ((packed));
419
420#define HCI_OP_WRITE_DEF_LINK_POLICY 0x080f
421struct hci_cp_write_def_link_policy {
422 __le16 policy;
423} __attribute__ ((packed));
424
405#define HCI_OP_SNIFF_SUBRATE 0x0811 425#define HCI_OP_SNIFF_SUBRATE 0x0811
406struct hci_cp_sniff_subrate { 426struct hci_cp_sniff_subrate {
407 __le16 handle; 427 __le16 handle;
@@ -501,6 +521,17 @@ struct hci_cp_host_buffer_size {
501 __le16 sco_max_pkt; 521 __le16 sco_max_pkt;
502} __attribute__ ((packed)); 522} __attribute__ ((packed));
503 523
524#define HCI_OP_READ_SSP_MODE 0x0c55
525struct hci_rp_read_ssp_mode {
526 __u8 status;
527 __u8 mode;
528} __attribute__ ((packed));
529
530#define HCI_OP_WRITE_SSP_MODE 0x0c56
531struct hci_cp_write_ssp_mode {
532 __u8 mode;
533} __attribute__ ((packed));
534
504#define HCI_OP_READ_LOCAL_VERSION 0x1001 535#define HCI_OP_READ_LOCAL_VERSION 0x1001
505struct hci_rp_read_local_version { 536struct hci_rp_read_local_version {
506 __u8 status; 537 __u8 status;
@@ -696,6 +727,13 @@ struct hci_ev_clock_offset {
696 __le16 clock_offset; 727 __le16 clock_offset;
697} __attribute__ ((packed)); 728} __attribute__ ((packed));
698 729
730#define HCI_EV_PKT_TYPE_CHANGE 0x1d
731struct hci_ev_pkt_type_change {
732 __u8 status;
733 __le16 handle;
734 __le16 pkt_type;
735} __attribute__ ((packed));
736
699#define HCI_EV_PSCAN_REP_MODE 0x20 737#define HCI_EV_PSCAN_REP_MODE 0x20
700struct hci_ev_pscan_rep_mode { 738struct hci_ev_pscan_rep_mode {
701 bdaddr_t bdaddr; 739 bdaddr_t bdaddr;
@@ -774,6 +812,23 @@ struct extended_inquiry_info {
774 __u8 data[240]; 812 __u8 data[240];
775} __attribute__ ((packed)); 813} __attribute__ ((packed));
776 814
815#define HCI_EV_IO_CAPA_REQUEST 0x31
816struct hci_ev_io_capa_request {
817 bdaddr_t bdaddr;
818} __attribute__ ((packed));
819
820#define HCI_EV_SIMPLE_PAIR_COMPLETE 0x36
821struct hci_ev_simple_pair_complete {
822 __u8 status;
823 bdaddr_t bdaddr;
824} __attribute__ ((packed));
825
826#define HCI_EV_REMOTE_HOST_FEATURES 0x3d
827struct hci_ev_remote_host_features {
828 bdaddr_t bdaddr;
829 __u8 features[8];
830} __attribute__ ((packed));
831
777/* Internal events generated by Bluetooth stack */ 832/* Internal events generated by Bluetooth stack */
778#define HCI_EV_STACK_INTERNAL 0xfd 833#define HCI_EV_STACK_INTERNAL 0xfd
779struct hci_ev_stack_internal { 834struct hci_ev_stack_internal {
@@ -951,6 +1006,11 @@ struct hci_conn_info_req {
951 struct hci_conn_info conn_info[0]; 1006 struct hci_conn_info conn_info[0];
952}; 1007};
953 1008
1009struct hci_auth_info_req {
1010 bdaddr_t bdaddr;
1011 __u8 type;
1012};
1013
954struct hci_inquiry_req { 1014struct hci_inquiry_req {
955 __u16 dev_id; 1015 __u16 dev_id;
956 __u16 flags; 1016 __u16 flags;
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
index ea13baa3851b..cbf751094688 100644
--- a/include/net/bluetooth/hci_core.h
+++ b/include/net/bluetooth/hci_core.h
@@ -40,6 +40,7 @@ struct inquiry_data {
40 __u8 dev_class[3]; 40 __u8 dev_class[3];
41 __le16 clock_offset; 41 __le16 clock_offset;
42 __s8 rssi; 42 __s8 rssi;
43 __u8 ssp_mode;
43}; 44};
44 45
45struct inquiry_entry { 46struct inquiry_entry {
@@ -75,6 +76,7 @@ struct hci_dev {
75 __u8 dev_class[3]; 76 __u8 dev_class[3];
76 __u8 features[8]; 77 __u8 features[8];
77 __u8 commands[64]; 78 __u8 commands[64];
79 __u8 ssp_mode;
78 __u8 hci_ver; 80 __u8 hci_ver;
79 __u16 hci_rev; 81 __u16 hci_rev;
80 __u16 manufacturer; 82 __u16 manufacturer;
@@ -161,9 +163,12 @@ struct hci_conn {
161 __u8 attempt; 163 __u8 attempt;
162 __u8 dev_class[3]; 164 __u8 dev_class[3];
163 __u8 features[8]; 165 __u8 features[8];
166 __u8 ssp_mode;
164 __u16 interval; 167 __u16 interval;
168 __u16 pkt_type;
165 __u16 link_policy; 169 __u16 link_policy;
166 __u32 link_mode; 170 __u32 link_mode;
171 __u8 auth_type;
167 __u8 power_save; 172 __u8 power_save;
168 unsigned long pend; 173 unsigned long pend;
169 174
@@ -344,7 +349,7 @@ static inline void hci_conn_put(struct hci_conn *conn)
344 if (conn->state == BT_CONNECTED) { 349 if (conn->state == BT_CONNECTED) {
345 timeo = msecs_to_jiffies(HCI_DISCONN_TIMEOUT); 350 timeo = msecs_to_jiffies(HCI_DISCONN_TIMEOUT);
346 if (!conn->out) 351 if (!conn->out)
347 timeo *= 2; 352 timeo *= 5;
348 } else 353 } else
349 timeo = msecs_to_jiffies(10); 354 timeo = msecs_to_jiffies(10);
350 } else 355 } else
@@ -418,6 +423,7 @@ int hci_get_dev_list(void __user *arg);
418int hci_get_dev_info(void __user *arg); 423int hci_get_dev_info(void __user *arg);
419int hci_get_conn_list(void __user *arg); 424int hci_get_conn_list(void __user *arg);
420int hci_get_conn_info(struct hci_dev *hdev, void __user *arg); 425int hci_get_conn_info(struct hci_dev *hdev, void __user *arg);
426int hci_get_auth_info(struct hci_dev *hdev, void __user *arg);
421int hci_inquiry(void __user *arg); 427int hci_inquiry(void __user *arg);
422 428
423void hci_event_packet(struct hci_dev *hdev, struct sk_buff *skb); 429void hci_event_packet(struct hci_dev *hdev, struct sk_buff *skb);
@@ -459,6 +465,7 @@ void hci_conn_del_sysfs(struct hci_conn *conn);
459#define lmp_sniff_capable(dev) ((dev)->features[0] & LMP_SNIFF) 465#define lmp_sniff_capable(dev) ((dev)->features[0] & LMP_SNIFF)
460#define lmp_sniffsubr_capable(dev) ((dev)->features[5] & LMP_SNIFF_SUBR) 466#define lmp_sniffsubr_capable(dev) ((dev)->features[5] & LMP_SNIFF_SUBR)
461#define lmp_esco_capable(dev) ((dev)->features[3] & LMP_ESCO) 467#define lmp_esco_capable(dev) ((dev)->features[3] & LMP_ESCO)
468#define lmp_ssp_capable(dev) ((dev)->features[6] & LMP_SIMPLE_PAIR)
462 469
463/* ----- HCI protocols ----- */ 470/* ----- HCI protocols ----- */
464struct hci_proto { 471struct hci_proto {
@@ -474,7 +481,7 @@ struct hci_proto {
474 int (*recv_acldata) (struct hci_conn *conn, struct sk_buff *skb, __u16 flags); 481 int (*recv_acldata) (struct hci_conn *conn, struct sk_buff *skb, __u16 flags);
475 int (*recv_scodata) (struct hci_conn *conn, struct sk_buff *skb); 482 int (*recv_scodata) (struct hci_conn *conn, struct sk_buff *skb);
476 int (*auth_cfm) (struct hci_conn *conn, __u8 status); 483 int (*auth_cfm) (struct hci_conn *conn, __u8 status);
477 int (*encrypt_cfm) (struct hci_conn *conn, __u8 status); 484 int (*encrypt_cfm) (struct hci_conn *conn, __u8 status, __u8 encrypt);
478}; 485};
479 486
480static inline int hci_proto_connect_ind(struct hci_dev *hdev, bdaddr_t *bdaddr, __u8 type) 487static inline int hci_proto_connect_ind(struct hci_dev *hdev, bdaddr_t *bdaddr, __u8 type)
@@ -532,17 +539,17 @@ static inline void hci_proto_auth_cfm(struct hci_conn *conn, __u8 status)
532 hp->auth_cfm(conn, status); 539 hp->auth_cfm(conn, status);
533} 540}
534 541
535static inline void hci_proto_encrypt_cfm(struct hci_conn *conn, __u8 status) 542static inline void hci_proto_encrypt_cfm(struct hci_conn *conn, __u8 status, __u8 encrypt)
536{ 543{
537 register struct hci_proto *hp; 544 register struct hci_proto *hp;
538 545
539 hp = hci_proto[HCI_PROTO_L2CAP]; 546 hp = hci_proto[HCI_PROTO_L2CAP];
540 if (hp && hp->encrypt_cfm) 547 if (hp && hp->encrypt_cfm)
541 hp->encrypt_cfm(conn, status); 548 hp->encrypt_cfm(conn, status, encrypt);
542 549
543 hp = hci_proto[HCI_PROTO_SCO]; 550 hp = hci_proto[HCI_PROTO_SCO];
544 if (hp && hp->encrypt_cfm) 551 if (hp && hp->encrypt_cfm)
545 hp->encrypt_cfm(conn, status); 552 hp->encrypt_cfm(conn, status, encrypt);
546} 553}
547 554
548int hci_register_proto(struct hci_proto *hproto); 555int hci_register_proto(struct hci_proto *hproto);
@@ -579,7 +586,7 @@ static inline void hci_encrypt_cfm(struct hci_conn *conn, __u8 status, __u8 encr
579{ 586{
580 struct list_head *p; 587 struct list_head *p;
581 588
582 hci_proto_encrypt_cfm(conn, status); 589 hci_proto_encrypt_cfm(conn, status, encrypt);
583 590
584 read_lock_bh(&hci_cb_list_lock); 591 read_lock_bh(&hci_cb_list_lock);
585 list_for_each(p, &hci_cb_list) { 592 list_for_each(p, &hci_cb_list) {
diff --git a/include/net/bluetooth/rfcomm.h b/include/net/bluetooth/rfcomm.h
index 98ec7a320689..4dc8d92a4638 100644
--- a/include/net/bluetooth/rfcomm.h
+++ b/include/net/bluetooth/rfcomm.h
@@ -180,7 +180,9 @@ struct rfcomm_dlc {
180 u8 addr; 180 u8 addr;
181 u8 priority; 181 u8 priority;
182 u8 v24_sig; 182 u8 v24_sig;
183 u8 remote_v24_sig;
183 u8 mscex; 184 u8 mscex;
185 u8 out;
184 186
185 u32 link_mode; 187 u32 link_mode;
186 188
diff --git a/include/net/compat.h b/include/net/compat.h
index 164cb682e220..5bbf8bf9efea 100644
--- a/include/net/compat.h
+++ b/include/net/compat.h
@@ -32,7 +32,7 @@ extern int compat_sock_get_timestampns(struct sock *, struct timespec __user *);
32#endif /* defined(CONFIG_COMPAT) */ 32#endif /* defined(CONFIG_COMPAT) */
33 33
34extern int get_compat_msghdr(struct msghdr *, struct compat_msghdr __user *); 34extern int get_compat_msghdr(struct msghdr *, struct compat_msghdr __user *);
35extern int verify_compat_iovec(struct msghdr *, struct iovec *, char *, int); 35extern int verify_compat_iovec(struct msghdr *, struct iovec *, struct sockaddr *, int);
36extern asmlinkage long compat_sys_sendmsg(int,struct compat_msghdr __user *,unsigned); 36extern asmlinkage long compat_sys_sendmsg(int,struct compat_msghdr __user *,unsigned);
37extern asmlinkage long compat_sys_recvmsg(int,struct compat_msghdr __user *,unsigned); 37extern asmlinkage long compat_sys_recvmsg(int,struct compat_msghdr __user *,unsigned);
38extern asmlinkage long compat_sys_getsockopt(int, int, int, char __user *, int __user *); 38extern asmlinkage long compat_sys_getsockopt(int, int, int, char __user *, int __user *);
diff --git a/include/net/dst.h b/include/net/dst.h
index 002500e631f5..c5c318a628f8 100644
--- a/include/net/dst.h
+++ b/include/net/dst.h
@@ -128,6 +128,18 @@ static inline u32 dst_mtu(const struct dst_entry *dst)
128 return mtu; 128 return mtu;
129} 129}
130 130
131/* RTT metrics are stored in milliseconds for user ABI, but used as jiffies */
132static inline unsigned long dst_metric_rtt(const struct dst_entry *dst, int metric)
133{
134 return msecs_to_jiffies(dst_metric(dst, metric));
135}
136
137static inline void set_dst_metric_rtt(struct dst_entry *dst, int metric,
138 unsigned long rtt)
139{
140 dst->metrics[metric-1] = jiffies_to_msecs(rtt);
141}
142
131static inline u32 143static inline u32
132dst_allfrag(const struct dst_entry *dst) 144dst_allfrag(const struct dst_entry *dst)
133{ 145{
diff --git a/include/net/fib_rules.h b/include/net/fib_rules.h
index a5c6ccc5bb19..c2bb5cae6515 100644
--- a/include/net/fib_rules.h
+++ b/include/net/fib_rules.h
@@ -62,7 +62,7 @@ struct fib_rules_ops
62 62
63 /* Called after modifications to the rules set, must flush 63 /* Called after modifications to the rules set, must flush
64 * the route cache if one exists. */ 64 * the route cache if one exists. */
65 void (*flush_cache)(void); 65 void (*flush_cache)(struct fib_rules_ops *ops);
66 66
67 int nlgroup; 67 int nlgroup;
68 const struct nla_policy *policy; 68 const struct nla_policy *policy;
diff --git a/include/net/garp.h b/include/net/garp.h
new file mode 100644
index 000000000000..825f172caba9
--- /dev/null
+++ b/include/net/garp.h
@@ -0,0 +1,128 @@
1#ifndef _NET_GARP_H
2#define _NET_GARP_H
3
4#include <net/stp.h>
5
6#define GARP_PROTOCOL_ID 0x1
7#define GARP_END_MARK 0x0
8
9struct garp_pdu_hdr {
10 __be16 protocol;
11};
12
13struct garp_msg_hdr {
14 u8 attrtype;
15};
16
17enum garp_attr_event {
18 GARP_LEAVE_ALL,
19 GARP_JOIN_EMPTY,
20 GARP_JOIN_IN,
21 GARP_LEAVE_EMPTY,
22 GARP_LEAVE_IN,
23 GARP_EMPTY,
24};
25
26struct garp_attr_hdr {
27 u8 len;
28 u8 event;
29 u8 data[];
30};
31
32struct garp_skb_cb {
33 u8 cur_type;
34};
35
36static inline struct garp_skb_cb *garp_cb(struct sk_buff *skb)
37{
38 BUILD_BUG_ON(sizeof(struct garp_skb_cb) >
39 FIELD_SIZEOF(struct sk_buff, cb));
40 return (struct garp_skb_cb *)skb->cb;
41}
42
43enum garp_applicant_state {
44 GARP_APPLICANT_INVALID,
45 GARP_APPLICANT_VA,
46 GARP_APPLICANT_AA,
47 GARP_APPLICANT_QA,
48 GARP_APPLICANT_LA,
49 GARP_APPLICANT_VP,
50 GARP_APPLICANT_AP,
51 GARP_APPLICANT_QP,
52 GARP_APPLICANT_VO,
53 GARP_APPLICANT_AO,
54 GARP_APPLICANT_QO,
55 __GARP_APPLICANT_MAX
56};
57#define GARP_APPLICANT_MAX (__GARP_APPLICANT_MAX - 1)
58
59enum garp_event {
60 GARP_EVENT_REQ_JOIN,
61 GARP_EVENT_REQ_LEAVE,
62 GARP_EVENT_R_JOIN_IN,
63 GARP_EVENT_R_JOIN_EMPTY,
64 GARP_EVENT_R_EMPTY,
65 GARP_EVENT_R_LEAVE_IN,
66 GARP_EVENT_R_LEAVE_EMPTY,
67 GARP_EVENT_TRANSMIT_PDU,
68 __GARP_EVENT_MAX
69};
70#define GARP_EVENT_MAX (__GARP_EVENT_MAX - 1)
71
72enum garp_action {
73 GARP_ACTION_NONE,
74 GARP_ACTION_S_JOIN_IN,
75 GARP_ACTION_S_LEAVE_EMPTY,
76};
77
78struct garp_attr {
79 struct rb_node node;
80 enum garp_applicant_state state;
81 u8 type;
82 u8 dlen;
83 unsigned char data[];
84};
85
86enum garp_applications {
87 GARP_APPLICATION_GVRP,
88 __GARP_APPLICATION_MAX
89};
90#define GARP_APPLICATION_MAX (__GARP_APPLICATION_MAX - 1)
91
92struct garp_application {
93 enum garp_applications type;
94 unsigned int maxattr;
95 struct stp_proto proto;
96};
97
98struct garp_applicant {
99 struct garp_application *app;
100 struct net_device *dev;
101 struct timer_list join_timer;
102
103 spinlock_t lock;
104 struct sk_buff_head queue;
105 struct sk_buff *pdu;
106 struct rb_root gid;
107};
108
109struct garp_port {
110 struct garp_applicant *applicants[GARP_APPLICATION_MAX + 1];
111};
112
113extern int garp_register_application(struct garp_application *app);
114extern void garp_unregister_application(struct garp_application *app);
115
116extern int garp_init_applicant(struct net_device *dev,
117 struct garp_application *app);
118extern void garp_uninit_applicant(struct net_device *dev,
119 struct garp_application *app);
120
121extern int garp_request_join(const struct net_device *dev,
122 const struct garp_application *app,
123 const void *data, u8 len, u8 type);
124extern void garp_request_leave(const struct net_device *dev,
125 const struct garp_application *app,
126 const void *data, u8 len, u8 type);
127
128#endif /* _NET_GARP_H */
diff --git a/include/net/icmp.h b/include/net/icmp.h
index dddb839ff4b5..dfa72d4e8907 100644
--- a/include/net/icmp.h
+++ b/include/net/icmp.h
@@ -29,27 +29,21 @@ struct icmp_err {
29}; 29};
30 30
31extern struct icmp_err icmp_err_convert[]; 31extern struct icmp_err icmp_err_convert[];
32DECLARE_SNMP_STAT(struct icmp_mib, icmp_statistics); 32#define ICMP_INC_STATS(net, field) SNMP_INC_STATS((net)->mib.icmp_statistics, field)
33DECLARE_SNMP_STAT(struct icmpmsg_mib, icmpmsg_statistics); 33#define ICMP_INC_STATS_BH(net, field) SNMP_INC_STATS_BH((net)->mib.icmp_statistics, field)
34#define ICMP_INC_STATS(field) SNMP_INC_STATS(icmp_statistics, field) 34#define ICMPMSGOUT_INC_STATS(net, field) SNMP_INC_STATS((net)->mib.icmpmsg_statistics, field+256)
35#define ICMP_INC_STATS_BH(field) SNMP_INC_STATS_BH(icmp_statistics, field) 35#define ICMPMSGIN_INC_STATS_BH(net, field) SNMP_INC_STATS_BH((net)->mib.icmpmsg_statistics, field)
36#define ICMP_INC_STATS_USER(field) SNMP_INC_STATS_USER(icmp_statistics, field)
37#define ICMPMSGOUT_INC_STATS(field) SNMP_INC_STATS(icmpmsg_statistics, field+256)
38#define ICMPMSGOUT_INC_STATS_BH(field) SNMP_INC_STATS_BH(icmpmsg_statistics, field+256)
39#define ICMPMSGOUT_INC_STATS_USER(field) SNMP_INC_STATS_USER(icmpmsg_statistics, field+256)
40#define ICMPMSGIN_INC_STATS(field) SNMP_INC_STATS(icmpmsg_statistics, field)
41#define ICMPMSGIN_INC_STATS_BH(field) SNMP_INC_STATS_BH(icmpmsg_statistics, field)
42#define ICMPMSGIN_INC_STATS_USER(field) SNMP_INC_STATS_USER(icmpmsg_statistics, field)
43 36
44struct dst_entry; 37struct dst_entry;
45struct net_proto_family; 38struct net_proto_family;
46struct sk_buff; 39struct sk_buff;
40struct net;
47 41
48extern void icmp_send(struct sk_buff *skb_in, int type, int code, __be32 info); 42extern void icmp_send(struct sk_buff *skb_in, int type, int code, __be32 info);
49extern int icmp_rcv(struct sk_buff *skb); 43extern int icmp_rcv(struct sk_buff *skb);
50extern int icmp_ioctl(struct sock *sk, int cmd, unsigned long arg); 44extern int icmp_ioctl(struct sock *sk, int cmd, unsigned long arg);
51extern int icmp_init(void); 45extern int icmp_init(void);
52extern void icmp_out_count(unsigned char type); 46extern void icmp_out_count(struct net *net, unsigned char type);
53 47
54/* Move into dst.h ? */ 48/* Move into dst.h ? */
55extern int xrlim_allow(struct dst_entry *dst, int timeout); 49extern int xrlim_allow(struct dst_entry *dst, int timeout);
diff --git a/include/net/ieee80211.h b/include/net/ieee80211.h
index 529816bfbc52..b31399e1fd83 100644
--- a/include/net/ieee80211.h
+++ b/include/net/ieee80211.h
@@ -1262,9 +1262,6 @@ extern int ieee80211_set_encryption(struct ieee80211_device *ieee);
1262/* ieee80211_tx.c */ 1262/* ieee80211_tx.c */
1263extern int ieee80211_xmit(struct sk_buff *skb, struct net_device *dev); 1263extern int ieee80211_xmit(struct sk_buff *skb, struct net_device *dev);
1264extern void ieee80211_txb_free(struct ieee80211_txb *); 1264extern void ieee80211_txb_free(struct ieee80211_txb *);
1265extern int ieee80211_tx_frame(struct ieee80211_device *ieee,
1266 struct ieee80211_hdr *frame, int hdr_len,
1267 int total_len, int encrypt_mpdu);
1268 1265
1269/* ieee80211_rx.c */ 1266/* ieee80211_rx.c */
1270extern void ieee80211_rx_any(struct ieee80211_device *ieee, 1267extern void ieee80211_rx_any(struct ieee80211_device *ieee,
@@ -1312,14 +1309,6 @@ extern int ieee80211_wx_set_encodeext(struct ieee80211_device *ieee,
1312extern int ieee80211_wx_get_encodeext(struct ieee80211_device *ieee, 1309extern int ieee80211_wx_get_encodeext(struct ieee80211_device *ieee,
1313 struct iw_request_info *info, 1310 struct iw_request_info *info,
1314 union iwreq_data *wrqu, char *extra); 1311 union iwreq_data *wrqu, char *extra);
1315extern int ieee80211_wx_set_auth(struct net_device *dev,
1316 struct iw_request_info *info,
1317 union iwreq_data *wrqu,
1318 char *extra);
1319extern int ieee80211_wx_get_auth(struct net_device *dev,
1320 struct iw_request_info *info,
1321 union iwreq_data *wrqu,
1322 char *extra);
1323 1312
1324static inline void ieee80211_increment_scans(struct ieee80211_device *ieee) 1313static inline void ieee80211_increment_scans(struct ieee80211_device *ieee)
1325{ 1314{
diff --git a/include/net/if_inet6.h b/include/net/if_inet6.h
index b2cfc4927257..db66c7927743 100644
--- a/include/net/if_inet6.h
+++ b/include/net/if_inet6.h
@@ -148,7 +148,6 @@ struct ifacaddr6
148#define IFA_HOST IPV6_ADDR_LOOPBACK 148#define IFA_HOST IPV6_ADDR_LOOPBACK
149#define IFA_LINK IPV6_ADDR_LINKLOCAL 149#define IFA_LINK IPV6_ADDR_LINKLOCAL
150#define IFA_SITE IPV6_ADDR_SITELOCAL 150#define IFA_SITE IPV6_ADDR_SITELOCAL
151#define IFA_GLOBAL 0x0000U
152 151
153struct ipv6_devstat { 152struct ipv6_devstat {
154 struct proc_dir_entry *proc_dir_entry; 153 struct proc_dir_entry *proc_dir_entry;
diff --git a/include/net/inet6_hashtables.h b/include/net/inet6_hashtables.h
index 62a5b691858e..e48989f04c24 100644
--- a/include/net/inet6_hashtables.h
+++ b/include/net/inet6_hashtables.h
@@ -24,18 +24,20 @@
24#include <net/inet_sock.h> 24#include <net/inet_sock.h>
25 25
26#include <net/ipv6.h> 26#include <net/ipv6.h>
27#include <net/netns/hash.h>
27 28
28struct inet_hashinfo; 29struct inet_hashinfo;
29 30
30/* I have no idea if this is a good hash for v6 or not. -DaveM */ 31/* I have no idea if this is a good hash for v6 or not. -DaveM */
31static inline unsigned int inet6_ehashfn(const struct in6_addr *laddr, const u16 lport, 32static inline unsigned int inet6_ehashfn(struct net *net,
33 const struct in6_addr *laddr, const u16 lport,
32 const struct in6_addr *faddr, const __be16 fport) 34 const struct in6_addr *faddr, const __be16 fport)
33{ 35{
34 u32 ports = (lport ^ (__force u16)fport); 36 u32 ports = (lport ^ (__force u16)fport);
35 37
36 return jhash_3words((__force u32)laddr->s6_addr32[3], 38 return jhash_3words((__force u32)laddr->s6_addr32[3],
37 (__force u32)faddr->s6_addr32[3], 39 (__force u32)faddr->s6_addr32[3],
38 ports, inet_ehash_secret); 40 ports, inet_ehash_secret + net_hash_mix(net));
39} 41}
40 42
41static inline int inet6_sk_ehashfn(const struct sock *sk) 43static inline int inet6_sk_ehashfn(const struct sock *sk)
@@ -46,7 +48,9 @@ static inline int inet6_sk_ehashfn(const struct sock *sk)
46 const struct in6_addr *faddr = &np->daddr; 48 const struct in6_addr *faddr = &np->daddr;
47 const __u16 lport = inet->num; 49 const __u16 lport = inet->num;
48 const __be16 fport = inet->dport; 50 const __be16 fport = inet->dport;
49 return inet6_ehashfn(laddr, lport, faddr, fport); 51 struct net *net = sock_net(sk);
52
53 return inet6_ehashfn(net, laddr, lport, faddr, fport);
50} 54}
51 55
52extern void __inet6_hash(struct sock *sk); 56extern void __inet6_hash(struct sock *sk);
diff --git a/include/net/inet_hashtables.h b/include/net/inet_hashtables.h
index 735b926a3497..bb619d80f2e2 100644
--- a/include/net/inet_hashtables.h
+++ b/include/net/inet_hashtables.h
@@ -29,6 +29,7 @@
29#include <net/inet_sock.h> 29#include <net/inet_sock.h>
30#include <net/sock.h> 30#include <net/sock.h>
31#include <net/tcp_states.h> 31#include <net/tcp_states.h>
32#include <net/netns/hash.h>
32 33
33#include <asm/atomic.h> 34#include <asm/atomic.h>
34#include <asm/byteorder.h> 35#include <asm/byteorder.h>
@@ -201,23 +202,24 @@ extern struct inet_bind_bucket *
201extern void inet_bind_bucket_destroy(struct kmem_cache *cachep, 202extern void inet_bind_bucket_destroy(struct kmem_cache *cachep,
202 struct inet_bind_bucket *tb); 203 struct inet_bind_bucket *tb);
203 204
204static inline int inet_bhashfn(const __u16 lport, const int bhash_size) 205static inline int inet_bhashfn(struct net *net,
206 const __u16 lport, const int bhash_size)
205{ 207{
206 return lport & (bhash_size - 1); 208 return (lport + net_hash_mix(net)) & (bhash_size - 1);
207} 209}
208 210
209extern void inet_bind_hash(struct sock *sk, struct inet_bind_bucket *tb, 211extern void inet_bind_hash(struct sock *sk, struct inet_bind_bucket *tb,
210 const unsigned short snum); 212 const unsigned short snum);
211 213
212/* These can have wildcards, don't try too hard. */ 214/* These can have wildcards, don't try too hard. */
213static inline int inet_lhashfn(const unsigned short num) 215static inline int inet_lhashfn(struct net *net, const unsigned short num)
214{ 216{
215 return num & (INET_LHTABLE_SIZE - 1); 217 return (num + net_hash_mix(net)) & (INET_LHTABLE_SIZE - 1);
216} 218}
217 219
218static inline int inet_sk_listen_hashfn(const struct sock *sk) 220static inline int inet_sk_listen_hashfn(const struct sock *sk)
219{ 221{
220 return inet_lhashfn(inet_sk(sk)->num); 222 return inet_lhashfn(sock_net(sk), inet_sk(sk)->num);
221} 223}
222 224
223/* Caller must disable local BH processing. */ 225/* Caller must disable local BH processing. */
diff --git a/include/net/inet_sock.h b/include/net/inet_sock.h
index 9fabe5b38912..643e26be058e 100644
--- a/include/net/inet_sock.h
+++ b/include/net/inet_sock.h
@@ -25,6 +25,7 @@
25#include <net/sock.h> 25#include <net/sock.h>
26#include <net/request_sock.h> 26#include <net/request_sock.h>
27#include <net/route.h> 27#include <net/route.h>
28#include <net/netns/hash.h>
28 29
29/** struct ip_options - IP Options 30/** struct ip_options - IP Options
30 * 31 *
@@ -171,13 +172,14 @@ extern int inet_sk_rebuild_header(struct sock *sk);
171extern u32 inet_ehash_secret; 172extern u32 inet_ehash_secret;
172extern void build_ehash_secret(void); 173extern void build_ehash_secret(void);
173 174
174static inline unsigned int inet_ehashfn(const __be32 laddr, const __u16 lport, 175static inline unsigned int inet_ehashfn(struct net *net,
176 const __be32 laddr, const __u16 lport,
175 const __be32 faddr, const __be16 fport) 177 const __be32 faddr, const __be16 fport)
176{ 178{
177 return jhash_3words((__force __u32) laddr, 179 return jhash_3words((__force __u32) laddr,
178 (__force __u32) faddr, 180 (__force __u32) faddr,
179 ((__u32) lport) << 16 | (__force __u32)fport, 181 ((__u32) lport) << 16 | (__force __u32)fport,
180 inet_ehash_secret); 182 inet_ehash_secret + net_hash_mix(net));
181} 183}
182 184
183static inline int inet_sk_ehashfn(const struct sock *sk) 185static inline int inet_sk_ehashfn(const struct sock *sk)
@@ -187,8 +189,9 @@ static inline int inet_sk_ehashfn(const struct sock *sk)
187 const __u16 lport = inet->num; 189 const __u16 lport = inet->num;
188 const __be32 faddr = inet->daddr; 190 const __be32 faddr = inet->daddr;
189 const __be16 fport = inet->dport; 191 const __be16 fport = inet->dport;
192 struct net *net = sock_net(sk);
190 193
191 return inet_ehashfn(laddr, lport, faddr, fport); 194 return inet_ehashfn(net, laddr, lport, faddr, fport);
192} 195}
193 196
194 197
diff --git a/include/net/inetpeer.h b/include/net/inetpeer.h
index ad8404b56113..15e1f8fe4c1f 100644
--- a/include/net/inetpeer.h
+++ b/include/net/inetpeer.h
@@ -1,8 +1,6 @@
1/* 1/*
2 * INETPEER - A storage for permanent information about peers 2 * INETPEER - A storage for permanent information about peers
3 * 3 *
4 * Version: $Id: inetpeer.h,v 1.2 2002/01/12 07:54:56 davem Exp $
5 *
6 * Authors: Andrey V. Savochkin <saw@msu.ru> 4 * Authors: Andrey V. Savochkin <saw@msu.ru>
7 */ 5 */
8 6
diff --git a/include/net/ip.h b/include/net/ip.h
index 3b40bc2234be..b5862b975207 100644
--- a/include/net/ip.h
+++ b/include/net/ip.h
@@ -156,17 +156,14 @@ struct ipv4_config
156}; 156};
157 157
158extern struct ipv4_config ipv4_config; 158extern struct ipv4_config ipv4_config;
159DECLARE_SNMP_STAT(struct ipstats_mib, ip_statistics); 159#define IP_INC_STATS(net, field) SNMP_INC_STATS((net)->mib.ip_statistics, field)
160#define IP_INC_STATS(field) SNMP_INC_STATS(ip_statistics, field) 160#define IP_INC_STATS_BH(net, field) SNMP_INC_STATS_BH((net)->mib.ip_statistics, field)
161#define IP_INC_STATS_BH(field) SNMP_INC_STATS_BH(ip_statistics, field) 161#define IP_ADD_STATS_BH(net, field, val) SNMP_ADD_STATS_BH((net)->mib.ip_statistics, field, val)
162#define IP_INC_STATS_USER(field) SNMP_INC_STATS_USER(ip_statistics, field) 162#define NET_INC_STATS(net, field) SNMP_INC_STATS((net)->mib.net_statistics, field)
163#define IP_ADD_STATS_BH(field, val) SNMP_ADD_STATS_BH(ip_statistics, field, val) 163#define NET_INC_STATS_BH(net, field) SNMP_INC_STATS_BH((net)->mib.net_statistics, field)
164DECLARE_SNMP_STAT(struct linux_mib, net_statistics); 164#define NET_INC_STATS_USER(net, field) SNMP_INC_STATS_USER((net)->mib.net_statistics, field)
165#define NET_INC_STATS(field) SNMP_INC_STATS(net_statistics, field) 165#define NET_ADD_STATS_BH(net, field, adnd) SNMP_ADD_STATS_BH((net)->mib.net_statistics, field, adnd)
166#define NET_INC_STATS_BH(field) SNMP_INC_STATS_BH(net_statistics, field) 166#define NET_ADD_STATS_USER(net, field, adnd) SNMP_ADD_STATS_USER((net)->mib.net_statistics, field, adnd)
167#define NET_INC_STATS_USER(field) SNMP_INC_STATS_USER(net_statistics, field)
168#define NET_ADD_STATS_BH(field, adnd) SNMP_ADD_STATS_BH(net_statistics, field, adnd)
169#define NET_ADD_STATS_USER(field, adnd) SNMP_ADD_STATS_USER(net_statistics, field, adnd)
170 167
171extern unsigned long snmp_fold_field(void *mib[], int offt); 168extern unsigned long snmp_fold_field(void *mib[], int offt);
172extern int snmp_mib_init(void *ptr[2], size_t mibsize); 169extern int snmp_mib_init(void *ptr[2], size_t mibsize);
diff --git a/include/net/ip6_tunnel.h b/include/net/ip6_tunnel.h
index 6512d85f11b3..83b4e008b16d 100644
--- a/include/net/ip6_tunnel.h
+++ b/include/net/ip6_tunnel.h
@@ -1,7 +1,3 @@
1/*
2 * $Id$
3 */
4
5#ifndef _NET_IP6_TUNNEL_H 1#ifndef _NET_IP6_TUNNEL_H
6#define _NET_IP6_TUNNEL_H 2#define _NET_IP6_TUNNEL_H
7 3
@@ -19,7 +15,6 @@
19struct ip6_tnl { 15struct ip6_tnl {
20 struct ip6_tnl *next; /* next tunnel in list */ 16 struct ip6_tnl *next; /* next tunnel in list */
21 struct net_device *dev; /* virtual device associated with tunnel */ 17 struct net_device *dev; /* virtual device associated with tunnel */
22 struct net_device_stats stat; /* statistics for tunnel device */
23 int recursion; /* depth of hard_start_xmit recursion */ 18 int recursion; /* depth of hard_start_xmit recursion */
24 struct ip6_tnl_parm parms; /* tunnel configuration parameters */ 19 struct ip6_tnl_parm parms; /* tunnel configuration parameters */
25 struct flowi fl; /* flowi template for xmit */ 20 struct flowi fl; /* flowi template for xmit */
diff --git a/include/net/ipconfig.h b/include/net/ipconfig.h
index 3924d7d2cb11..c74cc1bd5a02 100644
--- a/include/net/ipconfig.h
+++ b/include/net/ipconfig.h
@@ -1,6 +1,4 @@
1/* 1/*
2 * $Id: ipconfig.h,v 1.4 2001/04/30 04:51:46 davem Exp $
3 *
4 * Copyright (C) 1997 Martin Mares 2 * Copyright (C) 1997 Martin Mares
5 * 3 *
6 * Automatic IP Layer Configuration 4 * Automatic IP Layer Configuration
diff --git a/include/net/ipip.h b/include/net/ipip.h
index 633ed4def8e3..a85bda64b852 100644
--- a/include/net/ipip.h
+++ b/include/net/ipip.h
@@ -11,7 +11,6 @@ struct ip_tunnel
11{ 11{
12 struct ip_tunnel *next; 12 struct ip_tunnel *next;
13 struct net_device *dev; 13 struct net_device *dev;
14 struct net_device_stats stat;
15 14
16 int recursion; /* Depth of hard_start_xmit recursion */ 15 int recursion; /* Depth of hard_start_xmit recursion */
17 int err_count; /* Number of arrived ICMP errors */ 16 int err_count; /* Number of arrived ICMP errors */
diff --git a/include/net/ipv6.h b/include/net/ipv6.h
index f422f7218e1c..2d5c18514a2d 100644
--- a/include/net/ipv6.h
+++ b/include/net/ipv6.h
@@ -4,8 +4,6 @@
4 * Authors: 4 * Authors:
5 * Pedro Roque <roque@di.fc.ul.pt> 5 * Pedro Roque <roque@di.fc.ul.pt>
6 * 6 *
7 * $Id: ipv6.h,v 1.1 2002/05/20 15:13:07 jgrimm Exp $
8 *
9 * This program is free software; you can redistribute it and/or 7 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License 8 * modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation; either version 9 * as published by the Free Software Foundation; either version
@@ -133,7 +131,6 @@ DECLARE_SNMP_STAT(struct ipstats_mib, ipv6_statistics);
133 131
134#define IP6_INC_STATS(idev,field) _DEVINC(ipv6, , idev, field) 132#define IP6_INC_STATS(idev,field) _DEVINC(ipv6, , idev, field)
135#define IP6_INC_STATS_BH(idev,field) _DEVINC(ipv6, _BH, idev, field) 133#define IP6_INC_STATS_BH(idev,field) _DEVINC(ipv6, _BH, idev, field)
136#define IP6_INC_STATS_USER(idev,field) _DEVINC(ipv6, _USER, idev, field)
137#define IP6_ADD_STATS_BH(idev,field,val) _DEVADD(ipv6, _BH, idev, field, val) 134#define IP6_ADD_STATS_BH(idev,field,val) _DEVADD(ipv6, _BH, idev, field, val)
138 135
139DECLARE_SNMP_STAT(struct icmpv6_mib, icmpv6_statistics); 136DECLARE_SNMP_STAT(struct icmpv6_mib, icmpv6_statistics);
@@ -141,20 +138,15 @@ DECLARE_SNMP_STAT(struct icmpv6msg_mib, icmpv6msg_statistics);
141 138
142#define ICMP6_INC_STATS(idev, field) _DEVINC(icmpv6, , idev, field) 139#define ICMP6_INC_STATS(idev, field) _DEVINC(icmpv6, , idev, field)
143#define ICMP6_INC_STATS_BH(idev, field) _DEVINC(icmpv6, _BH, idev, field) 140#define ICMP6_INC_STATS_BH(idev, field) _DEVINC(icmpv6, _BH, idev, field)
144#define ICMP6_INC_STATS_USER(idev, field) _DEVINC(icmpv6, _USER, idev, field)
145 141
146#define ICMP6MSGOUT_INC_STATS(idev, field) \ 142#define ICMP6MSGOUT_INC_STATS(idev, field) \
147 _DEVINC(icmpv6msg, , idev, field +256) 143 _DEVINC(icmpv6msg, , idev, field +256)
148#define ICMP6MSGOUT_INC_STATS_BH(idev, field) \ 144#define ICMP6MSGOUT_INC_STATS_BH(idev, field) \
149 _DEVINC(icmpv6msg, _BH, idev, field +256) 145 _DEVINC(icmpv6msg, _BH, idev, field +256)
150#define ICMP6MSGOUT_INC_STATS_USER(idev, field) \
151 _DEVINC(icmpv6msg, _USER, idev, field +256)
152#define ICMP6MSGIN_INC_STATS(idev, field) \ 146#define ICMP6MSGIN_INC_STATS(idev, field) \
153 _DEVINC(icmpv6msg, , idev, field) 147 _DEVINC(icmpv6msg, , idev, field)
154#define ICMP6MSGIN_INC_STATS_BH(idev, field) \ 148#define ICMP6MSGIN_INC_STATS_BH(idev, field) \
155 _DEVINC(icmpv6msg, _BH, idev, field) 149 _DEVINC(icmpv6msg, _BH, idev, field)
156#define ICMP6MSGIN_INC_STATS_USER(idev, field) \
157 _DEVINC(icmpv6msg, _USER, idev, field)
158 150
159struct ip6_ra_chain 151struct ip6_ra_chain
160{ 152{
@@ -229,9 +221,7 @@ static inline void fl6_sock_release(struct ip6_flowlabel *fl)
229 atomic_dec(&fl->users); 221 atomic_dec(&fl->users);
230} 222}
231 223
232extern int ip6_ra_control(struct sock *sk, int sel, 224extern int ip6_ra_control(struct sock *sk, int sel);
233 void (*destructor)(struct sock *));
234
235 225
236extern int ipv6_parse_hopopts(struct sk_buff *skb); 226extern int ipv6_parse_hopopts(struct sk_buff *skb);
237 227
diff --git a/include/net/irda/irda_device.h b/include/net/irda/irda_device.h
index f70e9b39ebaf..3025ae17ddbe 100644
--- a/include/net/irda/irda_device.h
+++ b/include/net/irda/irda_device.h
@@ -223,7 +223,7 @@ int irda_device_is_receiving(struct net_device *dev);
223/* Interface for internal use */ 223/* Interface for internal use */
224static inline int irda_device_txqueue_empty(const struct net_device *dev) 224static inline int irda_device_txqueue_empty(const struct net_device *dev)
225{ 225{
226 return skb_queue_empty(&dev->qdisc->q); 226 return qdisc_all_tx_empty(dev);
227} 227}
228int irda_device_set_raw_mode(struct net_device* self, int status); 228int irda_device_set_raw_mode(struct net_device* self, int status);
229struct net_device *alloc_irdadev(int sizeof_priv); 229struct net_device *alloc_irdadev(int sizeof_priv);
diff --git a/include/net/iw_handler.h b/include/net/iw_handler.h
index 369d50e08b99..51b9a37de991 100644
--- a/include/net/iw_handler.h
+++ b/include/net/iw_handler.h
@@ -256,7 +256,7 @@
256#define EIWCOMMIT EINPROGRESS 256#define EIWCOMMIT EINPROGRESS
257 257
258/* Flags available in struct iw_request_info */ 258/* Flags available in struct iw_request_info */
259#define IW_REQUEST_FLAG_NONE 0x0000 /* No flag so far */ 259#define IW_REQUEST_FLAG_COMPAT 0x0001 /* Compat ioctl call */
260 260
261/* Type of headers we know about (basically union iwreq_data) */ 261/* Type of headers we know about (basically union iwreq_data) */
262#define IW_HEADER_TYPE_NULL 0 /* Not available */ 262#define IW_HEADER_TYPE_NULL 0 /* Not available */
@@ -478,105 +478,58 @@ extern void wireless_spy_update(struct net_device * dev,
478 * Function that are so simple that it's more efficient inlining them 478 * Function that are so simple that it's more efficient inlining them
479 */ 479 */
480 480
481/*------------------------------------------------------------------*/ 481static inline int iwe_stream_lcp_len(struct iw_request_info *info)
482/*
483 * Wrapper to add an Wireless Event to a stream of events.
484 */
485static inline char *
486iwe_stream_add_event(char * stream, /* Stream of events */
487 char * ends, /* End of stream */
488 struct iw_event *iwe, /* Payload */
489 int event_len) /* Real size of payload */
490{ 482{
491 /* Check if it's possible */ 483#ifdef CONFIG_COMPAT
492 if(likely((stream + event_len) < ends)) { 484 if (info->flags & IW_REQUEST_FLAG_COMPAT)
493 iwe->len = event_len; 485 return IW_EV_COMPAT_LCP_LEN;
494 /* Beware of alignement issues on 64 bits */ 486#endif
495 memcpy(stream, (char *) iwe, IW_EV_LCP_PK_LEN); 487 return IW_EV_LCP_LEN;
496 memcpy(stream + IW_EV_LCP_LEN,
497 ((char *) iwe) + IW_EV_LCP_LEN,
498 event_len - IW_EV_LCP_LEN);
499 stream += event_len;
500 }
501 return stream;
502} 488}
503 489
504/*------------------------------------------------------------------*/ 490static inline int iwe_stream_point_len(struct iw_request_info *info)
505/*
506 * Wrapper to add an short Wireless Event containing a pointer to a
507 * stream of events.
508 */
509static inline char *
510iwe_stream_add_point(char * stream, /* Stream of events */
511 char * ends, /* End of stream */
512 struct iw_event *iwe, /* Payload length + flags */
513 char * extra) /* More payload */
514{ 491{
515 int event_len = IW_EV_POINT_LEN + iwe->u.data.length; 492#ifdef CONFIG_COMPAT
516 /* Check if it's possible */ 493 if (info->flags & IW_REQUEST_FLAG_COMPAT)
517 if(likely((stream + event_len) < ends)) { 494 return IW_EV_COMPAT_POINT_LEN;
518 iwe->len = event_len; 495#endif
519 memcpy(stream, (char *) iwe, IW_EV_LCP_PK_LEN); 496 return IW_EV_POINT_LEN;
520 memcpy(stream + IW_EV_LCP_LEN,
521 ((char *) iwe) + IW_EV_LCP_LEN + IW_EV_POINT_OFF,
522 IW_EV_POINT_PK_LEN - IW_EV_LCP_PK_LEN);
523 memcpy(stream + IW_EV_POINT_LEN, extra, iwe->u.data.length);
524 stream += event_len;
525 }
526 return stream;
527} 497}
528 498
529/*------------------------------------------------------------------*/ 499static inline int iwe_stream_event_len_adjust(struct iw_request_info *info,
530/* 500 int event_len)
531 * Wrapper to add a value to a Wireless Event in a stream of events.
532 * Be careful, this one is tricky to use properly :
533 * At the first run, you need to have (value = event + IW_EV_LCP_LEN).
534 */
535static inline char *
536iwe_stream_add_value(char * event, /* Event in the stream */
537 char * value, /* Value in event */
538 char * ends, /* End of stream */
539 struct iw_event *iwe, /* Payload */
540 int event_len) /* Real size of payload */
541{ 501{
542 /* Don't duplicate LCP */ 502#ifdef CONFIG_COMPAT
543 event_len -= IW_EV_LCP_LEN; 503 if (info->flags & IW_REQUEST_FLAG_COMPAT) {
544 504 event_len -= IW_EV_LCP_LEN;
545 /* Check if it's possible */ 505 event_len += IW_EV_COMPAT_LCP_LEN;
546 if(likely((value + event_len) < ends)) {
547 /* Add new value */
548 memcpy(value, (char *) iwe + IW_EV_LCP_LEN, event_len);
549 value += event_len;
550 /* Patch LCP */
551 iwe->len = value - event;
552 memcpy(event, (char *) iwe, IW_EV_LCP_LEN);
553 } 506 }
554 return value; 507#endif
508
509 return event_len;
555} 510}
556 511
557/*------------------------------------------------------------------*/ 512/*------------------------------------------------------------------*/
558/* 513/*
559 * Wrapper to add an Wireless Event to a stream of events. 514 * Wrapper to add an Wireless Event to a stream of events.
560 * Same as above, with explicit error check...
561 */ 515 */
562static inline char * 516static inline char *
563iwe_stream_check_add_event(char * stream, /* Stream of events */ 517iwe_stream_add_event(struct iw_request_info *info, char *stream, char *ends,
564 char * ends, /* End of stream */ 518 struct iw_event *iwe, int event_len)
565 struct iw_event *iwe, /* Payload */
566 int event_len, /* Size of payload */
567 int * perr) /* Error report */
568{ 519{
569 /* Check if it's possible, set error if not */ 520 int lcp_len = iwe_stream_lcp_len(info);
521
522 event_len = iwe_stream_event_len_adjust(info, event_len);
523
524 /* Check if it's possible */
570 if(likely((stream + event_len) < ends)) { 525 if(likely((stream + event_len) < ends)) {
571 iwe->len = event_len; 526 iwe->len = event_len;
572 /* Beware of alignement issues on 64 bits */ 527 /* Beware of alignement issues on 64 bits */
573 memcpy(stream, (char *) iwe, IW_EV_LCP_PK_LEN); 528 memcpy(stream, (char *) iwe, IW_EV_LCP_PK_LEN);
574 memcpy(stream + IW_EV_LCP_LEN, 529 memcpy(stream + lcp_len, &iwe->u,
575 ((char *) iwe) + IW_EV_LCP_LEN, 530 event_len - lcp_len);
576 event_len - IW_EV_LCP_LEN);
577 stream += event_len; 531 stream += event_len;
578 } else 532 }
579 *perr = -E2BIG;
580 return stream; 533 return stream;
581} 534}
582 535
@@ -584,27 +537,25 @@ iwe_stream_check_add_event(char * stream, /* Stream of events */
584/* 537/*
585 * Wrapper to add an short Wireless Event containing a pointer to a 538 * Wrapper to add an short Wireless Event containing a pointer to a
586 * stream of events. 539 * stream of events.
587 * Same as above, with explicit error check...
588 */ 540 */
589static inline char * 541static inline char *
590iwe_stream_check_add_point(char * stream, /* Stream of events */ 542iwe_stream_add_point(struct iw_request_info *info, char *stream, char *ends,
591 char * ends, /* End of stream */ 543 struct iw_event *iwe, char *extra)
592 struct iw_event *iwe, /* Payload length + flags */
593 char * extra, /* More payload */
594 int * perr) /* Error report */
595{ 544{
596 int event_len = IW_EV_POINT_LEN + iwe->u.data.length; 545 int event_len = iwe_stream_point_len(info) + iwe->u.data.length;
546 int point_len = iwe_stream_point_len(info);
547 int lcp_len = iwe_stream_lcp_len(info);
548
597 /* Check if it's possible */ 549 /* Check if it's possible */
598 if(likely((stream + event_len) < ends)) { 550 if(likely((stream + event_len) < ends)) {
599 iwe->len = event_len; 551 iwe->len = event_len;
600 memcpy(stream, (char *) iwe, IW_EV_LCP_PK_LEN); 552 memcpy(stream, (char *) iwe, IW_EV_LCP_PK_LEN);
601 memcpy(stream + IW_EV_LCP_LEN, 553 memcpy(stream + lcp_len,
602 ((char *) iwe) + IW_EV_LCP_LEN + IW_EV_POINT_OFF, 554 ((char *) &iwe->u) + IW_EV_POINT_OFF,
603 IW_EV_POINT_PK_LEN - IW_EV_LCP_PK_LEN); 555 IW_EV_POINT_PK_LEN - IW_EV_LCP_PK_LEN);
604 memcpy(stream + IW_EV_POINT_LEN, extra, iwe->u.data.length); 556 memcpy(stream + point_len, extra, iwe->u.data.length);
605 stream += event_len; 557 stream += event_len;
606 } else 558 }
607 *perr = -E2BIG;
608 return stream; 559 return stream;
609} 560}
610 561
@@ -613,29 +564,25 @@ iwe_stream_check_add_point(char * stream, /* Stream of events */
613 * Wrapper to add a value to a Wireless Event in a stream of events. 564 * Wrapper to add a value to a Wireless Event in a stream of events.
614 * Be careful, this one is tricky to use properly : 565 * Be careful, this one is tricky to use properly :
615 * At the first run, you need to have (value = event + IW_EV_LCP_LEN). 566 * At the first run, you need to have (value = event + IW_EV_LCP_LEN).
616 * Same as above, with explicit error check...
617 */ 567 */
618static inline char * 568static inline char *
619iwe_stream_check_add_value(char * event, /* Event in the stream */ 569iwe_stream_add_value(struct iw_request_info *info, char *event, char *value,
620 char * value, /* Value in event */ 570 char *ends, struct iw_event *iwe, int event_len)
621 char * ends, /* End of stream */
622 struct iw_event *iwe, /* Payload */
623 int event_len, /* Size of payload */
624 int * perr) /* Error report */
625{ 571{
572 int lcp_len = iwe_stream_lcp_len(info);
573
626 /* Don't duplicate LCP */ 574 /* Don't duplicate LCP */
627 event_len -= IW_EV_LCP_LEN; 575 event_len -= IW_EV_LCP_LEN;
628 576
629 /* Check if it's possible */ 577 /* Check if it's possible */
630 if(likely((value + event_len) < ends)) { 578 if(likely((value + event_len) < ends)) {
631 /* Add new value */ 579 /* Add new value */
632 memcpy(value, (char *) iwe + IW_EV_LCP_LEN, event_len); 580 memcpy(value, &iwe->u, event_len);
633 value += event_len; 581 value += event_len;
634 /* Patch LCP */ 582 /* Patch LCP */
635 iwe->len = value - event; 583 iwe->len = value - event;
636 memcpy(event, (char *) iwe, IW_EV_LCP_LEN); 584 memcpy(event, (char *) iwe, lcp_len);
637 } else 585 }
638 *perr = -E2BIG;
639 return value; 586 return value;
640} 587}
641 588
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index bcd1623245cb..4dd3d93e1960 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -42,7 +42,7 @@
42 * tasklet function. 42 * tasklet function.
43 * 43 *
44 * NOTE: If the driver opts to use the _irqsafe() functions, it may not also 44 * NOTE: If the driver opts to use the _irqsafe() functions, it may not also
45 * use the non-irqsafe functions! 45 * use the non-IRQ-safe functions!
46 */ 46 */
47 47
48/** 48/**
@@ -85,7 +85,7 @@ enum ieee80211_notification_types {
85 * struct ieee80211_ht_bss_info - describing BSS's HT characteristics 85 * struct ieee80211_ht_bss_info - describing BSS's HT characteristics
86 * 86 *
87 * This structure describes most essential parameters needed 87 * This structure describes most essential parameters needed
88 * to describe 802.11n HT characteristics in a BSS 88 * to describe 802.11n HT characteristics in a BSS.
89 * 89 *
90 * @primary_channel: channel number of primery channel 90 * @primary_channel: channel number of primery channel
91 * @bss_cap: 802.11n's general BSS capabilities (e.g. channel width) 91 * @bss_cap: 802.11n's general BSS capabilities (e.g. channel width)
@@ -98,77 +98,49 @@ struct ieee80211_ht_bss_info {
98}; 98};
99 99
100/** 100/**
101 * enum ieee80211_max_queues - maximum number of queues
102 *
103 * @IEEE80211_MAX_QUEUES: Maximum number of regular device queues.
104 * @IEEE80211_MAX_AMPDU_QUEUES: Maximum number of queues usable
105 * for A-MPDU operation.
106 */
107enum ieee80211_max_queues {
108 IEEE80211_MAX_QUEUES = 16,
109 IEEE80211_MAX_AMPDU_QUEUES = 16,
110};
111
112/**
101 * struct ieee80211_tx_queue_params - transmit queue configuration 113 * struct ieee80211_tx_queue_params - transmit queue configuration
102 * 114 *
103 * The information provided in this structure is required for QoS 115 * The information provided in this structure is required for QoS
104 * transmit queue configuration. Cf. IEEE 802.11 7.3.2.29. 116 * transmit queue configuration. Cf. IEEE 802.11 7.3.2.29.
105 * 117 *
106 * @aifs: arbitration interface space [0..255, -1: use default] 118 * @aifs: arbitration interface space [0..255]
107 * @cw_min: minimum contention window [will be a value of the form 119 * @cw_min: minimum contention window [a value of the form
108 * 2^n-1 in the range 1..1023; 0: use default] 120 * 2^n-1 in the range 1..32767]
109 * @cw_max: maximum contention window [like @cw_min] 121 * @cw_max: maximum contention window [like @cw_min]
110 * @txop: maximum burst time in units of 32 usecs, 0 meaning disabled 122 * @txop: maximum burst time in units of 32 usecs, 0 meaning disabled
111 */ 123 */
112struct ieee80211_tx_queue_params { 124struct ieee80211_tx_queue_params {
113 s16 aifs; 125 u16 txop;
114 u16 cw_min; 126 u16 cw_min;
115 u16 cw_max; 127 u16 cw_max;
116 u16 txop; 128 u8 aifs;
117}; 129};
118 130
119/** 131/**
120 * struct ieee80211_tx_queue_stats_data - transmit queue statistics 132 * struct ieee80211_tx_queue_stats - transmit queue statistics
121 * 133 *
122 * @len: number of packets in queue 134 * @len: number of packets in queue
123 * @limit: queue length limit 135 * @limit: queue length limit
124 * @count: number of frames sent 136 * @count: number of frames sent
125 */ 137 */
126struct ieee80211_tx_queue_stats_data { 138struct ieee80211_tx_queue_stats {
127 unsigned int len; 139 unsigned int len;
128 unsigned int limit; 140 unsigned int limit;
129 unsigned int count; 141 unsigned int count;
130}; 142};
131 143
132/**
133 * enum ieee80211_tx_queue - transmit queue number
134 *
135 * These constants are used with some callbacks that take a
136 * queue number to set parameters for a queue.
137 *
138 * @IEEE80211_TX_QUEUE_DATA0: data queue 0
139 * @IEEE80211_TX_QUEUE_DATA1: data queue 1
140 * @IEEE80211_TX_QUEUE_DATA2: data queue 2
141 * @IEEE80211_TX_QUEUE_DATA3: data queue 3
142 * @IEEE80211_TX_QUEUE_DATA4: data queue 4
143 * @IEEE80211_TX_QUEUE_SVP: ??
144 * @NUM_TX_DATA_QUEUES: number of data queues
145 * @IEEE80211_TX_QUEUE_AFTER_BEACON: transmit queue for frames to be
146 * sent after a beacon
147 * @IEEE80211_TX_QUEUE_BEACON: transmit queue for beacon frames
148 * @NUM_TX_DATA_QUEUES_AMPDU: adding more queues for A-MPDU
149 */
150enum ieee80211_tx_queue {
151 IEEE80211_TX_QUEUE_DATA0,
152 IEEE80211_TX_QUEUE_DATA1,
153 IEEE80211_TX_QUEUE_DATA2,
154 IEEE80211_TX_QUEUE_DATA3,
155 IEEE80211_TX_QUEUE_DATA4,
156 IEEE80211_TX_QUEUE_SVP,
157
158 NUM_TX_DATA_QUEUES,
159
160/* due to stupidity in the sub-ioctl userspace interface, the items in
161 * this struct need to have fixed values. As soon as it is removed, we can
162 * fix these entries. */
163 IEEE80211_TX_QUEUE_AFTER_BEACON = 6,
164 IEEE80211_TX_QUEUE_BEACON = 7,
165 NUM_TX_DATA_QUEUES_AMPDU = 16
166};
167
168struct ieee80211_tx_queue_stats {
169 struct ieee80211_tx_queue_stats_data data[NUM_TX_DATA_QUEUES_AMPDU];
170};
171
172struct ieee80211_low_level_stats { 144struct ieee80211_low_level_stats {
173 unsigned int dot11ACKFailureCount; 145 unsigned int dot11ACKFailureCount;
174 unsigned int dot11RTSFailureCount; 146 unsigned int dot11RTSFailureCount;
@@ -229,91 +201,151 @@ struct ieee80211_bss_conf {
229}; 201};
230 202
231/** 203/**
232 * enum mac80211_tx_control_flags - flags to describe Tx configuration for 204 * enum mac80211_tx_control_flags - flags to describe transmission information/status
233 * the Tx frame 205 *
234 * 206 * These flags are used with the @flags member of &ieee80211_tx_info.
235 * These flags are used with the @flags member of &ieee80211_tx_control 207 *
236 * 208 * @IEEE80211_TX_CTL_REQ_TX_STATUS: request TX status callback for this frame.
237 * @IEEE80211_TXCTL_REQ_TX_STATUS: request TX status callback for this frame. 209 * @IEEE80211_TX_CTL_DO_NOT_ENCRYPT: send this frame without encryption;
238 * @IEEE80211_TXCTL_DO_NOT_ENCRYPT: send this frame without encryption; 210 * e.g., for EAPOL frame
239 * e.g., for EAPOL frame 211 * @IEEE80211_TX_CTL_USE_RTS_CTS: use RTS-CTS before sending frame
240 * @IEEE80211_TXCTL_USE_RTS_CTS: use RTS-CTS before sending frame 212 * @IEEE80211_TX_CTL_USE_CTS_PROTECT: use CTS protection for the frame (e.g.,
241 * @IEEE80211_TXCTL_USE_CTS_PROTECT: use CTS protection for the frame (e.g., 213 * for combined 802.11g / 802.11b networks)
242 * for combined 802.11g / 802.11b networks) 214 * @IEEE80211_TX_CTL_NO_ACK: tell the low level not to wait for an ack
243 * @IEEE80211_TXCTL_NO_ACK: tell the low level not to wait for an ack 215 * @IEEE80211_TX_CTL_RATE_CTRL_PROBE: TBD
244 * @IEEE80211_TXCTL_RATE_CTRL_PROBE 216 * @IEEE80211_TX_CTL_CLEAR_PS_FILT: clear powersave filter for destination
245 * @EEE80211_TXCTL_CLEAR_PS_FILT: clear powersave filter 217 * station
246 * for destination station 218 * @IEEE80211_TX_CTL_REQUEUE: TBD
247 * @IEEE80211_TXCTL_REQUEUE: 219 * @IEEE80211_TX_CTL_FIRST_FRAGMENT: this is a first fragment of the frame
248 * @IEEE80211_TXCTL_FIRST_FRAGMENT: this is a first fragment of the frame 220 * @IEEE80211_TX_CTL_SHORT_PREAMBLE: TBD
249 * @IEEE80211_TXCTL_LONG_RETRY_LIMIT: this frame should be send using the 221 * @IEEE80211_TX_CTL_LONG_RETRY_LIMIT: this frame should be send using the
250 * through set_retry_limit configured long 222 * through set_retry_limit configured long retry value
251 * retry value 223 * @IEEE80211_TX_CTL_EAPOL_FRAME: internal to mac80211
252 * @IEEE80211_TXCTL_EAPOL_FRAME: internal to mac80211 224 * @IEEE80211_TX_CTL_SEND_AFTER_DTIM: send this frame after DTIM beacon
253 * @IEEE80211_TXCTL_SEND_AFTER_DTIM: send this frame after DTIM beacon 225 * @IEEE80211_TX_CTL_AMPDU: this frame should be sent as part of an A-MPDU
254 * @IEEE80211_TXCTL_AMPDU: this frame should be sent as part of an A-MPDU 226 * @IEEE80211_TX_CTL_OFDM_HT: this frame can be sent in HT OFDM rates. number
255 * @IEEE80211_TXCTL_OFDM_HT: this frame can be sent in HT OFDM rates. number 227 * of streams when this flag is on can be extracted from antenna_sel_tx,
256 * of streams when this flag is on can be extracted 228 * so if 1 antenna is marked use SISO, 2 antennas marked use MIMO, n
257 * from antenna_sel_tx, so if 1 antenna is marked 229 * antennas marked use MIMO_n.
258 * use SISO, 2 antennas marked use MIMO, n antennas 230 * @IEEE80211_TX_CTL_GREEN_FIELD: use green field protection for this frame
259 * marked use MIMO_n. 231 * @IEEE80211_TX_CTL_40_MHZ_WIDTH: send this frame using 40 Mhz channel width
260 * @IEEE80211_TXCTL_GREEN_FIELD: use green field protection for this frame 232 * @IEEE80211_TX_CTL_DUP_DATA: duplicate data frame on both 20 Mhz channels
261 * @IEEE80211_TXCTL_40_MHZ_WIDTH: send this frame using 40 Mhz channel width 233 * @IEEE80211_TX_CTL_SHORT_GI: send this frame using short guard interval
262 * @IEEE80211_TXCTL_DUP_DATA: duplicate data frame on both 20 Mhz channels 234 * @IEEE80211_TX_CTL_INJECTED: TBD
263 * @IEEE80211_TXCTL_SHORT_GI: send this frame using short guard interval 235 * @IEEE80211_TX_STAT_TX_FILTERED: The frame was not transmitted
236 * because the destination STA was in powersave mode.
237 * @IEEE80211_TX_STAT_ACK: Frame was acknowledged
238 * @IEEE80211_TX_STAT_AMPDU: The frame was aggregated, so status
239 * is for the whole aggregation.
240 * @IEEE80211_TX_STAT_AMPDU_NO_BACK: no block ack was returned,
241 * so consider using block ack request (BAR).
242 * @IEEE80211_TX_CTL_ASSIGN_SEQ: The driver has to assign a sequence
243 * number to this frame, taking care of not overwriting the fragment
244 * number and increasing the sequence number only when the
245 * IEEE80211_TX_CTL_FIRST_FRAGMENT flags is set. mac80211 will properly
246 * assign sequence numbers to QoS-data frames but cannot do so correctly
247 * for non-QoS-data and management frames because beacons need them from
248 * that counter as well and mac80211 cannot guarantee proper sequencing.
249 * If this flag is set, the driver should instruct the hardware to
250 * assign a sequence number to the frame or assign one itself. Cf. IEEE
251 * 802.11-2007 7.1.3.4.1 paragraph 3. This flag will always be set for
252 * beacons always be clear for frames without a sequence number field.
264 */ 253 */
265enum mac80211_tx_control_flags { 254enum mac80211_tx_control_flags {
266 IEEE80211_TXCTL_REQ_TX_STATUS = (1<<0), 255 IEEE80211_TX_CTL_REQ_TX_STATUS = BIT(0),
267 IEEE80211_TXCTL_DO_NOT_ENCRYPT = (1<<1), 256 IEEE80211_TX_CTL_DO_NOT_ENCRYPT = BIT(1),
268 IEEE80211_TXCTL_USE_RTS_CTS = (1<<2), 257 IEEE80211_TX_CTL_USE_RTS_CTS = BIT(2),
269 IEEE80211_TXCTL_USE_CTS_PROTECT = (1<<3), 258 IEEE80211_TX_CTL_USE_CTS_PROTECT = BIT(3),
270 IEEE80211_TXCTL_NO_ACK = (1<<4), 259 IEEE80211_TX_CTL_NO_ACK = BIT(4),
271 IEEE80211_TXCTL_RATE_CTRL_PROBE = (1<<5), 260 IEEE80211_TX_CTL_RATE_CTRL_PROBE = BIT(5),
272 IEEE80211_TXCTL_CLEAR_PS_FILT = (1<<6), 261 IEEE80211_TX_CTL_CLEAR_PS_FILT = BIT(6),
273 IEEE80211_TXCTL_REQUEUE = (1<<7), 262 IEEE80211_TX_CTL_REQUEUE = BIT(7),
274 IEEE80211_TXCTL_FIRST_FRAGMENT = (1<<8), 263 IEEE80211_TX_CTL_FIRST_FRAGMENT = BIT(8),
275 IEEE80211_TXCTL_SHORT_PREAMBLE = (1<<9), 264 IEEE80211_TX_CTL_SHORT_PREAMBLE = BIT(9),
276 IEEE80211_TXCTL_LONG_RETRY_LIMIT = (1<<10), 265 IEEE80211_TX_CTL_LONG_RETRY_LIMIT = BIT(10),
277 IEEE80211_TXCTL_EAPOL_FRAME = (1<<11), 266 IEEE80211_TX_CTL_EAPOL_FRAME = BIT(11),
278 IEEE80211_TXCTL_SEND_AFTER_DTIM = (1<<12), 267 IEEE80211_TX_CTL_SEND_AFTER_DTIM = BIT(12),
279 IEEE80211_TXCTL_AMPDU = (1<<13), 268 IEEE80211_TX_CTL_AMPDU = BIT(13),
280 IEEE80211_TXCTL_OFDM_HT = (1<<14), 269 IEEE80211_TX_CTL_OFDM_HT = BIT(14),
281 IEEE80211_TXCTL_GREEN_FIELD = (1<<15), 270 IEEE80211_TX_CTL_GREEN_FIELD = BIT(15),
282 IEEE80211_TXCTL_40_MHZ_WIDTH = (1<<16), 271 IEEE80211_TX_CTL_40_MHZ_WIDTH = BIT(16),
283 IEEE80211_TXCTL_DUP_DATA = (1<<17), 272 IEEE80211_TX_CTL_DUP_DATA = BIT(17),
284 IEEE80211_TXCTL_SHORT_GI = (1<<18), 273 IEEE80211_TX_CTL_SHORT_GI = BIT(18),
274 IEEE80211_TX_CTL_INJECTED = BIT(19),
275 IEEE80211_TX_STAT_TX_FILTERED = BIT(20),
276 IEEE80211_TX_STAT_ACK = BIT(21),
277 IEEE80211_TX_STAT_AMPDU = BIT(22),
278 IEEE80211_TX_STAT_AMPDU_NO_BACK = BIT(23),
279 IEEE80211_TX_CTL_ASSIGN_SEQ = BIT(24),
285}; 280};
286 281
287/* Transmit control fields. This data structure is passed to low-level driver
288 * with each TX frame. The low-level driver is responsible for configuring
289 * the hardware to use given values (depending on what is supported). */
290 282
291struct ieee80211_tx_control { 283#define IEEE80211_TX_INFO_DRIVER_DATA_SIZE \
292 struct ieee80211_vif *vif; 284 (sizeof(((struct sk_buff *)0)->cb) - 8)
293 struct ieee80211_rate *tx_rate; 285#define IEEE80211_TX_INFO_DRIVER_DATA_PTRS \
294 286 (IEEE80211_TX_INFO_DRIVER_DATA_SIZE / sizeof(void *))
295 /* Transmit rate for RTS/CTS frame */ 287
296 struct ieee80211_rate *rts_cts_rate; 288/**
297 289 * struct ieee80211_tx_info - skb transmit information
298 /* retry rate for the last retries */ 290 *
299 struct ieee80211_rate *alt_retry_rate; 291 * This structure is placed in skb->cb for three uses:
300 292 * (1) mac80211 TX control - mac80211 tells the driver what to do
301 u32 flags; /* tx control flags defined above */ 293 * (2) driver internal use (if applicable)
302 u8 key_idx; /* keyidx from hw->set_key(), undefined if 294 * (3) TX status information - driver tells mac80211 what happened
303 * IEEE80211_TXCTL_DO_NOT_ENCRYPT is set */ 295 *
304 u8 retry_limit; /* 1 = only first attempt, 2 = one retry, .. 296 * @flags: transmit info flags, defined above
305 * This could be used when set_retry_limit 297 * @band: TBD
306 * is not implemented by the driver */ 298 * @tx_rate_idx: TBD
307 u8 antenna_sel_tx; /* 0 = default/diversity, otherwise bit 299 * @antenna_sel_tx: TBD
308 * position represents antenna number used */ 300 * @control: union for control data
309 u8 icv_len; /* length of the ICV/MIC field in octets */ 301 * @status: union for status data
310 u8 iv_len; /* length of the IV field in octets */ 302 * @driver_data: array of driver_data pointers
311 u8 queue; /* hardware queue to use for this frame; 303 * @retry_count: number of retries
312 * 0 = highest, hw->queues-1 = lowest */ 304 * @excessive_retries: set to 1 if the frame was retried many times
313 u16 aid; /* Station AID */ 305 * but not acknowledged
314 int type; /* internal */ 306 * @ampdu_ack_len: number of aggregated frames.
307 * relevant only if IEEE80211_TX_STATUS_AMPDU was set.
308 * @ampdu_ack_map: block ack bit map for the aggregation.
309 * relevant only if IEEE80211_TX_STATUS_AMPDU was set.
310 * @ack_signal: signal strength of the ACK frame
311 */
312struct ieee80211_tx_info {
313 /* common information */
314 u32 flags;
315 u8 band;
316 s8 tx_rate_idx;
317 u8 antenna_sel_tx;
318
319 /* 1 byte hole */
320
321 union {
322 struct {
323 struct ieee80211_vif *vif;
324 struct ieee80211_key_conf *hw_key;
325 unsigned long jiffies;
326 int ifindex;
327 u16 aid;
328 s8 rts_cts_rate_idx, alt_retry_rate_idx;
329 u8 retry_limit;
330 u8 icv_len;
331 u8 iv_len;
332 } control;
333 struct {
334 u64 ampdu_ack_map;
335 int ack_signal;
336 u8 retry_count;
337 bool excessive_retries;
338 u8 ampdu_ack_len;
339 } status;
340 void *driver_data[IEEE80211_TX_INFO_DRIVER_DATA_PTRS];
341 };
315}; 342};
316 343
344static inline struct ieee80211_tx_info *IEEE80211_SKB_CB(struct sk_buff *skb)
345{
346 return (struct ieee80211_tx_info *)skb->cb;
347}
348
317 349
318/** 350/**
319 * enum mac80211_rx_flags - receive flags 351 * enum mac80211_rx_flags - receive flags
@@ -353,13 +385,16 @@ enum mac80211_rx_flags {
353 * The low-level driver should provide this information (the subset 385 * The low-level driver should provide this information (the subset
354 * supported by hardware) to the 802.11 code with each received 386 * supported by hardware) to the 802.11 code with each received
355 * frame. 387 * frame.
388 *
356 * @mactime: value in microseconds of the 64-bit Time Synchronization Function 389 * @mactime: value in microseconds of the 64-bit Time Synchronization Function
357 * (TSF) timer when the first data symbol (MPDU) arrived at the hardware. 390 * (TSF) timer when the first data symbol (MPDU) arrived at the hardware.
358 * @band: the active band when this frame was received 391 * @band: the active band when this frame was received
359 * @freq: frequency the radio was tuned to when receiving this frame, in MHz 392 * @freq: frequency the radio was tuned to when receiving this frame, in MHz
360 * @ssi: signal strength when receiving this frame 393 * @signal: signal strength when receiving this frame, either in dBm, in dB or
361 * @signal: used as 'qual' in statistics reporting 394 * unspecified depending on the hardware capabilities flags
362 * @noise: PHY noise when receiving this frame 395 * @IEEE80211_HW_SIGNAL_*
396 * @noise: noise when receiving this frame, in dBm.
397 * @qual: overall signal quality indication, in percent (0-100).
363 * @antenna: antenna used 398 * @antenna: antenna used
364 * @rate_idx: index of data rate into band's supported rates 399 * @rate_idx: index of data rate into band's supported rates
365 * @flag: %RX_FLAG_* 400 * @flag: %RX_FLAG_*
@@ -368,64 +403,15 @@ struct ieee80211_rx_status {
368 u64 mactime; 403 u64 mactime;
369 enum ieee80211_band band; 404 enum ieee80211_band band;
370 int freq; 405 int freq;
371 int ssi;
372 int signal; 406 int signal;
373 int noise; 407 int noise;
408 int qual;
374 int antenna; 409 int antenna;
375 int rate_idx; 410 int rate_idx;
376 int flag; 411 int flag;
377}; 412};
378 413
379/** 414/**
380 * enum ieee80211_tx_status_flags - transmit status flags
381 *
382 * Status flags to indicate various transmit conditions.
383 *
384 * @IEEE80211_TX_STATUS_TX_FILTERED: The frame was not transmitted
385 * because the destination STA was in powersave mode.
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.
389 */
390enum ieee80211_tx_status_flags {
391 IEEE80211_TX_STATUS_TX_FILTERED = 1<<0,
392 IEEE80211_TX_STATUS_ACK = 1<<1,
393 IEEE80211_TX_STATUS_AMPDU = 1<<2,
394};
395
396/**
397 * struct ieee80211_tx_status - transmit status
398 *
399 * As much information as possible should be provided for each transmitted
400 * frame with ieee80211_tx_status().
401 *
402 * @control: a copy of the &struct ieee80211_tx_control passed to the driver
403 * in the tx() callback.
404 * @flags: transmit status flags, defined above
405 * @retry_count: number of retries
406 * @excessive_retries: set to 1 if the frame was retried many times
407 * but not acknowledged
408 * @ampdu_ack_len: number of aggregated frames.
409 * relevant only if IEEE80211_TX_STATUS_AMPDU was set.
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
413 * @queue_length: ?? REMOVE
414 * @queue_number: ?? REMOVE
415 */
416struct ieee80211_tx_status {
417 struct ieee80211_tx_control control;
418 u8 flags;
419 u8 retry_count;
420 bool excessive_retries;
421 u8 ampdu_ack_len;
422 u64 ampdu_ack_map;
423 int ack_signal;
424 int queue_length;
425 int queue_number;
426};
427
428/**
429 * enum ieee80211_conf_flags - configuration flags 415 * enum ieee80211_conf_flags - configuration flags
430 * 416 *
431 * Flags to define PHY configuration options 417 * Flags to define PHY configuration options
@@ -433,11 +419,13 @@ struct ieee80211_tx_status {
433 * @IEEE80211_CONF_SHORT_SLOT_TIME: use 802.11g short slot time 419 * @IEEE80211_CONF_SHORT_SLOT_TIME: use 802.11g short slot time
434 * @IEEE80211_CONF_RADIOTAP: add radiotap header at receive time (if supported) 420 * @IEEE80211_CONF_RADIOTAP: add radiotap header at receive time (if supported)
435 * @IEEE80211_CONF_SUPPORT_HT_MODE: use 802.11n HT capabilities (if supported) 421 * @IEEE80211_CONF_SUPPORT_HT_MODE: use 802.11n HT capabilities (if supported)
422 * @IEEE80211_CONF_PS: Enable 802.11 power save mode
436 */ 423 */
437enum ieee80211_conf_flags { 424enum ieee80211_conf_flags {
438 IEEE80211_CONF_SHORT_SLOT_TIME = (1<<0), 425 IEEE80211_CONF_SHORT_SLOT_TIME = (1<<0),
439 IEEE80211_CONF_RADIOTAP = (1<<1), 426 IEEE80211_CONF_RADIOTAP = (1<<1),
440 IEEE80211_CONF_SUPPORT_HT_MODE = (1<<2), 427 IEEE80211_CONF_SUPPORT_HT_MODE = (1<<2),
428 IEEE80211_CONF_PS = (1<<3),
441}; 429};
442 430
443/** 431/**
@@ -553,34 +541,38 @@ struct ieee80211_if_init_conf {
553}; 541};
554 542
555/** 543/**
544 * enum ieee80211_if_conf_change - interface config change flags
545 *
546 * @IEEE80211_IFCC_BSSID: The BSSID changed.
547 * @IEEE80211_IFCC_SSID: The SSID changed.
548 * @IEEE80211_IFCC_BEACON: The beacon for this interface changed
549 * (currently AP and MESH only), use ieee80211_beacon_get().
550 */
551enum ieee80211_if_conf_change {
552 IEEE80211_IFCC_BSSID = BIT(0),
553 IEEE80211_IFCC_SSID = BIT(1),
554 IEEE80211_IFCC_BEACON = BIT(2),
555};
556
557/**
556 * struct ieee80211_if_conf - configuration of an interface 558 * struct ieee80211_if_conf - configuration of an interface
557 * 559 *
558 * @type: type of the interface. This is always the same as was specified in 560 * @changed: parameters that have changed, see &enum ieee80211_if_conf_change.
559 * &struct ieee80211_if_init_conf. The type of an interface never changes
560 * during the life of the interface; this field is present only for
561 * convenience.
562 * @bssid: BSSID of the network we are associated to/creating. 561 * @bssid: BSSID of the network we are associated to/creating.
563 * @ssid: used (together with @ssid_len) by drivers for hardware that 562 * @ssid: used (together with @ssid_len) by drivers for hardware that
564 * generate beacons independently. The pointer is valid only during the 563 * generate beacons independently. The pointer is valid only during the
565 * config_interface() call, so copy the value somewhere if you need 564 * config_interface() call, so copy the value somewhere if you need
566 * it. 565 * it.
567 * @ssid_len: length of the @ssid field. 566 * @ssid_len: length of the @ssid field.
568 * @beacon: beacon template. Valid only if @host_gen_beacon_template in
569 * &struct ieee80211_hw is set. The driver is responsible of freeing
570 * the sk_buff.
571 * @beacon_control: tx_control for the beacon template, this field is only
572 * valid when the @beacon field was set.
573 * 567 *
574 * This structure is passed to the config_interface() callback of 568 * This structure is passed to the config_interface() callback of
575 * &struct ieee80211_hw. 569 * &struct ieee80211_hw.
576 */ 570 */
577struct ieee80211_if_conf { 571struct ieee80211_if_conf {
578 int type; 572 u32 changed;
579 u8 *bssid; 573 u8 *bssid;
580 u8 *ssid; 574 u8 *ssid;
581 size_t ssid_len; 575 size_t ssid_len;
582 struct sk_buff *beacon;
583 struct ieee80211_tx_control *beacon_control;
584}; 576};
585 577
586/** 578/**
@@ -597,8 +589,8 @@ enum ieee80211_key_alg {
597 589
598/** 590/**
599 * enum ieee80211_key_len - key length 591 * enum ieee80211_key_len - key length
600 * @WEP40: WEP 5 byte long key 592 * @LEN_WEP40: WEP 5-byte long key
601 * @WEP104: WEP 13 byte long key 593 * @LEN_WEP104: WEP 13-byte long key
602 */ 594 */
603enum ieee80211_key_len { 595enum ieee80211_key_len {
604 LEN_WEP40 = 5, 596 LEN_WEP40 = 5,
@@ -619,11 +611,14 @@ enum ieee80211_key_len {
619 * @IEEE80211_KEY_FLAG_GENERATE_MMIC: This flag should be set by 611 * @IEEE80211_KEY_FLAG_GENERATE_MMIC: This flag should be set by
620 * the driver for a TKIP key if it requires Michael MIC 612 * the driver for a TKIP key if it requires Michael MIC
621 * generation in software. 613 * generation in software.
614 * @IEEE80211_KEY_FLAG_PAIRWISE: Set by mac80211, this flag indicates
615 * that the key is pairwise rather then a shared key.
622 */ 616 */
623enum ieee80211_key_flags { 617enum ieee80211_key_flags {
624 IEEE80211_KEY_FLAG_WMM_STA = 1<<0, 618 IEEE80211_KEY_FLAG_WMM_STA = 1<<0,
625 IEEE80211_KEY_FLAG_GENERATE_IV = 1<<1, 619 IEEE80211_KEY_FLAG_GENERATE_IV = 1<<1,
626 IEEE80211_KEY_FLAG_GENERATE_MMIC= 1<<2, 620 IEEE80211_KEY_FLAG_GENERATE_MMIC= 1<<2,
621 IEEE80211_KEY_FLAG_PAIRWISE = 1<<3,
627}; 622};
628 623
629/** 624/**
@@ -639,7 +634,12 @@ enum ieee80211_key_flags {
639 * @flags: key flags, see &enum ieee80211_key_flags. 634 * @flags: key flags, see &enum ieee80211_key_flags.
640 * @keyidx: the key index (0-3) 635 * @keyidx: the key index (0-3)
641 * @keylen: key material length 636 * @keylen: key material length
642 * @key: key material 637 * @key: key material. For ALG_TKIP the key is encoded as a 256-bit (32 byte)
638 * data block:
639 * - Temporal Encryption Key (128 bits)
640 * - Temporal Authenticator Tx MIC Key (64 bits)
641 * - Temporal Authenticator Rx MIC Key (64 bits)
642 *
643 */ 643 */
644struct ieee80211_key_conf { 644struct ieee80211_key_conf {
645 enum ieee80211_key_alg alg; 645 enum ieee80211_key_alg alg;
@@ -667,7 +667,7 @@ enum set_key_cmd {
667 * enum sta_notify_cmd - sta notify command 667 * enum sta_notify_cmd - sta notify command
668 * 668 *
669 * Used with the sta_notify() callback in &struct ieee80211_ops, this 669 * Used with the sta_notify() callback in &struct ieee80211_ops, this
670 * indicates addition and removal of a station to station table 670 * indicates addition and removal of a station to station table.
671 * 671 *
672 * @STA_NOTIFY_ADD: a station was added to the station table 672 * @STA_NOTIFY_ADD: a station was added to the station table
673 * @STA_NOTIFY_REMOVE: a station being removed from the station table 673 * @STA_NOTIFY_REMOVE: a station being removed from the station table
@@ -700,15 +700,6 @@ enum ieee80211_tkip_key_type {
700 * any particular flags. There are some exceptions to this rule, 700 * any particular flags. There are some exceptions to this rule,
701 * however, so you are advised to review these flags carefully. 701 * however, so you are advised to review these flags carefully.
702 * 702 *
703 * @IEEE80211_HW_HOST_GEN_BEACON_TEMPLATE:
704 * The device only needs to be supplied with a beacon template.
705 * If you need the host to generate each beacon then don't use
706 * this flag and call ieee80211_beacon_get() when you need the
707 * next beacon frame. Note that if you set this flag, you must
708 * implement the set_tim() callback for powersave mode to work
709 * properly.
710 * This flag is only relevant for access-point mode.
711 *
712 * @IEEE80211_HW_RX_INCLUDES_FCS: 703 * @IEEE80211_HW_RX_INCLUDES_FCS:
713 * Indicates that received frames passed to the stack include 704 * Indicates that received frames passed to the stack include
714 * the FCS at the end. 705 * the FCS at the end.
@@ -730,6 +721,29 @@ enum ieee80211_tkip_key_type {
730 * @IEEE80211_HW_2GHZ_SHORT_PREAMBLE_INCAPABLE: 721 * @IEEE80211_HW_2GHZ_SHORT_PREAMBLE_INCAPABLE:
731 * Hardware is not capable of receiving frames with short preamble on 722 * Hardware is not capable of receiving frames with short preamble on
732 * the 2.4 GHz band. 723 * the 2.4 GHz band.
724 *
725 * @IEEE80211_HW_SIGNAL_UNSPEC:
726 * Hardware can provide signal values but we don't know its units. We
727 * expect values between 0 and @max_signal.
728 * If possible please provide dB or dBm instead.
729 *
730 * @IEEE80211_HW_SIGNAL_DB:
731 * Hardware gives signal values in dB, decibel difference from an
732 * arbitrary, fixed reference. We expect values between 0 and @max_signal.
733 * If possible please provide dBm instead.
734 *
735 * @IEEE80211_HW_SIGNAL_DBM:
736 * Hardware gives signal values in dBm, decibel difference from
737 * one milliwatt. This is the preferred method since it is standardized
738 * between different devices. @max_signal does not need to be set.
739 *
740 * @IEEE80211_HW_NOISE_DBM:
741 * Hardware can provide noise (radio interference) values in units dBm,
742 * decibel difference from one milliwatt.
743 *
744 * @IEEE80211_HW_SPECTRUM_MGMT:
745 * Hardware supports spectrum management defined in 802.11h
746 * Measurement, Channel Switch, Quieting, TPC
733 */ 747 */
734enum ieee80211_hw_flags { 748enum ieee80211_hw_flags {
735 IEEE80211_HW_HOST_GEN_BEACON_TEMPLATE = 1<<0, 749 IEEE80211_HW_HOST_GEN_BEACON_TEMPLATE = 1<<0,
@@ -737,6 +751,11 @@ enum ieee80211_hw_flags {
737 IEEE80211_HW_HOST_BROADCAST_PS_BUFFERING = 1<<2, 751 IEEE80211_HW_HOST_BROADCAST_PS_BUFFERING = 1<<2,
738 IEEE80211_HW_2GHZ_SHORT_SLOT_INCAPABLE = 1<<3, 752 IEEE80211_HW_2GHZ_SHORT_SLOT_INCAPABLE = 1<<3,
739 IEEE80211_HW_2GHZ_SHORT_PREAMBLE_INCAPABLE = 1<<4, 753 IEEE80211_HW_2GHZ_SHORT_PREAMBLE_INCAPABLE = 1<<4,
754 IEEE80211_HW_SIGNAL_UNSPEC = 1<<5,
755 IEEE80211_HW_SIGNAL_DB = 1<<6,
756 IEEE80211_HW_SIGNAL_DBM = 1<<7,
757 IEEE80211_HW_NOISE_DBM = 1<<8,
758 IEEE80211_HW_SPECTRUM_MGMT = 1<<9,
740}; 759};
741 760
742/** 761/**
@@ -754,8 +773,11 @@ enum ieee80211_hw_flags {
754 * @conf: &struct ieee80211_conf, device configuration, don't use. 773 * @conf: &struct ieee80211_conf, device configuration, don't use.
755 * 774 *
756 * @workqueue: single threaded workqueue available for driver use, 775 * @workqueue: single threaded workqueue available for driver use,
757 * allocated by mac80211 on registration and flushed on 776 * allocated by mac80211 on registration and flushed when an
758 * unregistration. 777 * interface is removed.
778 * NOTICE: All work performed on this workqueue should NEVER
779 * acquire the RTNL lock (i.e. Don't use the function
780 * ieee80211_iterate_active_interfaces())
759 * 781 *
760 * @priv: pointer to private area that was allocated for driver use 782 * @priv: pointer to private area that was allocated for driver use
761 * along with this structure. 783 * along with this structure.
@@ -767,15 +789,18 @@ enum ieee80211_hw_flags {
767 * 789 *
768 * @channel_change_time: time (in microseconds) it takes to change channels. 790 * @channel_change_time: time (in microseconds) it takes to change channels.
769 * 791 *
770 * @max_rssi: Maximum value for ssi in RX information, use 792 * @max_signal: Maximum value for signal (rssi) in RX information, used
771 * negative numbers for dBm and 0 to indicate no support. 793 * only when @IEEE80211_HW_SIGNAL_UNSPEC or @IEEE80211_HW_SIGNAL_DB
772 *
773 * @max_signal: like @max_rssi, but for the signal value.
774 *
775 * @max_noise: like @max_rssi, but for the noise value.
776 * 794 *
777 * @queues: number of available hardware transmit queues for 795 * @queues: number of available hardware transmit queues for
778 * data packets. WMM/QoS requires at least four. 796 * data packets. WMM/QoS requires at least four, these
797 * queues need to have configurable access parameters.
798 *
799 * @ampdu_queues: number of available hardware transmit queues
800 * for A-MPDU packets, these have no access parameters
801 * because they're used only for A-MPDU frames. Note that
802 * mac80211 will not currently use any of the regular queues
803 * for aggregation.
779 * 804 *
780 * @rate_control_algorithm: rate control algorithm for this hardware. 805 * @rate_control_algorithm: rate control algorithm for this hardware.
781 * If unset (NULL), the default algorithm will be used. Must be 806 * If unset (NULL), the default algorithm will be used. Must be
@@ -794,10 +819,8 @@ struct ieee80211_hw {
794 unsigned int extra_tx_headroom; 819 unsigned int extra_tx_headroom;
795 int channel_change_time; 820 int channel_change_time;
796 int vif_data_size; 821 int vif_data_size;
797 u8 queues; 822 u16 queues, ampdu_queues;
798 s8 max_rssi;
799 s8 max_signal; 823 s8 max_signal;
800 s8 max_noise;
801}; 824};
802 825
803/** 826/**
@@ -822,6 +845,43 @@ static inline void SET_IEEE80211_PERM_ADDR(struct ieee80211_hw *hw, u8 *addr)
822 memcpy(hw->wiphy->perm_addr, addr, ETH_ALEN); 845 memcpy(hw->wiphy->perm_addr, addr, ETH_ALEN);
823} 846}
824 847
848static inline int ieee80211_num_regular_queues(struct ieee80211_hw *hw)
849{
850 return hw->queues;
851}
852
853static inline int ieee80211_num_queues(struct ieee80211_hw *hw)
854{
855 return hw->queues + hw->ampdu_queues;
856}
857
858static inline struct ieee80211_rate *
859ieee80211_get_tx_rate(const struct ieee80211_hw *hw,
860 const struct ieee80211_tx_info *c)
861{
862 if (WARN_ON(c->tx_rate_idx < 0))
863 return NULL;
864 return &hw->wiphy->bands[c->band]->bitrates[c->tx_rate_idx];
865}
866
867static inline struct ieee80211_rate *
868ieee80211_get_rts_cts_rate(const struct ieee80211_hw *hw,
869 const struct ieee80211_tx_info *c)
870{
871 if (c->control.rts_cts_rate_idx < 0)
872 return NULL;
873 return &hw->wiphy->bands[c->band]->bitrates[c->control.rts_cts_rate_idx];
874}
875
876static inline struct ieee80211_rate *
877ieee80211_get_alt_retry_rate(const struct ieee80211_hw *hw,
878 const struct ieee80211_tx_info *c)
879{
880 if (c->control.alt_retry_rate_idx < 0)
881 return NULL;
882 return &hw->wiphy->bands[c->band]->bitrates[c->control.alt_retry_rate_idx];
883}
884
825/** 885/**
826 * DOC: Hardware crypto acceleration 886 * DOC: Hardware crypto acceleration
827 * 887 *
@@ -979,8 +1039,10 @@ enum ieee80211_ampdu_mlme_action {
979 * @tx: Handler that 802.11 module calls for each transmitted frame. 1039 * @tx: Handler that 802.11 module calls for each transmitted frame.
980 * skb contains the buffer starting from the IEEE 802.11 header. 1040 * skb contains the buffer starting from the IEEE 802.11 header.
981 * The low-level driver should send the frame out based on 1041 * The low-level driver should send the frame out based on
982 * configuration in the TX control data. Must be implemented and 1042 * configuration in the TX control data. This handler should,
983 * atomic. 1043 * preferably, never fail and stop queues appropriately, more
1044 * importantly, however, it must never fail for A-MPDU-queues.
1045 * Must be implemented and atomic.
984 * 1046 *
985 * @start: Called before the first netdevice attached to the hardware 1047 * @start: Called before the first netdevice attached to the hardware
986 * is enabled. This should turn on the hardware and must turn on 1048 * is enabled. This should turn on the hardware and must turn on
@@ -1072,15 +1134,13 @@ enum ieee80211_ampdu_mlme_action {
1072 * of assocaited station or AP. 1134 * of assocaited station or AP.
1073 * 1135 *
1074 * @conf_tx: Configure TX queue parameters (EDCF (aifs, cw_min, cw_max), 1136 * @conf_tx: Configure TX queue parameters (EDCF (aifs, cw_min, cw_max),
1075 * bursting) for a hardware TX queue. The @queue parameter uses the 1137 * bursting) for a hardware TX queue. Must be atomic.
1076 * %IEEE80211_TX_QUEUE_* constants. Must be atomic.
1077 * 1138 *
1078 * @get_tx_stats: Get statistics of the current TX queue status. This is used 1139 * @get_tx_stats: Get statistics of the current TX queue status. This is used
1079 * to get number of currently queued packets (queue length), maximum queue 1140 * to get number of currently queued packets (queue length), maximum queue
1080 * size (limit), and total number of packets sent using each TX queue 1141 * size (limit), and total number of packets sent using each TX queue
1081 * (count). This information is used for WMM to find out which TX 1142 * (count). The 'stats' pointer points to an array that has hw->queues +
1082 * queues have room for more packets and by hostapd to provide 1143 * hw->ampdu_queues items.
1083 * statistics about the current queueing state to external programs.
1084 * 1144 *
1085 * @get_tsf: Get the current TSF timer value from firmware/hardware. Currently, 1145 * @get_tsf: Get the current TSF timer value from firmware/hardware. Currently,
1086 * this is only used for IBSS mode debugging and, as such, is not a 1146 * this is only used for IBSS mode debugging and, as such, is not a
@@ -1091,17 +1151,6 @@ enum ieee80211_ampdu_mlme_action {
1091 * function is optional if the firmware/hardware takes full care of 1151 * function is optional if the firmware/hardware takes full care of
1092 * TSF synchronization. 1152 * TSF synchronization.
1093 * 1153 *
1094 * @beacon_update: Setup beacon data for IBSS beacons. Unlike access point,
1095 * IBSS uses a fixed beacon frame which is configured using this
1096 * function.
1097 * If the driver returns success (0) from this callback, it owns
1098 * the skb. That means the driver is responsible to kfree_skb() it.
1099 * The control structure is not dynamically allocated. That means the
1100 * driver does not own the pointer and if it needs it somewhere
1101 * outside of the context of this function, it must copy it
1102 * somewhere else.
1103 * This handler is required only for IBSS mode.
1104 *
1105 * @tx_last_beacon: Determine whether the last IBSS beacon was sent by us. 1154 * @tx_last_beacon: Determine whether the last IBSS beacon was sent by us.
1106 * This is needed only for IBSS mode and the result of this function is 1155 * This is needed only for IBSS mode and the result of this function is
1107 * used to determine whether to reply to Probe Requests. 1156 * used to determine whether to reply to Probe Requests.
@@ -1116,8 +1165,7 @@ enum ieee80211_ampdu_mlme_action {
1116 * that TX/RX_STOP can pass NULL for this parameter. 1165 * that TX/RX_STOP can pass NULL for this parameter.
1117 */ 1166 */
1118struct ieee80211_ops { 1167struct ieee80211_ops {
1119 int (*tx)(struct ieee80211_hw *hw, struct sk_buff *skb, 1168 int (*tx)(struct ieee80211_hw *hw, struct sk_buff *skb);
1120 struct ieee80211_tx_control *control);
1121 int (*start)(struct ieee80211_hw *hw); 1169 int (*start)(struct ieee80211_hw *hw);
1122 void (*stop)(struct ieee80211_hw *hw); 1170 void (*stop)(struct ieee80211_hw *hw);
1123 int (*add_interface)(struct ieee80211_hw *hw, 1171 int (*add_interface)(struct ieee80211_hw *hw,
@@ -1154,15 +1202,12 @@ struct ieee80211_ops {
1154 u32 short_retry, u32 long_retr); 1202 u32 short_retry, u32 long_retr);
1155 void (*sta_notify)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, 1203 void (*sta_notify)(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
1156 enum sta_notify_cmd, const u8 *addr); 1204 enum sta_notify_cmd, const u8 *addr);
1157 int (*conf_tx)(struct ieee80211_hw *hw, int queue, 1205 int (*conf_tx)(struct ieee80211_hw *hw, u16 queue,
1158 const struct ieee80211_tx_queue_params *params); 1206 const struct ieee80211_tx_queue_params *params);
1159 int (*get_tx_stats)(struct ieee80211_hw *hw, 1207 int (*get_tx_stats)(struct ieee80211_hw *hw,
1160 struct ieee80211_tx_queue_stats *stats); 1208 struct ieee80211_tx_queue_stats *stats);
1161 u64 (*get_tsf)(struct ieee80211_hw *hw); 1209 u64 (*get_tsf)(struct ieee80211_hw *hw);
1162 void (*reset_tsf)(struct ieee80211_hw *hw); 1210 void (*reset_tsf)(struct ieee80211_hw *hw);
1163 int (*beacon_update)(struct ieee80211_hw *hw,
1164 struct sk_buff *skb,
1165 struct ieee80211_tx_control *control);
1166 int (*tx_last_beacon)(struct ieee80211_hw *hw); 1211 int (*tx_last_beacon)(struct ieee80211_hw *hw);
1167 int (*ampdu_action)(struct ieee80211_hw *hw, 1212 int (*ampdu_action)(struct ieee80211_hw *hw,
1168 enum ieee80211_ampdu_mlme_action action, 1213 enum ieee80211_ampdu_mlme_action action,
@@ -1292,7 +1337,7 @@ void ieee80211_unregister_hw(struct ieee80211_hw *hw);
1292 * 1337 *
1293 * This function frees everything that was allocated, including the 1338 * This function frees everything that was allocated, including the
1294 * private data for the driver. You must call ieee80211_unregister_hw() 1339 * private data for the driver. You must call ieee80211_unregister_hw()
1295 * before calling this function 1340 * before calling this function.
1296 * 1341 *
1297 * @hw: the hardware to free 1342 * @hw: the hardware to free
1298 */ 1343 */
@@ -1358,16 +1403,12 @@ void ieee80211_rx_irqsafe(struct ieee80211_hw *hw,
1358 * 1403 *
1359 * @hw: the hardware the frame was transmitted by 1404 * @hw: the hardware the frame was transmitted by
1360 * @skb: the frame that was transmitted, owned by mac80211 after this call 1405 * @skb: the frame that was transmitted, owned by mac80211 after this call
1361 * @status: status information for this frame; the status pointer need not
1362 * be valid after this function returns and is not freed by mac80211,
1363 * it is recommended that it points to a stack area
1364 */ 1406 */
1365void ieee80211_tx_status(struct ieee80211_hw *hw, 1407void ieee80211_tx_status(struct ieee80211_hw *hw,
1366 struct sk_buff *skb, 1408 struct sk_buff *skb);
1367 struct ieee80211_tx_status *status);
1368 1409
1369/** 1410/**
1370 * ieee80211_tx_status_irqsafe - irq-safe transmit status callback 1411 * ieee80211_tx_status_irqsafe - IRQ-safe transmit status callback
1371 * 1412 *
1372 * Like ieee80211_tx_status() but can be called in IRQ context 1413 * Like ieee80211_tx_status() but can be called in IRQ context
1373 * (internally defers to a tasklet.) 1414 * (internally defers to a tasklet.)
@@ -1377,13 +1418,9 @@ void ieee80211_tx_status(struct ieee80211_hw *hw,
1377 * 1418 *
1378 * @hw: the hardware the frame was transmitted by 1419 * @hw: the hardware the frame was transmitted by
1379 * @skb: the frame that was transmitted, owned by mac80211 after this call 1420 * @skb: the frame that was transmitted, owned by mac80211 after this call
1380 * @status: status information for this frame; the status pointer need not
1381 * be valid after this function returns and is not freed by mac80211,
1382 * it is recommended that it points to a stack area
1383 */ 1421 */
1384void ieee80211_tx_status_irqsafe(struct ieee80211_hw *hw, 1422void ieee80211_tx_status_irqsafe(struct ieee80211_hw *hw,
1385 struct sk_buff *skb, 1423 struct sk_buff *skb);
1386 struct ieee80211_tx_status *status);
1387 1424
1388/** 1425/**
1389 * ieee80211_beacon_get - beacon generation function 1426 * ieee80211_beacon_get - beacon generation function
@@ -1399,8 +1436,7 @@ void ieee80211_tx_status_irqsafe(struct ieee80211_hw *hw,
1399 * is responsible of freeing it. 1436 * is responsible of freeing it.
1400 */ 1437 */
1401struct sk_buff *ieee80211_beacon_get(struct ieee80211_hw *hw, 1438struct sk_buff *ieee80211_beacon_get(struct ieee80211_hw *hw,
1402 struct ieee80211_vif *vif, 1439 struct ieee80211_vif *vif);
1403 struct ieee80211_tx_control *control);
1404 1440
1405/** 1441/**
1406 * ieee80211_rts_get - RTS frame generation function 1442 * ieee80211_rts_get - RTS frame generation function
@@ -1408,7 +1444,7 @@ struct sk_buff *ieee80211_beacon_get(struct ieee80211_hw *hw,
1408 * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf. 1444 * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf.
1409 * @frame: pointer to the frame that is going to be protected by the RTS. 1445 * @frame: pointer to the frame that is going to be protected by the RTS.
1410 * @frame_len: the frame length (in octets). 1446 * @frame_len: the frame length (in octets).
1411 * @frame_txctl: &struct ieee80211_tx_control of the frame. 1447 * @frame_txctl: &struct ieee80211_tx_info of the frame.
1412 * @rts: The buffer where to store the RTS frame. 1448 * @rts: The buffer where to store the RTS frame.
1413 * 1449 *
1414 * If the RTS frames are generated by the host system (i.e., not in 1450 * If the RTS frames are generated by the host system (i.e., not in
@@ -1418,7 +1454,7 @@ struct sk_buff *ieee80211_beacon_get(struct ieee80211_hw *hw,
1418 */ 1454 */
1419void ieee80211_rts_get(struct ieee80211_hw *hw, struct ieee80211_vif *vif, 1455void ieee80211_rts_get(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
1420 const void *frame, size_t frame_len, 1456 const void *frame, size_t frame_len,
1421 const struct ieee80211_tx_control *frame_txctl, 1457 const struct ieee80211_tx_info *frame_txctl,
1422 struct ieee80211_rts *rts); 1458 struct ieee80211_rts *rts);
1423 1459
1424/** 1460/**
@@ -1426,7 +1462,7 @@ void ieee80211_rts_get(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
1426 * @hw: pointer obtained from ieee80211_alloc_hw(). 1462 * @hw: pointer obtained from ieee80211_alloc_hw().
1427 * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf. 1463 * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf.
1428 * @frame_len: the length of the frame that is going to be protected by the RTS. 1464 * @frame_len: the length of the frame that is going to be protected by the RTS.
1429 * @frame_txctl: &struct ieee80211_tx_control of the frame. 1465 * @frame_txctl: &struct ieee80211_tx_info of the frame.
1430 * 1466 *
1431 * If the RTS is generated in firmware, but the host system must provide 1467 * If the RTS is generated in firmware, but the host system must provide
1432 * the duration field, the low-level driver uses this function to receive 1468 * the duration field, the low-level driver uses this function to receive
@@ -1434,7 +1470,7 @@ void ieee80211_rts_get(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
1434 */ 1470 */
1435__le16 ieee80211_rts_duration(struct ieee80211_hw *hw, 1471__le16 ieee80211_rts_duration(struct ieee80211_hw *hw,
1436 struct ieee80211_vif *vif, size_t frame_len, 1472 struct ieee80211_vif *vif, size_t frame_len,
1437 const struct ieee80211_tx_control *frame_txctl); 1473 const struct ieee80211_tx_info *frame_txctl);
1438 1474
1439/** 1475/**
1440 * ieee80211_ctstoself_get - CTS-to-self frame generation function 1476 * ieee80211_ctstoself_get - CTS-to-self frame generation function
@@ -1442,7 +1478,7 @@ __le16 ieee80211_rts_duration(struct ieee80211_hw *hw,
1442 * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf. 1478 * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf.
1443 * @frame: pointer to the frame that is going to be protected by the CTS-to-self. 1479 * @frame: pointer to the frame that is going to be protected by the CTS-to-self.
1444 * @frame_len: the frame length (in octets). 1480 * @frame_len: the frame length (in octets).
1445 * @frame_txctl: &struct ieee80211_tx_control of the frame. 1481 * @frame_txctl: &struct ieee80211_tx_info of the frame.
1446 * @cts: The buffer where to store the CTS-to-self frame. 1482 * @cts: The buffer where to store the CTS-to-self frame.
1447 * 1483 *
1448 * If the CTS-to-self frames are generated by the host system (i.e., not in 1484 * If the CTS-to-self frames are generated by the host system (i.e., not in
@@ -1453,7 +1489,7 @@ __le16 ieee80211_rts_duration(struct ieee80211_hw *hw,
1453void ieee80211_ctstoself_get(struct ieee80211_hw *hw, 1489void ieee80211_ctstoself_get(struct ieee80211_hw *hw,
1454 struct ieee80211_vif *vif, 1490 struct ieee80211_vif *vif,
1455 const void *frame, size_t frame_len, 1491 const void *frame, size_t frame_len,
1456 const struct ieee80211_tx_control *frame_txctl, 1492 const struct ieee80211_tx_info *frame_txctl,
1457 struct ieee80211_cts *cts); 1493 struct ieee80211_cts *cts);
1458 1494
1459/** 1495/**
@@ -1461,7 +1497,7 @@ void ieee80211_ctstoself_get(struct ieee80211_hw *hw,
1461 * @hw: pointer obtained from ieee80211_alloc_hw(). 1497 * @hw: pointer obtained from ieee80211_alloc_hw().
1462 * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf. 1498 * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf.
1463 * @frame_len: the length of the frame that is going to be protected by the CTS-to-self. 1499 * @frame_len: the length of the frame that is going to be protected by the CTS-to-self.
1464 * @frame_txctl: &struct ieee80211_tx_control of the frame. 1500 * @frame_txctl: &struct ieee80211_tx_info of the frame.
1465 * 1501 *
1466 * If the CTS-to-self is generated in firmware, but the host system must provide 1502 * If the CTS-to-self is generated in firmware, but the host system must provide
1467 * the duration field, the low-level driver uses this function to receive 1503 * the duration field, the low-level driver uses this function to receive
@@ -1470,7 +1506,7 @@ void ieee80211_ctstoself_get(struct ieee80211_hw *hw,
1470__le16 ieee80211_ctstoself_duration(struct ieee80211_hw *hw, 1506__le16 ieee80211_ctstoself_duration(struct ieee80211_hw *hw,
1471 struct ieee80211_vif *vif, 1507 struct ieee80211_vif *vif,
1472 size_t frame_len, 1508 size_t frame_len,
1473 const struct ieee80211_tx_control *frame_txctl); 1509 const struct ieee80211_tx_info *frame_txctl);
1474 1510
1475/** 1511/**
1476 * ieee80211_generic_frame_duration - Calculate the duration field for a frame 1512 * ieee80211_generic_frame_duration - Calculate the duration field for a frame
@@ -1509,8 +1545,7 @@ __le16 ieee80211_generic_frame_duration(struct ieee80211_hw *hw,
1509 * use common code for all beacons. 1545 * use common code for all beacons.
1510 */ 1546 */
1511struct sk_buff * 1547struct sk_buff *
1512ieee80211_get_buffered_bc(struct ieee80211_hw *hw, struct ieee80211_vif *vif, 1548ieee80211_get_buffered_bc(struct ieee80211_hw *hw, struct ieee80211_vif *vif);
1513 struct ieee80211_tx_control *control);
1514 1549
1515/** 1550/**
1516 * ieee80211_get_hdrlen_from_skb - get header length from data 1551 * ieee80211_get_hdrlen_from_skb - get header length from data
@@ -1522,7 +1557,7 @@ ieee80211_get_buffered_bc(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
1522 * 1557 *
1523 * @skb: the frame 1558 * @skb: the frame
1524 */ 1559 */
1525int ieee80211_get_hdrlen_from_skb(const struct sk_buff *skb); 1560unsigned int ieee80211_get_hdrlen_from_skb(const struct sk_buff *skb);
1526 1561
1527/** 1562/**
1528 * ieee80211_get_hdrlen - get header length from frame control 1563 * ieee80211_get_hdrlen - get header length from frame control
@@ -1535,6 +1570,12 @@ int ieee80211_get_hdrlen_from_skb(const struct sk_buff *skb);
1535int ieee80211_get_hdrlen(u16 fc); 1570int ieee80211_get_hdrlen(u16 fc);
1536 1571
1537/** 1572/**
1573 * ieee80211_hdrlen - get header length in bytes from frame control
1574 * @fc: frame control field in little-endian format
1575 */
1576unsigned int ieee80211_hdrlen(__le16 fc);
1577
1578/**
1538 * ieee80211_get_tkip_key - get a TKIP rc4 for skb 1579 * ieee80211_get_tkip_key - get a TKIP rc4 for skb
1539 * 1580 *
1540 * This function computes a TKIP rc4 key for an skb. It computes 1581 * This function computes a TKIP rc4 key for an skb. It computes
@@ -1545,6 +1586,8 @@ int ieee80211_get_hdrlen(u16 fc);
1545 * @keyconf: the parameter passed with the set key 1586 * @keyconf: the parameter passed with the set key
1546 * @skb: the skb for which the key is needed 1587 * @skb: the skb for which the key is needed
1547 * @rc4key: a buffer to which the key will be written 1588 * @rc4key: a buffer to which the key will be written
1589 * @type: TBD
1590 * @key: TBD
1548 */ 1591 */
1549void ieee80211_get_tkip_key(struct ieee80211_key_conf *keyconf, 1592void ieee80211_get_tkip_key(struct ieee80211_key_conf *keyconf,
1550 struct sk_buff *skb, 1593 struct sk_buff *skb,
@@ -1568,14 +1611,6 @@ void ieee80211_wake_queue(struct ieee80211_hw *hw, int queue);
1568void ieee80211_stop_queue(struct ieee80211_hw *hw, int queue); 1611void ieee80211_stop_queue(struct ieee80211_hw *hw, int queue);
1569 1612
1570/** 1613/**
1571 * ieee80211_start_queues - start all queues
1572 * @hw: pointer to as obtained from ieee80211_alloc_hw().
1573 *
1574 * Drivers should use this function instead of netif_start_queue.
1575 */
1576void ieee80211_start_queues(struct ieee80211_hw *hw);
1577
1578/**
1579 * ieee80211_stop_queues - stop all queues 1614 * ieee80211_stop_queues - stop all queues
1580 * @hw: pointer as obtained from ieee80211_alloc_hw(). 1615 * @hw: pointer as obtained from ieee80211_alloc_hw().
1581 * 1616 *
@@ -1603,7 +1638,7 @@ void ieee80211_wake_queues(struct ieee80211_hw *hw);
1603void ieee80211_scan_completed(struct ieee80211_hw *hw); 1638void ieee80211_scan_completed(struct ieee80211_hw *hw);
1604 1639
1605/** 1640/**
1606 * ieee80211_iterate_active_interfaces- iterate active interfaces 1641 * ieee80211_iterate_active_interfaces - iterate active interfaces
1607 * 1642 *
1608 * This function iterates over the interfaces associated with a given 1643 * This function iterates over the interfaces associated with a given
1609 * hardware that are currently active and calls the callback for them. 1644 * hardware that are currently active and calls the callback for them.
@@ -1670,7 +1705,7 @@ void ieee80211_start_tx_ba_cb(struct ieee80211_hw *hw, u8 *ra, u16 tid);
1670 * 1705 *
1671 * This function must be called by low level driver once it has 1706 * This function must be called by low level driver once it has
1672 * finished with preparations for the BA session. 1707 * finished with preparations for the BA session.
1673 * This version of the function is irq safe. 1708 * This version of the function is IRQ-safe.
1674 */ 1709 */
1675void ieee80211_start_tx_ba_cb_irqsafe(struct ieee80211_hw *hw, const u8 *ra, 1710void ieee80211_start_tx_ba_cb_irqsafe(struct ieee80211_hw *hw, const u8 *ra,
1676 u16 tid); 1711 u16 tid);
@@ -1710,7 +1745,7 @@ void ieee80211_stop_tx_ba_cb(struct ieee80211_hw *hw, u8 *ra, u8 tid);
1710 * 1745 *
1711 * This function must be called by low level driver once it has 1746 * This function must be called by low level driver once it has
1712 * finished with preparations for the BA session tear down. 1747 * finished with preparations for the BA session tear down.
1713 * This version of the function is irq safe. 1748 * This version of the function is IRQ-safe.
1714 */ 1749 */
1715void ieee80211_stop_tx_ba_cb_irqsafe(struct ieee80211_hw *hw, const u8 *ra, 1750void ieee80211_stop_tx_ba_cb_irqsafe(struct ieee80211_hw *hw, const u8 *ra,
1716 u16 tid); 1751 u16 tid);
@@ -1718,7 +1753,7 @@ void ieee80211_stop_tx_ba_cb_irqsafe(struct ieee80211_hw *hw, const u8 *ra,
1718/** 1753/**
1719 * ieee80211_notify_mac - low level driver notification 1754 * ieee80211_notify_mac - low level driver notification
1720 * @hw: pointer as obtained from ieee80211_alloc_hw(). 1755 * @hw: pointer as obtained from ieee80211_alloc_hw().
1721 * @notification_types: enum ieee80211_notification_types 1756 * @notif_type: enum ieee80211_notification_types
1722 * 1757 *
1723 * This function must be called by low level driver to inform mac80211 of 1758 * This function must be called by low level driver to inform mac80211 of
1724 * low level driver status change or force mac80211 to re-assoc for low 1759 * low level driver status change or force mac80211 to re-assoc for low
diff --git a/include/net/neighbour.h b/include/net/neighbour.h
index dc420fecafb9..aa4b708654a4 100644
--- a/include/net/neighbour.h
+++ b/include/net/neighbour.h
@@ -75,7 +75,7 @@ struct neigh_statistics
75 unsigned long destroys; /* number of destroyed neighs */ 75 unsigned long destroys; /* number of destroyed neighs */
76 unsigned long hash_grows; /* number of hash resizes */ 76 unsigned long hash_grows; /* number of hash resizes */
77 77
78 unsigned long res_failed; /* nomber of failed resolutions */ 78 unsigned long res_failed; /* number of failed resolutions */
79 79
80 unsigned long lookups; /* number of lookups */ 80 unsigned long lookups; /* number of lookups */
81 unsigned long hits; /* number of hits (among lookups) */ 81 unsigned long hits; /* number of hits (among lookups) */
@@ -85,6 +85,8 @@ struct neigh_statistics
85 85
86 unsigned long periodic_gc_runs; /* number of periodic GC runs */ 86 unsigned long periodic_gc_runs; /* number of periodic GC runs */
87 unsigned long forced_gc_runs; /* number of forced GC runs */ 87 unsigned long forced_gc_runs; /* number of forced GC runs */
88
89 unsigned long unres_discards; /* number of unresolved drops */
88}; 90};
89 91
90#define NEIGH_CACHE_STAT_INC(tbl, field) \ 92#define NEIGH_CACHE_STAT_INC(tbl, field) \
diff --git a/include/net/net_namespace.h b/include/net/net_namespace.h
index d9dd0f707296..3855620b78a9 100644
--- a/include/net/net_namespace.h
+++ b/include/net/net_namespace.h
@@ -9,6 +9,7 @@
9#include <linux/list.h> 9#include <linux/list.h>
10 10
11#include <net/netns/core.h> 11#include <net/netns/core.h>
12#include <net/netns/mib.h>
12#include <net/netns/unix.h> 13#include <net/netns/unix.h>
13#include <net/netns/packet.h> 14#include <net/netns/packet.h>
14#include <net/netns/ipv4.h> 15#include <net/netns/ipv4.h>
@@ -52,6 +53,7 @@ struct net {
52 struct sock *rtnl; /* rtnetlink socket */ 53 struct sock *rtnl; /* rtnetlink socket */
53 54
54 struct netns_core core; 55 struct netns_core core;
56 struct netns_mib mib;
55 struct netns_packet packet; 57 struct netns_packet packet;
56 struct netns_unix unx; 58 struct netns_unix unx;
57 struct netns_ipv4 ipv4; 59 struct netns_ipv4 ipv4;
@@ -212,8 +214,11 @@ extern void unregister_pernet_gen_device(int id, struct pernet_operations *);
212struct ctl_path; 214struct ctl_path;
213struct ctl_table; 215struct ctl_table;
214struct ctl_table_header; 216struct ctl_table_header;
217
215extern struct ctl_table_header *register_net_sysctl_table(struct net *net, 218extern struct ctl_table_header *register_net_sysctl_table(struct net *net,
216 const struct ctl_path *path, struct ctl_table *table); 219 const struct ctl_path *path, struct ctl_table *table);
220extern struct ctl_table_header *register_net_sysctl_rotable(
221 const struct ctl_path *path, struct ctl_table *table);
217extern void unregister_net_sysctl_table(struct ctl_table_header *header); 222extern void unregister_net_sysctl_table(struct ctl_table_header *header);
218 223
219#endif /* __NET_NET_NAMESPACE_H */ 224#endif /* __NET_NET_NAMESPACE_H */
diff --git a/include/net/netfilter/ipv4/nf_conntrack_ipv4.h b/include/net/netfilter/ipv4/nf_conntrack_ipv4.h
index 9bf059817aec..7573d52a4346 100644
--- a/include/net/netfilter/ipv4/nf_conntrack_ipv4.h
+++ b/include/net/netfilter/ipv4/nf_conntrack_ipv4.h
@@ -9,8 +9,6 @@
9#ifndef _NF_CONNTRACK_IPV4_H 9#ifndef _NF_CONNTRACK_IPV4_H
10#define _NF_CONNTRACK_IPV4_H 10#define _NF_CONNTRACK_IPV4_H
11 11
12/* Returns new sk_buff, or NULL */
13struct sk_buff *nf_ct_ipv4_ct_gather_frags(struct sk_buff *skb);
14 12
15extern struct nf_conntrack_l3proto nf_conntrack_l3proto_ipv4; 13extern struct nf_conntrack_l3proto nf_conntrack_l3proto_ipv4;
16 14
diff --git a/include/net/netfilter/nf_conntrack.h b/include/net/netfilter/nf_conntrack.h
index 2dbd6c015b94..8f5b75734dd0 100644
--- a/include/net/netfilter/nf_conntrack.h
+++ b/include/net/netfilter/nf_conntrack.h
@@ -223,6 +223,25 @@ static inline void nf_ct_refresh(struct nf_conn *ct,
223 __nf_ct_refresh_acct(ct, 0, skb, extra_jiffies, 0); 223 __nf_ct_refresh_acct(ct, 0, skb, extra_jiffies, 0);
224} 224}
225 225
226extern bool __nf_ct_kill_acct(struct nf_conn *ct,
227 enum ip_conntrack_info ctinfo,
228 const struct sk_buff *skb,
229 int do_acct);
230
231/* kill conntrack and do accounting */
232static inline bool nf_ct_kill_acct(struct nf_conn *ct,
233 enum ip_conntrack_info ctinfo,
234 const struct sk_buff *skb)
235{
236 return __nf_ct_kill_acct(ct, ctinfo, skb, 1);
237}
238
239/* kill conntrack without accounting */
240static inline bool nf_ct_kill(struct nf_conn *ct)
241{
242 return __nf_ct_kill_acct(ct, 0, NULL, 0);
243}
244
226/* These are for NAT. Icky. */ 245/* These are for NAT. Icky. */
227/* Update TCP window tracking data when NAT mangles the packet */ 246/* Update TCP window tracking data when NAT mangles the packet */
228extern void nf_conntrack_tcp_update(const struct sk_buff *skb, 247extern void nf_conntrack_tcp_update(const struct sk_buff *skb,
@@ -239,7 +258,8 @@ nf_ct_iterate_cleanup(int (*iter)(struct nf_conn *i, void *data), void *data);
239extern void nf_conntrack_free(struct nf_conn *ct); 258extern void nf_conntrack_free(struct nf_conn *ct);
240extern struct nf_conn * 259extern struct nf_conn *
241nf_conntrack_alloc(const struct nf_conntrack_tuple *orig, 260nf_conntrack_alloc(const struct nf_conntrack_tuple *orig,
242 const struct nf_conntrack_tuple *repl); 261 const struct nf_conntrack_tuple *repl,
262 gfp_t gfp);
243 263
244/* It's confirmed if it is, or has been in the hash table. */ 264/* It's confirmed if it is, or has been in the hash table. */
245static inline int nf_ct_is_confirmed(struct nf_conn *ct) 265static inline int nf_ct_is_confirmed(struct nf_conn *ct)
diff --git a/include/net/netns/hash.h b/include/net/netns/hash.h
new file mode 100644
index 000000000000..548d78f2cc47
--- /dev/null
+++ b/include/net/netns/hash.h
@@ -0,0 +1,21 @@
1#ifndef __NET_NS_HASH_H__
2#define __NET_NS_HASH_H__
3
4#include <asm/cache.h>
5
6struct net;
7
8static inline unsigned net_hash_mix(struct net *net)
9{
10#ifdef CONFIG_NET_NS
11 /*
12 * shift this right to eliminate bits, that are
13 * always zeroed
14 */
15
16 return (unsigned)(((unsigned long)net) >> L1_CACHE_SHIFT);
17#else
18 return 0;
19#endif
20}
21#endif
diff --git a/include/net/netns/ipv4.h b/include/net/netns/ipv4.h
index 34ee348a2cf2..a6ed83853dcc 100644
--- a/include/net/netns/ipv4.h
+++ b/include/net/netns/ipv4.h
@@ -18,6 +18,7 @@ struct netns_ipv4 {
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 struct ctl_table_header *ipv4_hdr;
21 struct ctl_table_header *route_hdr;
21#endif 22#endif
22 struct ipv4_devconf *devconf_all; 23 struct ipv4_devconf *devconf_all;
23 struct ipv4_devconf *devconf_dflt; 24 struct ipv4_devconf *devconf_dflt;
@@ -36,6 +37,7 @@ struct netns_ipv4 {
36 struct xt_table *iptable_mangle; 37 struct xt_table *iptable_mangle;
37 struct xt_table *iptable_raw; 38 struct xt_table *iptable_raw;
38 struct xt_table *arptable_filter; 39 struct xt_table *arptable_filter;
40 struct xt_table *iptable_security;
39#endif 41#endif
40 42
41 int sysctl_icmp_echo_ignore_all; 43 int sysctl_icmp_echo_ignore_all;
@@ -44,5 +46,8 @@ struct netns_ipv4 {
44 int sysctl_icmp_ratelimit; 46 int sysctl_icmp_ratelimit;
45 int sysctl_icmp_ratemask; 47 int sysctl_icmp_ratemask;
46 int sysctl_icmp_errors_use_inbound_ifaddr; 48 int sysctl_icmp_errors_use_inbound_ifaddr;
49
50 struct timer_list rt_secret_timer;
51 atomic_t rt_genid;
47}; 52};
48#endif 53#endif
diff --git a/include/net/netns/ipv6.h b/include/net/netns/ipv6.h
index ac053be6c256..5bacd838e88b 100644
--- a/include/net/netns/ipv6.h
+++ b/include/net/netns/ipv6.h
@@ -35,6 +35,7 @@ struct netns_ipv6 {
35 struct xt_table *ip6table_filter; 35 struct xt_table *ip6table_filter;
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 struct xt_table *ip6table_security;
38#endif 39#endif
39 struct rt6_info *ip6_null_entry; 40 struct rt6_info *ip6_null_entry;
40 struct rt6_statistics *rt6_stats; 41 struct rt6_statistics *rt6_stats;
diff --git a/include/net/netns/mib.h b/include/net/netns/mib.h
new file mode 100644
index 000000000000..449147604642
--- /dev/null
+++ b/include/net/netns/mib.h
@@ -0,0 +1,16 @@
1#ifndef __NETNS_MIB_H__
2#define __NETNS_MIB_H__
3
4#include <net/snmp.h>
5
6struct netns_mib {
7 DEFINE_SNMP_STAT(struct tcp_mib, tcp_statistics);
8 DEFINE_SNMP_STAT(struct ipstats_mib, ip_statistics);
9 DEFINE_SNMP_STAT(struct linux_mib, net_statistics);
10 DEFINE_SNMP_STAT(struct udp_mib, udp_statistics);
11 DEFINE_SNMP_STAT(struct udp_mib, udplite_statistics);
12 DEFINE_SNMP_STAT(struct icmp_mib, icmp_statistics);
13 DEFINE_SNMP_STAT(struct icmpmsg_mib, icmpmsg_statistics);
14};
15
16#endif
diff --git a/include/net/pkt_sched.h b/include/net/pkt_sched.h
index 46fb4d80c74a..6affcfaa123e 100644
--- a/include/net/pkt_sched.h
+++ b/include/net/pkt_sched.h
@@ -72,6 +72,10 @@ extern void qdisc_watchdog_cancel(struct qdisc_watchdog *wd);
72extern struct Qdisc_ops pfifo_qdisc_ops; 72extern struct Qdisc_ops pfifo_qdisc_ops;
73extern struct Qdisc_ops bfifo_qdisc_ops; 73extern struct Qdisc_ops bfifo_qdisc_ops;
74 74
75extern int fifo_set_limit(struct Qdisc *q, unsigned int limit);
76extern struct Qdisc *fifo_create_dflt(struct Qdisc *sch, struct Qdisc_ops *ops,
77 unsigned int limit);
78
75extern int register_qdisc(struct Qdisc_ops *qops); 79extern int register_qdisc(struct Qdisc_ops *qops);
76extern int unregister_qdisc(struct Qdisc_ops *qops); 80extern int unregister_qdisc(struct Qdisc_ops *qops);
77extern struct Qdisc *qdisc_lookup(struct net_device *dev, u32 handle); 81extern struct Qdisc *qdisc_lookup(struct net_device *dev, u32 handle);
@@ -79,14 +83,14 @@ extern struct Qdisc *qdisc_lookup_class(struct net_device *dev, u32 handle);
79extern struct qdisc_rate_table *qdisc_get_rtab(struct tc_ratespec *r, 83extern struct qdisc_rate_table *qdisc_get_rtab(struct tc_ratespec *r,
80 struct nlattr *tab); 84 struct nlattr *tab);
81extern void qdisc_put_rtab(struct qdisc_rate_table *tab); 85extern void qdisc_put_rtab(struct qdisc_rate_table *tab);
86extern void qdisc_put_stab(struct qdisc_size_table *tab);
82 87
83extern void __qdisc_run(struct net_device *dev); 88extern void __qdisc_run(struct Qdisc *q);
84 89
85static inline void qdisc_run(struct net_device *dev) 90static inline void qdisc_run(struct Qdisc *q)
86{ 91{
87 if (!netif_queue_stopped(dev) && 92 if (!test_and_set_bit(__QDISC_STATE_RUNNING, &q->state))
88 !test_and_set_bit(__LINK_STATE_QDISC_RUNNING, &dev->state)) 93 __qdisc_run(q);
89 __qdisc_run(dev);
90} 94}
91 95
92extern int tc_classify_compat(struct sk_buff *skb, struct tcf_proto *tp, 96extern int tc_classify_compat(struct sk_buff *skb, struct tcf_proto *tp,
diff --git a/include/net/rose.h b/include/net/rose.h
index e5bb084d8754..cbd5364b2c8a 100644
--- a/include/net/rose.h
+++ b/include/net/rose.h
@@ -201,7 +201,7 @@ extern void rose_link_device_down(struct net_device *);
201extern struct net_device *rose_dev_first(void); 201extern struct net_device *rose_dev_first(void);
202extern struct net_device *rose_dev_get(rose_address *); 202extern struct net_device *rose_dev_get(rose_address *);
203extern struct rose_route *rose_route_free_lci(unsigned int, struct rose_neigh *); 203extern struct rose_route *rose_route_free_lci(unsigned int, struct rose_neigh *);
204extern struct rose_neigh *rose_get_neigh(rose_address *, unsigned char *, unsigned char *); 204extern struct rose_neigh *rose_get_neigh(rose_address *, unsigned char *, unsigned char *, int);
205extern int rose_rt_ioctl(unsigned int, void __user *); 205extern int rose_rt_ioctl(unsigned int, void __user *);
206extern void rose_link_failed(ax25_cb *, int); 206extern void rose_link_failed(ax25_cb *, int);
207extern int rose_route_frame(struct sk_buff *, ax25_cb *); 207extern int rose_route_frame(struct sk_buff *, ax25_cb *);
diff --git a/include/net/route.h b/include/net/route.h
index fc836ff824cc..3140cc500854 100644
--- a/include/net/route.h
+++ b/include/net/route.h
@@ -111,7 +111,7 @@ struct in_device;
111extern int ip_rt_init(void); 111extern int ip_rt_init(void);
112extern void ip_rt_redirect(__be32 old_gw, __be32 dst, __be32 new_gw, 112extern void ip_rt_redirect(__be32 old_gw, __be32 dst, __be32 new_gw,
113 __be32 src, struct net_device *dev); 113 __be32 src, struct net_device *dev);
114extern void rt_cache_flush(int how); 114extern void rt_cache_flush(struct net *net, int how);
115extern int __ip_route_output_key(struct net *, struct rtable **, const struct flowi *flp); 115extern int __ip_route_output_key(struct net *, struct rtable **, const struct flowi *flp);
116extern int ip_route_output_key(struct net *, struct rtable **, struct flowi *flp); 116extern int ip_route_output_key(struct net *, struct rtable **, struct flowi *flp);
117extern int ip_route_output_flow(struct net *, struct rtable **rp, struct flowi *flp, struct sock *sk, int flags); 117extern int ip_route_output_flow(struct net *, struct rtable **rp, struct flowi *flp, struct sock *sk, int flags);
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h
index a87fc0312edc..b5f40d7ef724 100644
--- a/include/net/sch_generic.h
+++ b/include/net/sch_generic.h
@@ -23,6 +23,19 @@ struct qdisc_rate_table
23 int refcnt; 23 int refcnt;
24}; 24};
25 25
26enum qdisc_state_t
27{
28 __QDISC_STATE_RUNNING,
29 __QDISC_STATE_SCHED,
30};
31
32struct qdisc_size_table {
33 struct list_head list;
34 struct tc_sizespec szopts;
35 int refcnt;
36 u16 data[];
37};
38
26struct Qdisc 39struct Qdisc
27{ 40{
28 int (*enqueue)(struct sk_buff *skb, struct Qdisc *dev); 41 int (*enqueue)(struct sk_buff *skb, struct Qdisc *dev);
@@ -33,21 +46,26 @@ struct Qdisc
33#define TCQ_F_INGRESS 4 46#define TCQ_F_INGRESS 4
34 int padded; 47 int padded;
35 struct Qdisc_ops *ops; 48 struct Qdisc_ops *ops;
49 struct qdisc_size_table *stab;
36 u32 handle; 50 u32 handle;
37 u32 parent; 51 u32 parent;
38 atomic_t refcnt; 52 atomic_t refcnt;
53 unsigned long state;
54 struct sk_buff *gso_skb;
39 struct sk_buff_head q; 55 struct sk_buff_head q;
40 struct net_device *dev; 56 struct netdev_queue *dev_queue;
57 struct Qdisc *next_sched;
41 struct list_head list; 58 struct list_head list;
42 59
43 struct gnet_stats_basic bstats; 60 struct gnet_stats_basic bstats;
44 struct gnet_stats_queue qstats; 61 struct gnet_stats_queue qstats;
45 struct gnet_stats_rate_est rate_est; 62 struct gnet_stats_rate_est rate_est;
46 spinlock_t *stats_lock;
47 struct rcu_head q_rcu; 63 struct rcu_head q_rcu;
48 int (*reshape_fail)(struct sk_buff *skb, 64 int (*reshape_fail)(struct sk_buff *skb,
49 struct Qdisc *q); 65 struct Qdisc *q);
50 66
67 void *u32_node;
68
51 /* This field is deprecated, but it is still used by CBQ 69 /* This field is deprecated, but it is still used by CBQ
52 * and it will live until better solution will be invented. 70 * and it will live until better solution will be invented.
53 */ 71 */
@@ -155,18 +173,96 @@ struct tcf_proto
155 struct tcf_proto_ops *ops; 173 struct tcf_proto_ops *ops;
156}; 174};
157 175
176struct qdisc_skb_cb {
177 unsigned int pkt_len;
178 char data[];
179};
180
181static inline struct qdisc_skb_cb *qdisc_skb_cb(struct sk_buff *skb)
182{
183 return (struct qdisc_skb_cb *)skb->cb;
184}
158 185
159extern void qdisc_lock_tree(struct net_device *dev); 186static inline spinlock_t *qdisc_lock(struct Qdisc *qdisc)
160extern void qdisc_unlock_tree(struct net_device *dev); 187{
188 return &qdisc->q.lock;
189}
161 190
162#define sch_tree_lock(q) qdisc_lock_tree((q)->dev) 191static inline struct Qdisc *qdisc_root(struct Qdisc *qdisc)
163#define sch_tree_unlock(q) qdisc_unlock_tree((q)->dev) 192{
164#define tcf_tree_lock(tp) qdisc_lock_tree((tp)->q->dev) 193 return qdisc->dev_queue->qdisc;
165#define tcf_tree_unlock(tp) qdisc_unlock_tree((tp)->q->dev) 194}
195
196static inline spinlock_t *qdisc_root_lock(struct Qdisc *qdisc)
197{
198 struct Qdisc *root = qdisc_root(qdisc);
199
200 return qdisc_lock(root);
201}
202
203static inline struct net_device *qdisc_dev(struct Qdisc *qdisc)
204{
205 return qdisc->dev_queue->dev;
206}
207
208static inline void sch_tree_lock(struct Qdisc *q)
209{
210 spin_lock_bh(qdisc_root_lock(q));
211}
212
213static inline void sch_tree_unlock(struct Qdisc *q)
214{
215 spin_unlock_bh(qdisc_root_lock(q));
216}
217
218#define tcf_tree_lock(tp) sch_tree_lock((tp)->q)
219#define tcf_tree_unlock(tp) sch_tree_unlock((tp)->q)
166 220
167extern struct Qdisc noop_qdisc; 221extern struct Qdisc noop_qdisc;
168extern struct Qdisc_ops noop_qdisc_ops; 222extern struct Qdisc_ops noop_qdisc_ops;
169 223
224struct Qdisc_class_common
225{
226 u32 classid;
227 struct hlist_node hnode;
228};
229
230struct Qdisc_class_hash
231{
232 struct hlist_head *hash;
233 unsigned int hashsize;
234 unsigned int hashmask;
235 unsigned int hashelems;
236};
237
238static inline unsigned int qdisc_class_hash(u32 id, u32 mask)
239{
240 id ^= id >> 8;
241 id ^= id >> 4;
242 return id & mask;
243}
244
245static inline struct Qdisc_class_common *
246qdisc_class_find(struct Qdisc_class_hash *hash, u32 id)
247{
248 struct Qdisc_class_common *cl;
249 struct hlist_node *n;
250 unsigned int h;
251
252 h = qdisc_class_hash(id, hash->hashmask);
253 hlist_for_each_entry(cl, n, &hash->hash[h], hnode) {
254 if (cl->classid == id)
255 return cl;
256 }
257 return NULL;
258}
259
260extern int qdisc_class_hash_init(struct Qdisc_class_hash *);
261extern void qdisc_class_hash_insert(struct Qdisc_class_hash *, struct Qdisc_class_common *);
262extern void qdisc_class_hash_remove(struct Qdisc_class_hash *, struct Qdisc_class_common *);
263extern void qdisc_class_hash_grow(struct Qdisc *, struct Qdisc_class_hash *);
264extern void qdisc_class_hash_destroy(struct Qdisc_class_hash *);
265
170extern void dev_init_scheduler(struct net_device *dev); 266extern void dev_init_scheduler(struct net_device *dev);
171extern void dev_shutdown(struct net_device *dev); 267extern void dev_shutdown(struct net_device *dev);
172extern void dev_activate(struct net_device *dev); 268extern void dev_activate(struct net_device *dev);
@@ -174,18 +270,88 @@ extern void dev_deactivate(struct net_device *dev);
174extern void qdisc_reset(struct Qdisc *qdisc); 270extern void qdisc_reset(struct Qdisc *qdisc);
175extern void qdisc_destroy(struct Qdisc *qdisc); 271extern void qdisc_destroy(struct Qdisc *qdisc);
176extern void qdisc_tree_decrease_qlen(struct Qdisc *qdisc, unsigned int n); 272extern void qdisc_tree_decrease_qlen(struct Qdisc *qdisc, unsigned int n);
177extern struct Qdisc *qdisc_alloc(struct net_device *dev, struct Qdisc_ops *ops); 273extern struct Qdisc *qdisc_alloc(struct netdev_queue *dev_queue,
274 struct Qdisc_ops *ops);
178extern struct Qdisc *qdisc_create_dflt(struct net_device *dev, 275extern struct Qdisc *qdisc_create_dflt(struct net_device *dev,
276 struct netdev_queue *dev_queue,
179 struct Qdisc_ops *ops, u32 parentid); 277 struct Qdisc_ops *ops, u32 parentid);
278extern void qdisc_calculate_pkt_len(struct sk_buff *skb,
279 struct qdisc_size_table *stab);
180extern void tcf_destroy(struct tcf_proto *tp); 280extern void tcf_destroy(struct tcf_proto *tp);
181extern void tcf_destroy_chain(struct tcf_proto **fl); 281extern void tcf_destroy_chain(struct tcf_proto **fl);
182 282
283/* Reset all TX qdiscs of a device. */
284static inline void qdisc_reset_all_tx(struct net_device *dev)
285{
286 unsigned int i;
287 for (i = 0; i < dev->num_tx_queues; i++)
288 qdisc_reset(netdev_get_tx_queue(dev, i)->qdisc);
289}
290
291/* Are all TX queues of the device empty? */
292static inline bool qdisc_all_tx_empty(const struct net_device *dev)
293{
294 unsigned int i;
295 for (i = 0; i < dev->num_tx_queues; i++) {
296 struct netdev_queue *txq = netdev_get_tx_queue(dev, i);
297 const struct Qdisc *q = txq->qdisc;
298
299 if (q->q.qlen)
300 return false;
301 }
302 return true;
303}
304
305/* Are any of the TX qdiscs changing? */
306static inline bool qdisc_tx_changing(struct net_device *dev)
307{
308 unsigned int i;
309 for (i = 0; i < dev->num_tx_queues; i++) {
310 struct netdev_queue *txq = netdev_get_tx_queue(dev, i);
311 if (txq->qdisc != txq->qdisc_sleeping)
312 return true;
313 }
314 return false;
315}
316
317/* Is the device using the noop qdisc on all queues? */
318static inline bool qdisc_tx_is_noop(const struct net_device *dev)
319{
320 unsigned int i;
321 for (i = 0; i < dev->num_tx_queues; i++) {
322 struct netdev_queue *txq = netdev_get_tx_queue(dev, i);
323 if (txq->qdisc != &noop_qdisc)
324 return false;
325 }
326 return true;
327}
328
329static inline unsigned int qdisc_pkt_len(struct sk_buff *skb)
330{
331 return qdisc_skb_cb(skb)->pkt_len;
332}
333
334static inline int qdisc_enqueue(struct sk_buff *skb, struct Qdisc *sch)
335{
336#ifdef CONFIG_NET_SCHED
337 if (sch->stab)
338 qdisc_calculate_pkt_len(skb, sch->stab);
339#endif
340 return sch->enqueue(skb, sch);
341}
342
343static inline int qdisc_enqueue_root(struct sk_buff *skb, struct Qdisc *sch)
344{
345 qdisc_skb_cb(skb)->pkt_len = skb->len;
346 return qdisc_enqueue(skb, sch);
347}
348
183static inline int __qdisc_enqueue_tail(struct sk_buff *skb, struct Qdisc *sch, 349static inline int __qdisc_enqueue_tail(struct sk_buff *skb, struct Qdisc *sch,
184 struct sk_buff_head *list) 350 struct sk_buff_head *list)
185{ 351{
186 __skb_queue_tail(list, skb); 352 __skb_queue_tail(list, skb);
187 sch->qstats.backlog += skb->len; 353 sch->qstats.backlog += qdisc_pkt_len(skb);
188 sch->bstats.bytes += skb->len; 354 sch->bstats.bytes += qdisc_pkt_len(skb);
189 sch->bstats.packets++; 355 sch->bstats.packets++;
190 356
191 return NET_XMIT_SUCCESS; 357 return NET_XMIT_SUCCESS;
@@ -202,7 +368,7 @@ static inline struct sk_buff *__qdisc_dequeue_head(struct Qdisc *sch,
202 struct sk_buff *skb = __skb_dequeue(list); 368 struct sk_buff *skb = __skb_dequeue(list);
203 369
204 if (likely(skb != NULL)) 370 if (likely(skb != NULL))
205 sch->qstats.backlog -= skb->len; 371 sch->qstats.backlog -= qdisc_pkt_len(skb);
206 372
207 return skb; 373 return skb;
208} 374}
@@ -218,7 +384,7 @@ static inline struct sk_buff *__qdisc_dequeue_tail(struct Qdisc *sch,
218 struct sk_buff *skb = __skb_dequeue_tail(list); 384 struct sk_buff *skb = __skb_dequeue_tail(list);
219 385
220 if (likely(skb != NULL)) 386 if (likely(skb != NULL))
221 sch->qstats.backlog -= skb->len; 387 sch->qstats.backlog -= qdisc_pkt_len(skb);
222 388
223 return skb; 389 return skb;
224} 390}
@@ -232,7 +398,7 @@ static inline int __qdisc_requeue(struct sk_buff *skb, struct Qdisc *sch,
232 struct sk_buff_head *list) 398 struct sk_buff_head *list)
233{ 399{
234 __skb_queue_head(list, skb); 400 __skb_queue_head(list, skb);
235 sch->qstats.backlog += skb->len; 401 sch->qstats.backlog += qdisc_pkt_len(skb);
236 sch->qstats.requeues++; 402 sch->qstats.requeues++;
237 403
238 return NET_XMIT_SUCCESS; 404 return NET_XMIT_SUCCESS;
@@ -250,7 +416,7 @@ static inline void __qdisc_reset_queue(struct Qdisc *sch,
250 * We do not know the backlog in bytes of this list, it 416 * We do not know the backlog in bytes of this list, it
251 * is up to the caller to correct it 417 * is up to the caller to correct it
252 */ 418 */
253 skb_queue_purge(list); 419 __skb_queue_purge(list);
254} 420}
255 421
256static inline void qdisc_reset_queue(struct Qdisc *sch) 422static inline void qdisc_reset_queue(struct Qdisc *sch)
@@ -265,7 +431,7 @@ static inline unsigned int __qdisc_queue_drop(struct Qdisc *sch,
265 struct sk_buff *skb = __qdisc_dequeue_tail(sch, list); 431 struct sk_buff *skb = __qdisc_dequeue_tail(sch, list);
266 432
267 if (likely(skb != NULL)) { 433 if (likely(skb != NULL)) {
268 unsigned int len = skb->len; 434 unsigned int len = qdisc_pkt_len(skb);
269 kfree_skb(skb); 435 kfree_skb(skb);
270 return len; 436 return len;
271 } 437 }
diff --git a/include/net/sctp/checksum.h b/include/net/sctp/checksum.h
index ba75c67cb992..b799fb21519a 100644
--- a/include/net/sctp/checksum.h
+++ b/include/net/sctp/checksum.h
@@ -46,9 +46,14 @@
46#include <net/sctp/sctp.h> 46#include <net/sctp/sctp.h>
47#include <linux/crc32c.h> 47#include <linux/crc32c.h>
48 48
49static inline __u32 sctp_start_cksum(__u8 *buffer, __u16 length) 49static inline __be32 sctp_crc32c(__be32 crc, u8 *buffer, u16 length)
50{ 50{
51 __u32 crc = ~(__u32) 0; 51 return (__force __be32)crc32c((__force u32)crc, buffer, length);
52}
53
54static inline __be32 sctp_start_cksum(__u8 *buffer, __u16 length)
55{
56 __be32 crc = ~cpu_to_be32(0);
52 __u8 zero[sizeof(__u32)] = {0}; 57 __u8 zero[sizeof(__u32)] = {0};
53 58
54 /* Optimize this routine to be SCTP specific, knowing how 59 /* Optimize this routine to be SCTP specific, knowing how
@@ -56,23 +61,23 @@ static inline __u32 sctp_start_cksum(__u8 *buffer, __u16 length)
56 */ 61 */
57 62
58 /* Calculate CRC up to the checksum. */ 63 /* Calculate CRC up to the checksum. */
59 crc = crc32c(crc, buffer, sizeof(struct sctphdr) - sizeof(__u32)); 64 crc = sctp_crc32c(crc, buffer, sizeof(struct sctphdr) - sizeof(__u32));
60 65
61 /* Skip checksum field of the header. */ 66 /* Skip checksum field of the header. */
62 crc = crc32c(crc, zero, sizeof(__u32)); 67 crc = sctp_crc32c(crc, zero, sizeof(__u32));
63 68
64 /* Calculate the rest of the CRC. */ 69 /* Calculate the rest of the CRC. */
65 crc = crc32c(crc, &buffer[sizeof(struct sctphdr)], 70 crc = sctp_crc32c(crc, &buffer[sizeof(struct sctphdr)],
66 length - sizeof(struct sctphdr)); 71 length - sizeof(struct sctphdr));
67 return crc; 72 return crc;
68} 73}
69 74
70static inline __u32 sctp_update_cksum(__u8 *buffer, __u16 length, __u32 crc32) 75static inline __be32 sctp_update_cksum(__u8 *buffer, __u16 length, __be32 crc32)
71{ 76{
72 return crc32c(crc32, buffer, length); 77 return sctp_crc32c(crc32, buffer, length);
73} 78}
74 79
75static inline __u32 sctp_end_cksum(__u32 crc32) 80static inline __be32 sctp_end_cksum(__be32 crc32)
76{ 81{
77 return ntohl(~crc32); 82 return ~crc32;
78} 83}
diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h
index 90b1e8d23b16..17b932b8a55a 100644
--- a/include/net/sctp/sctp.h
+++ b/include/net/sctp/sctp.h
@@ -179,6 +179,8 @@ int sctp_eps_proc_init(void);
179void sctp_eps_proc_exit(void); 179void sctp_eps_proc_exit(void);
180int sctp_assocs_proc_init(void); 180int sctp_assocs_proc_init(void);
181void sctp_assocs_proc_exit(void); 181void sctp_assocs_proc_exit(void);
182int sctp_remaddr_proc_init(void);
183void sctp_remaddr_proc_exit(void);
182 184
183 185
184/* 186/*
@@ -218,8 +220,6 @@ extern struct kmem_cache *sctp_bucket_cachep __read_mostly;
218#define sctp_release_sock(sk) release_sock(sk) 220#define sctp_release_sock(sk) release_sock(sk)
219#define sctp_bh_lock_sock(sk) bh_lock_sock(sk) 221#define sctp_bh_lock_sock(sk) bh_lock_sock(sk)
220#define sctp_bh_unlock_sock(sk) bh_unlock_sock(sk) 222#define sctp_bh_unlock_sock(sk) bh_unlock_sock(sk)
221#define SCTP_SOCK_SLEEP_PRE(sk) SOCK_SLEEP_PRE(sk)
222#define SCTP_SOCK_SLEEP_POST(sk) SOCK_SLEEP_POST(sk)
223 223
224/* SCTP SNMP MIB stats handlers */ 224/* SCTP SNMP MIB stats handlers */
225DECLARE_SNMP_STAT(struct sctp_mib, sctp_statistics); 225DECLARE_SNMP_STAT(struct sctp_mib, sctp_statistics);
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h
index 7f25195f9855..70eb64a7e1a1 100644
--- a/include/net/sctp/structs.h
+++ b/include/net/sctp/structs.h
@@ -300,6 +300,7 @@ struct sctp_sock {
300 300
301 /* The default SACK delay timeout for new associations. */ 301 /* The default SACK delay timeout for new associations. */
302 __u32 sackdelay; 302 __u32 sackdelay;
303 __u32 sackfreq;
303 304
304 /* Flags controlling Heartbeat, SACK delay, and Path MTU Discovery. */ 305 /* Flags controlling Heartbeat, SACK delay, and Path MTU Discovery. */
305 __u32 param_flags; 306 __u32 param_flags;
@@ -826,7 +827,7 @@ struct sctp_packet *sctp_packet_init(struct sctp_packet *,
826 __u16 sport, __u16 dport); 827 __u16 sport, __u16 dport);
827struct sctp_packet *sctp_packet_config(struct sctp_packet *, __u32 vtag, int); 828struct sctp_packet *sctp_packet_config(struct sctp_packet *, __u32 vtag, int);
828sctp_xmit_t sctp_packet_transmit_chunk(struct sctp_packet *, 829sctp_xmit_t sctp_packet_transmit_chunk(struct sctp_packet *,
829 struct sctp_chunk *); 830 struct sctp_chunk *, int);
830sctp_xmit_t sctp_packet_append_chunk(struct sctp_packet *, 831sctp_xmit_t sctp_packet_append_chunk(struct sctp_packet *,
831 struct sctp_chunk *); 832 struct sctp_chunk *);
832int sctp_packet_transmit(struct sctp_packet *); 833int sctp_packet_transmit(struct sctp_packet *);
@@ -946,6 +947,7 @@ struct sctp_transport {
946 947
947 /* SACK delay timeout */ 948 /* SACK delay timeout */
948 unsigned long sackdelay; 949 unsigned long sackdelay;
950 __u32 sackfreq;
949 951
950 /* When was the last time (in jiffies) that we heard from this 952 /* When was the last time (in jiffies) that we heard from this
951 * transport? We use this to pick new active and retran paths. 953 * transport? We use this to pick new active and retran paths.
@@ -1209,6 +1211,8 @@ int sctp_add_bind_addr(struct sctp_bind_addr *, union sctp_addr *,
1209int sctp_del_bind_addr(struct sctp_bind_addr *, union sctp_addr *); 1211int sctp_del_bind_addr(struct sctp_bind_addr *, union sctp_addr *);
1210int sctp_bind_addr_match(struct sctp_bind_addr *, const union sctp_addr *, 1212int sctp_bind_addr_match(struct sctp_bind_addr *, const union sctp_addr *,
1211 struct sctp_sock *); 1213 struct sctp_sock *);
1214int sctp_bind_addr_conflict(struct sctp_bind_addr *, const union sctp_addr *,
1215 struct sctp_sock *, struct sctp_sock *);
1212int sctp_bind_addr_state(const struct sctp_bind_addr *bp, 1216int sctp_bind_addr_state(const struct sctp_bind_addr *bp,
1213 const union sctp_addr *addr); 1217 const union sctp_addr *addr);
1214union sctp_addr *sctp_find_unmatch_addr(struct sctp_bind_addr *bp, 1218union sctp_addr *sctp_find_unmatch_addr(struct sctp_bind_addr *bp,
@@ -1553,6 +1557,7 @@ struct sctp_association {
1553 * : SACK's are not delayed (see Section 6). 1557 * : SACK's are not delayed (see Section 6).
1554 */ 1558 */
1555 __u8 sack_needed; /* Do we need to sack the peer? */ 1559 __u8 sack_needed; /* Do we need to sack the peer? */
1560 __u32 sack_cnt;
1556 1561
1557 /* These are capabilities which our peer advertised. */ 1562 /* These are capabilities which our peer advertised. */
1558 __u8 ecn_capable; /* Can peer do ECN? */ 1563 __u8 ecn_capable; /* Can peer do ECN? */
@@ -1662,6 +1667,7 @@ struct sctp_association {
1662 1667
1663 /* SACK delay timeout */ 1668 /* SACK delay timeout */
1664 unsigned long sackdelay; 1669 unsigned long sackdelay;
1670 __u32 sackfreq;
1665 1671
1666 1672
1667 unsigned long timeouts[SCTP_NUM_TIMEOUT_TYPES]; 1673 unsigned long timeouts[SCTP_NUM_TIMEOUT_TYPES];
diff --git a/include/net/sctp/user.h b/include/net/sctp/user.h
index 9619b9d35c9e..f205b10f0ab9 100644
--- a/include/net/sctp/user.h
+++ b/include/net/sctp/user.h
@@ -93,8 +93,9 @@ enum sctp_optname {
93#define SCTP_STATUS SCTP_STATUS 93#define SCTP_STATUS SCTP_STATUS
94 SCTP_GET_PEER_ADDR_INFO, 94 SCTP_GET_PEER_ADDR_INFO,
95#define SCTP_GET_PEER_ADDR_INFO SCTP_GET_PEER_ADDR_INFO 95#define SCTP_GET_PEER_ADDR_INFO SCTP_GET_PEER_ADDR_INFO
96 SCTP_DELAYED_ACK_TIME, 96 SCTP_DELAYED_ACK,
97#define SCTP_DELAYED_ACK_TIME SCTP_DELAYED_ACK_TIME 97#define SCTP_DELAYED_ACK_TIME SCTP_DELAYED_ACK
98#define SCTP_DELAYED_ACK SCTP_DELAYED_ACK
98 SCTP_CONTEXT, /* Receive Context */ 99 SCTP_CONTEXT, /* Receive Context */
99#define SCTP_CONTEXT SCTP_CONTEXT 100#define SCTP_CONTEXT SCTP_CONTEXT
100 SCTP_FRAGMENT_INTERLEAVE, 101 SCTP_FRAGMENT_INTERLEAVE,
@@ -136,12 +137,14 @@ enum sctp_optname {
136#define SCTP_GET_LOCAL_ADDRS_NUM_OLD SCTP_GET_LOCAL_ADDRS_NUM_OLD 137#define SCTP_GET_LOCAL_ADDRS_NUM_OLD SCTP_GET_LOCAL_ADDRS_NUM_OLD
137 SCTP_GET_LOCAL_ADDRS_OLD, /* Get all local addresss. */ 138 SCTP_GET_LOCAL_ADDRS_OLD, /* Get all local addresss. */
138#define SCTP_GET_LOCAL_ADDRS_OLD SCTP_GET_LOCAL_ADDRS_OLD 139#define SCTP_GET_LOCAL_ADDRS_OLD SCTP_GET_LOCAL_ADDRS_OLD
139 SCTP_SOCKOPT_CONNECTX, /* CONNECTX requests. */ 140 SCTP_SOCKOPT_CONNECTX_OLD, /* CONNECTX old requests. */
140#define SCTP_SOCKOPT_CONNECTX SCTP_SOCKOPT_CONNECTX 141#define SCTP_SOCKOPT_CONNECTX_OLD SCTP_SOCKOPT_CONNECTX_OLD
141 SCTP_GET_PEER_ADDRS, /* Get all peer addresss. */ 142 SCTP_GET_PEER_ADDRS, /* Get all peer addresss. */
142#define SCTP_GET_PEER_ADDRS SCTP_GET_PEER_ADDRS 143#define SCTP_GET_PEER_ADDRS SCTP_GET_PEER_ADDRS
143 SCTP_GET_LOCAL_ADDRS, /* Get all local addresss. */ 144 SCTP_GET_LOCAL_ADDRS, /* Get all local addresss. */
144#define SCTP_GET_LOCAL_ADDRS SCTP_GET_LOCAL_ADDRS 145#define SCTP_GET_LOCAL_ADDRS SCTP_GET_LOCAL_ADDRS
146 SCTP_SOCKOPT_CONNECTX, /* CONNECTX requests. */
147#define SCTP_SOCKOPT_CONNECTX SCTP_SOCKOPT_CONNECTX
145}; 148};
146 149
147/* 150/*
@@ -618,13 +621,26 @@ struct sctp_authkeyid {
618}; 621};
619 622
620 623
621/* 7.1.23. Delayed Ack Timer (SCTP_DELAYED_ACK_TIME) 624/*
625 * 7.1.23. Get or set delayed ack timer (SCTP_DELAYED_SACK)
622 * 626 *
623 * This options will get or set the delayed ack timer. The time is set 627 * This option will effect the way delayed acks are performed. This
624 * in milliseconds. If the assoc_id is 0, then this sets or gets the 628 * option allows you to get or set the delayed ack time, in
625 * endpoints default delayed ack timer value. If the assoc_id field is 629 * milliseconds. It also allows changing the delayed ack frequency.
626 * non-zero, then the set or get effects the specified association. 630 * Changing the frequency to 1 disables the delayed sack algorithm. If
631 * the assoc_id is 0, then this sets or gets the endpoints default
632 * values. If the assoc_id field is non-zero, then the set or get
633 * effects the specified association for the one to many model (the
634 * assoc_id field is ignored by the one to one model). Note that if
635 * sack_delay or sack_freq are 0 when setting this option, then the
636 * current values will remain unchanged.
627 */ 637 */
638struct sctp_sack_info {
639 sctp_assoc_t sack_assoc_id;
640 uint32_t sack_delay;
641 uint32_t sack_freq;
642};
643
628struct sctp_assoc_value { 644struct sctp_assoc_value {
629 sctp_assoc_t assoc_id; 645 sctp_assoc_t assoc_id;
630 uint32_t assoc_value; 646 uint32_t assoc_value;
diff --git a/include/net/snmp.h b/include/net/snmp.h
index ce2f48507510..57c93628695f 100644
--- a/include/net/snmp.h
+++ b/include/net/snmp.h
@@ -14,8 +14,6 @@
14 * as published by the Free Software Foundation; either version 14 * as published by the Free Software Foundation; either version
15 * 2 of the License, or (at your option) any later version. 15 * 2 of the License, or (at your option) any later version.
16 * 16 *
17 * $Id: snmp.h,v 1.19 2001/06/14 13:40:46 davem Exp $
18 *
19 */ 17 */
20 18
21#ifndef _SNMP_H 19#ifndef _SNMP_H
diff --git a/include/net/sock.h b/include/net/sock.h
index dc42b44c2aa1..06c5259aff30 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -166,7 +166,7 @@ struct sock_common {
166 * @sk_err: last error 166 * @sk_err: last error
167 * @sk_err_soft: errors that don't cause failure but are the cause of a 167 * @sk_err_soft: errors that don't cause failure but are the cause of a
168 * persistent failure not just 'timed out' 168 * persistent failure not just 'timed out'
169 * @sk_drops: raw drops counter 169 * @sk_drops: raw/udp drops counter
170 * @sk_ack_backlog: current listen backlog 170 * @sk_ack_backlog: current listen backlog
171 * @sk_max_ack_backlog: listen backlog set in listen() 171 * @sk_max_ack_backlog: listen backlog set in listen()
172 * @sk_priority: %SO_PRIORITY setting 172 * @sk_priority: %SO_PRIORITY setting
@@ -524,7 +524,7 @@ struct proto {
524 int (*ioctl)(struct sock *sk, int cmd, 524 int (*ioctl)(struct sock *sk, int cmd,
525 unsigned long arg); 525 unsigned long arg);
526 int (*init)(struct sock *sk); 526 int (*init)(struct sock *sk);
527 int (*destroy)(struct sock *sk); 527 void (*destroy)(struct sock *sk);
528 void (*shutdown)(struct sock *sk, int how); 528 void (*shutdown)(struct sock *sk, int how);
529 int (*setsockopt)(struct sock *sk, int level, 529 int (*setsockopt)(struct sock *sk, int level,
530 int optname, char __user *optval, 530 int optname, char __user *optval,
@@ -565,7 +565,7 @@ struct proto {
565#endif 565#endif
566 566
567 /* Memory pressure */ 567 /* Memory pressure */
568 void (*enter_memory_pressure)(void); 568 void (*enter_memory_pressure)(struct sock *sk);
569 atomic_t *memory_allocated; /* Current allocated memory. */ 569 atomic_t *memory_allocated; /* Current allocated memory. */
570 atomic_t *sockets_allocated; /* Current number of sockets. */ 570 atomic_t *sockets_allocated; /* Current number of sockets. */
571 /* 571 /*
@@ -990,6 +990,11 @@ static inline void sock_put(struct sock *sk)
990extern int sk_receive_skb(struct sock *sk, struct sk_buff *skb, 990extern int sk_receive_skb(struct sock *sk, struct sk_buff *skb,
991 const int nested); 991 const int nested);
992 992
993static inline void sk_set_socket(struct sock *sk, struct socket *sock)
994{
995 sk->sk_socket = sock;
996}
997
993/* Detach socket from process context. 998/* Detach socket from process context.
994 * Announce socket dead, detach it from wait queue and inode. 999 * Announce socket dead, detach it from wait queue and inode.
995 * Note that parent inode held reference count on this struct sock, 1000 * Note that parent inode held reference count on this struct sock,
@@ -1001,7 +1006,7 @@ static inline void sock_orphan(struct sock *sk)
1001{ 1006{
1002 write_lock_bh(&sk->sk_callback_lock); 1007 write_lock_bh(&sk->sk_callback_lock);
1003 sock_set_flag(sk, SOCK_DEAD); 1008 sock_set_flag(sk, SOCK_DEAD);
1004 sk->sk_socket = NULL; 1009 sk_set_socket(sk, NULL);
1005 sk->sk_sleep = NULL; 1010 sk->sk_sleep = NULL;
1006 write_unlock_bh(&sk->sk_callback_lock); 1011 write_unlock_bh(&sk->sk_callback_lock);
1007} 1012}
@@ -1011,7 +1016,7 @@ static inline void sock_graft(struct sock *sk, struct socket *parent)
1011 write_lock_bh(&sk->sk_callback_lock); 1016 write_lock_bh(&sk->sk_callback_lock);
1012 sk->sk_sleep = &parent->wait; 1017 sk->sk_sleep = &parent->wait;
1013 parent->sk = sk; 1018 parent->sk = sk;
1014 sk->sk_socket = parent; 1019 sk_set_socket(sk, parent);
1015 security_sock_graft(sk, parent); 1020 security_sock_graft(sk, parent);
1016 write_unlock_bh(&sk->sk_callback_lock); 1021 write_unlock_bh(&sk->sk_callback_lock);
1017} 1022}
@@ -1205,7 +1210,7 @@ static inline struct page *sk_stream_alloc_page(struct sock *sk)
1205 1210
1206 page = alloc_pages(sk->sk_allocation, 0); 1211 page = alloc_pages(sk->sk_allocation, 0);
1207 if (!page) { 1212 if (!page) {
1208 sk->sk_prot->enter_memory_pressure(); 1213 sk->sk_prot->enter_memory_pressure(sk);
1209 sk_stream_moderate_sndbuf(sk); 1214 sk_stream_moderate_sndbuf(sk);
1210 } 1215 }
1211 return page; 1216 return page;
@@ -1331,30 +1336,6 @@ extern int net_msg_warn;
1331#define LIMIT_NETDEBUG(fmt, args...) \ 1336#define LIMIT_NETDEBUG(fmt, args...) \
1332 do { if (net_msg_warn && net_ratelimit()) printk(fmt,##args); } while(0) 1337 do { if (net_msg_warn && net_ratelimit()) printk(fmt,##args); } while(0)
1333 1338
1334/*
1335 * Macros for sleeping on a socket. Use them like this:
1336 *
1337 * SOCK_SLEEP_PRE(sk)
1338 * if (condition)
1339 * schedule();
1340 * SOCK_SLEEP_POST(sk)
1341 *
1342 * N.B. These are now obsolete and were, afaik, only ever used in DECnet
1343 * and when the last use of them in DECnet has gone, I'm intending to
1344 * remove them.
1345 */
1346
1347#define SOCK_SLEEP_PRE(sk) { struct task_struct *tsk = current; \
1348 DECLARE_WAITQUEUE(wait, tsk); \
1349 tsk->state = TASK_INTERRUPTIBLE; \
1350 add_wait_queue((sk)->sk_sleep, &wait); \
1351 release_sock(sk);
1352
1353#define SOCK_SLEEP_POST(sk) tsk->state = TASK_RUNNING; \
1354 remove_wait_queue((sk)->sk_sleep, &wait); \
1355 lock_sock(sk); \
1356 }
1357
1358extern __u32 sysctl_wmem_max; 1339extern __u32 sysctl_wmem_max;
1359extern __u32 sysctl_rmem_max; 1340extern __u32 sysctl_rmem_max;
1360 1341
diff --git a/include/net/stp.h b/include/net/stp.h
new file mode 100644
index 000000000000..ad447f105417
--- /dev/null
+++ b/include/net/stp.h
@@ -0,0 +1,14 @@
1#ifndef _NET_STP_H
2#define _NET_STP_H
3
4struct stp_proto {
5 unsigned char group_address[ETH_ALEN];
6 void (*rcv)(const struct stp_proto *, struct sk_buff *,
7 struct net_device *);
8 void *data;
9};
10
11extern int stp_proto_register(const struct stp_proto *proto);
12extern void stp_proto_unregister(const struct stp_proto *proto);
13
14#endif /* _NET_STP_H */
diff --git a/include/net/tcp.h b/include/net/tcp.h
index cf54034019d9..8983386356a5 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -50,6 +50,7 @@ extern atomic_t tcp_orphan_count;
50extern void tcp_time_wait(struct sock *sk, int state, int timeo); 50extern void tcp_time_wait(struct sock *sk, int state, int timeo);
51 51
52#define MAX_TCP_HEADER (128 + MAX_HEADER) 52#define MAX_TCP_HEADER (128 + MAX_HEADER)
53#define MAX_TCP_OPTION_SPACE 40
53 54
54/* 55/*
55 * Never offer a window over 32767 without using window scaling. Some 56 * Never offer a window over 32767 without using window scaling. Some
@@ -184,6 +185,7 @@ extern void tcp_time_wait(struct sock *sk, int state, int timeo);
184#define TCPOLEN_SACK_BASE_ALIGNED 4 185#define TCPOLEN_SACK_BASE_ALIGNED 4
185#define TCPOLEN_SACK_PERBLOCK 8 186#define TCPOLEN_SACK_PERBLOCK 8
186#define TCPOLEN_MD5SIG_ALIGNED 20 187#define TCPOLEN_MD5SIG_ALIGNED 20
188#define TCPOLEN_MSS_ALIGNED 4
187 189
188/* Flags in tp->nonagle */ 190/* Flags in tp->nonagle */
189#define TCP_NAGLE_OFF 1 /* Nagle's algo is disabled */ 191#define TCP_NAGLE_OFF 1 /* Nagle's algo is disabled */
@@ -265,13 +267,10 @@ static inline int tcp_too_many_orphans(struct sock *sk, int num)
265 267
266extern struct proto tcp_prot; 268extern struct proto tcp_prot;
267 269
268DECLARE_SNMP_STAT(struct tcp_mib, tcp_statistics); 270#define TCP_INC_STATS(net, field) SNMP_INC_STATS((net)->mib.tcp_statistics, field)
269#define TCP_INC_STATS(field) SNMP_INC_STATS(tcp_statistics, field) 271#define TCP_INC_STATS_BH(net, field) SNMP_INC_STATS_BH((net)->mib.tcp_statistics, field)
270#define TCP_INC_STATS_BH(field) SNMP_INC_STATS_BH(tcp_statistics, field) 272#define TCP_DEC_STATS(net, field) SNMP_DEC_STATS((net)->mib.tcp_statistics, field)
271#define TCP_INC_STATS_USER(field) SNMP_INC_STATS_USER(tcp_statistics, field) 273#define TCP_ADD_STATS_USER(net, field, val) SNMP_ADD_STATS_USER((net)->mib.tcp_statistics, field, val)
272#define TCP_DEC_STATS(field) SNMP_DEC_STATS(tcp_statistics, field)
273#define TCP_ADD_STATS_BH(field, val) SNMP_ADD_STATS_BH(tcp_statistics, field, val)
274#define TCP_ADD_STATS_USER(field, val) SNMP_ADD_STATS_USER(tcp_statistics, field, val)
275 274
276extern void tcp_v4_err(struct sk_buff *skb, u32); 275extern void tcp_v4_err(struct sk_buff *skb, u32);
277 276
@@ -398,6 +397,8 @@ extern void tcp_parse_options(struct sk_buff *skb,
398 struct tcp_options_received *opt_rx, 397 struct tcp_options_received *opt_rx,
399 int estab); 398 int estab);
400 399
400extern u8 *tcp_parse_md5sig_option(struct tcphdr *th);
401
401/* 402/*
402 * TCP v4 functions exported for the inet6 API 403 * TCP v4 functions exported for the inet6 API
403 */ 404 */
@@ -894,7 +895,7 @@ static inline int tcp_prequeue(struct sock *sk, struct sk_buff *skb)
894 895
895 while ((skb1 = __skb_dequeue(&tp->ucopy.prequeue)) != NULL) { 896 while ((skb1 = __skb_dequeue(&tp->ucopy.prequeue)) != NULL) {
896 sk->sk_backlog_rcv(sk, skb1); 897 sk->sk_backlog_rcv(sk, skb1);
897 NET_INC_STATS_BH(LINUX_MIB_TCPPREQUEUEDROPPED); 898 NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_TCPPREQUEUEDROPPED);
898 } 899 }
899 900
900 tp->ucopy.memory = 0; 901 tp->ucopy.memory = 0;
@@ -975,7 +976,7 @@ static inline void tcp_openreq_init(struct request_sock *req,
975 ireq->rmt_port = tcp_hdr(skb)->source; 976 ireq->rmt_port = tcp_hdr(skb)->source;
976} 977}
977 978
978extern void tcp_enter_memory_pressure(void); 979extern void tcp_enter_memory_pressure(struct sock *sk);
979 980
980static inline int keepalive_intvl_when(const struct tcp_sock *tp) 981static inline int keepalive_intvl_when(const struct tcp_sock *tp)
981{ 982{
@@ -1024,13 +1025,13 @@ static inline int tcp_paws_check(const struct tcp_options_received *rx_opt, int
1024 1025
1025#define TCP_CHECK_TIMER(sk) do { } while (0) 1026#define TCP_CHECK_TIMER(sk) do { } while (0)
1026 1027
1027static inline void tcp_mib_init(void) 1028static inline void tcp_mib_init(struct net *net)
1028{ 1029{
1029 /* See RFC 2012 */ 1030 /* See RFC 2012 */
1030 TCP_ADD_STATS_USER(TCP_MIB_RTOALGORITHM, 1); 1031 TCP_ADD_STATS_USER(net, TCP_MIB_RTOALGORITHM, 1);
1031 TCP_ADD_STATS_USER(TCP_MIB_RTOMIN, TCP_RTO_MIN*1000/HZ); 1032 TCP_ADD_STATS_USER(net, TCP_MIB_RTOMIN, TCP_RTO_MIN*1000/HZ);
1032 TCP_ADD_STATS_USER(TCP_MIB_RTOMAX, TCP_RTO_MAX*1000/HZ); 1033 TCP_ADD_STATS_USER(net, TCP_MIB_RTOMAX, TCP_RTO_MAX*1000/HZ);
1033 TCP_ADD_STATS_USER(TCP_MIB_MAXCONN, -1); 1034 TCP_ADD_STATS_USER(net, TCP_MIB_MAXCONN, -1);
1034} 1035}
1035 1036
1036/* from STCP */ 1037/* from STCP */
@@ -1113,14 +1114,12 @@ struct tcp_md5sig_pool {
1113#define TCP_MD5SIG_MAXKEYS (~(u32)0) /* really?! */ 1114#define TCP_MD5SIG_MAXKEYS (~(u32)0) /* really?! */
1114 1115
1115/* - functions */ 1116/* - functions */
1116extern int tcp_v4_calc_md5_hash(char *md5_hash, 1117extern int tcp_v4_md5_hash_skb(char *md5_hash,
1117 struct tcp_md5sig_key *key, 1118 struct tcp_md5sig_key *key,
1118 struct sock *sk, 1119 struct sock *sk,
1119 struct dst_entry *dst, 1120 struct request_sock *req,
1120 struct request_sock *req, 1121 struct sk_buff *skb);
1121 struct tcphdr *th, 1122
1122 int protocol,
1123 unsigned int tcplen);
1124extern struct tcp_md5sig_key *tcp_v4_md5_lookup(struct sock *sk, 1123extern struct tcp_md5sig_key *tcp_v4_md5_lookup(struct sock *sk,
1125 struct sock *addr_sk); 1124 struct sock *addr_sk);
1126 1125
@@ -1132,11 +1131,26 @@ extern int tcp_v4_md5_do_add(struct sock *sk,
1132extern int tcp_v4_md5_do_del(struct sock *sk, 1131extern int tcp_v4_md5_do_del(struct sock *sk,
1133 __be32 addr); 1132 __be32 addr);
1134 1133
1134#ifdef CONFIG_TCP_MD5SIG
1135#define tcp_twsk_md5_key(twsk) ((twsk)->tw_md5_keylen ? \
1136 &(struct tcp_md5sig_key) { \
1137 .key = (twsk)->tw_md5_key, \
1138 .keylen = (twsk)->tw_md5_keylen, \
1139 } : NULL)
1140#else
1141#define tcp_twsk_md5_key(twsk) NULL
1142#endif
1143
1135extern struct tcp_md5sig_pool **tcp_alloc_md5sig_pool(void); 1144extern struct tcp_md5sig_pool **tcp_alloc_md5sig_pool(void);
1136extern void tcp_free_md5sig_pool(void); 1145extern void tcp_free_md5sig_pool(void);
1137 1146
1138extern struct tcp_md5sig_pool *__tcp_get_md5sig_pool(int cpu); 1147extern struct tcp_md5sig_pool *__tcp_get_md5sig_pool(int cpu);
1139extern void __tcp_put_md5sig_pool(void); 1148extern void __tcp_put_md5sig_pool(void);
1149extern int tcp_md5_hash_header(struct tcp_md5sig_pool *, struct tcphdr *);
1150extern int tcp_md5_hash_skb_data(struct tcp_md5sig_pool *, struct sk_buff *,
1151 unsigned header_len);
1152extern int tcp_md5_hash_key(struct tcp_md5sig_pool *hp,
1153 struct tcp_md5sig_key *key);
1140 1154
1141static inline 1155static inline
1142struct tcp_md5sig_pool *tcp_get_md5sig_pool(void) 1156struct tcp_md5sig_pool *tcp_get_md5sig_pool(void)
@@ -1348,7 +1362,7 @@ extern void tcp_proc_unregister(struct net *net, struct tcp_seq_afinfo *afinfo);
1348extern struct request_sock_ops tcp_request_sock_ops; 1362extern struct request_sock_ops tcp_request_sock_ops;
1349extern struct request_sock_ops tcp6_request_sock_ops; 1363extern struct request_sock_ops tcp6_request_sock_ops;
1350 1364
1351extern int tcp_v4_destroy_sock(struct sock *sk); 1365extern void tcp_v4_destroy_sock(struct sock *sk);
1352 1366
1353extern int tcp_v4_gso_send_check(struct sk_buff *skb); 1367extern int tcp_v4_gso_send_check(struct sk_buff *skb);
1354extern struct sk_buff *tcp_tso_segment(struct sk_buff *skb, int features); 1368extern struct sk_buff *tcp_tso_segment(struct sk_buff *skb, int features);
@@ -1366,11 +1380,8 @@ struct tcp_sock_af_ops {
1366 int (*calc_md5_hash) (char *location, 1380 int (*calc_md5_hash) (char *location,
1367 struct tcp_md5sig_key *md5, 1381 struct tcp_md5sig_key *md5,
1368 struct sock *sk, 1382 struct sock *sk,
1369 struct dst_entry *dst,
1370 struct request_sock *req, 1383 struct request_sock *req,
1371 struct tcphdr *th, 1384 struct sk_buff *skb);
1372 int protocol,
1373 unsigned int len);
1374 int (*md5_add) (struct sock *sk, 1385 int (*md5_add) (struct sock *sk,
1375 struct sock *addr_sk, 1386 struct sock *addr_sk,
1376 u8 *newkey, 1387 u8 *newkey,
diff --git a/include/net/tipc/tipc_port.h b/include/net/tipc/tipc_port.h
index 11105bcc4457..c54917cbfa48 100644
--- a/include/net/tipc/tipc_port.h
+++ b/include/net/tipc/tipc_port.h
@@ -2,7 +2,7 @@
2 * include/net/tipc/tipc_port.h: Include file for privileged access to TIPC ports 2 * include/net/tipc/tipc_port.h: Include file for privileged access to TIPC ports
3 * 3 *
4 * Copyright (c) 1994-2007, Ericsson AB 4 * Copyright (c) 1994-2007, Ericsson AB
5 * Copyright (c) 2005-2007, Wind River Systems 5 * Copyright (c) 2005-2008, Wind River Systems
6 * All rights reserved. 6 * All rights reserved.
7 * 7 *
8 * Redistribution and use in source and binary forms, with or without 8 * Redistribution and use in source and binary forms, with or without
@@ -75,13 +75,7 @@ struct tipc_port {
75}; 75};
76 76
77 77
78/** 78struct tipc_port *tipc_createport_raw(void *usr_handle,
79 * tipc_createport_raw - create a native TIPC port and return it's reference
80 *
81 * Note: 'dispatcher' and 'wakeup' deliver a locked port.
82 */
83
84u32 tipc_createport_raw(void *usr_handle,
85 u32 (*dispatcher)(struct tipc_port *, struct sk_buff *), 79 u32 (*dispatcher)(struct tipc_port *, struct sk_buff *),
86 void (*wakeup)(struct tipc_port *), 80 void (*wakeup)(struct tipc_port *),
87 const u32 importance); 81 const u32 importance);
diff --git a/include/net/transp_v6.h b/include/net/transp_v6.h
index 112934a3288d..876b6f2bb4fd 100644
--- a/include/net/transp_v6.h
+++ b/include/net/transp_v6.h
@@ -53,7 +53,7 @@ extern int datagram_send_ctl(struct net *net,
53 */ 53 */
54extern struct inet_connection_sock_af_ops ipv4_specific; 54extern struct inet_connection_sock_af_ops ipv4_specific;
55 55
56extern int inet6_destroy_sock(struct sock *sk); 56extern void inet6_destroy_sock(struct sock *sk);
57 57
58#endif 58#endif
59 59
diff --git a/include/net/udp.h b/include/net/udp.h
index ccce83707046..addcdc67234c 100644
--- a/include/net/udp.h
+++ b/include/net/udp.h
@@ -148,27 +148,25 @@ extern int udp_lib_setsockopt(struct sock *sk, int level, int optname,
148 char __user *optval, int optlen, 148 char __user *optval, int optlen,
149 int (*push_pending_frames)(struct sock *)); 149 int (*push_pending_frames)(struct sock *));
150 150
151DECLARE_SNMP_STAT(struct udp_mib, udp_statistics);
152DECLARE_SNMP_STAT(struct udp_mib, udp_stats_in6); 151DECLARE_SNMP_STAT(struct udp_mib, udp_stats_in6);
153 152
154/* UDP-Lite does not have a standardized MIB yet, so we inherit from UDP */ 153/* UDP-Lite does not have a standardized MIB yet, so we inherit from UDP */
155DECLARE_SNMP_STAT(struct udp_mib, udplite_statistics);
156DECLARE_SNMP_STAT(struct udp_mib, udplite_stats_in6); 154DECLARE_SNMP_STAT(struct udp_mib, udplite_stats_in6);
157 155
158/* 156/*
159 * SNMP statistics for UDP and UDP-Lite 157 * SNMP statistics for UDP and UDP-Lite
160 */ 158 */
161#define UDP_INC_STATS_USER(field, is_udplite) do { \ 159#define UDP_INC_STATS_USER(net, field, is_udplite) do { \
162 if (is_udplite) SNMP_INC_STATS_USER(udplite_statistics, field); \ 160 if (is_udplite) SNMP_INC_STATS_USER((net)->mib.udplite_statistics, field); \
163 else SNMP_INC_STATS_USER(udp_statistics, field); } while(0) 161 else SNMP_INC_STATS_USER((net)->mib.udp_statistics, field); } while(0)
164#define UDP_INC_STATS_BH(field, is_udplite) do { \ 162#define UDP_INC_STATS_BH(net, field, is_udplite) do { \
165 if (is_udplite) SNMP_INC_STATS_BH(udplite_statistics, field); \ 163 if (is_udplite) SNMP_INC_STATS_BH((net)->mib.udplite_statistics, field); \
166 else SNMP_INC_STATS_BH(udp_statistics, field); } while(0) 164 else SNMP_INC_STATS_BH((net)->mib.udp_statistics, field); } while(0)
167 165
168#define UDP6_INC_STATS_BH(field, is_udplite) do { \ 166#define UDP6_INC_STATS_BH(net, field, is_udplite) do { (void)net; \
169 if (is_udplite) SNMP_INC_STATS_BH(udplite_stats_in6, field); \ 167 if (is_udplite) SNMP_INC_STATS_BH(udplite_stats_in6, field); \
170 else SNMP_INC_STATS_BH(udp_stats_in6, field); } while(0) 168 else SNMP_INC_STATS_BH(udp_stats_in6, field); } while(0)
171#define UDP6_INC_STATS_USER(field, is_udplite) do { \ 169#define UDP6_INC_STATS_USER(net, field, is_udplite) do { (void)net; \
172 if (is_udplite) SNMP_INC_STATS_USER(udplite_stats_in6, field); \ 170 if (is_udplite) SNMP_INC_STATS_USER(udplite_stats_in6, field); \
173 else SNMP_INC_STATS_USER(udp_stats_in6, field); } while(0) 171 else SNMP_INC_STATS_USER(udp_stats_in6, field); } while(0)
174 172
@@ -176,12 +174,12 @@ DECLARE_SNMP_STAT(struct udp_mib, udplite_stats_in6);
176#define UDPX_INC_STATS_BH(sk, field) \ 174#define UDPX_INC_STATS_BH(sk, field) \
177 do { \ 175 do { \
178 if ((sk)->sk_family == AF_INET) \ 176 if ((sk)->sk_family == AF_INET) \
179 UDP_INC_STATS_BH(field, 0); \ 177 UDP_INC_STATS_BH(sock_net(sk), field, 0); \
180 else \ 178 else \
181 UDP6_INC_STATS_BH(field, 0); \ 179 UDP6_INC_STATS_BH(sock_net(sk), field, 0); \
182 } while (0); 180 } while (0);
183#else 181#else
184#define UDPX_INC_STATS_BH(sk, field) UDP_INC_STATS_BH(field, 0) 182#define UDPX_INC_STATS_BH(sk, field) UDP_INC_STATS_BH(sock_net(sk), field, 0)
185#endif 183#endif
186 184
187/* /proc */ 185/* /proc */
@@ -196,8 +194,8 @@ struct udp_seq_afinfo {
196struct udp_iter_state { 194struct udp_iter_state {
197 struct seq_net_private p; 195 struct seq_net_private p;
198 sa_family_t family; 196 sa_family_t family;
199 struct hlist_head *hashtable;
200 int bucket; 197 int bucket;
198 struct hlist_head *hashtable;
201}; 199};
202 200
203#ifdef CONFIG_PROC_FS 201#ifdef CONFIG_PROC_FS
diff --git a/include/net/wext.h b/include/net/wext.h
index 80b31d826b7a..6d76a39a9c5b 100644
--- a/include/net/wext.h
+++ b/include/net/wext.h
@@ -12,6 +12,8 @@ extern int wext_proc_init(struct net *net);
12extern void wext_proc_exit(struct net *net); 12extern void wext_proc_exit(struct net *net);
13extern int wext_handle_ioctl(struct net *net, struct ifreq *ifr, unsigned int cmd, 13extern int wext_handle_ioctl(struct net *net, struct ifreq *ifr, unsigned int cmd,
14 void __user *arg); 14 void __user *arg);
15extern int compat_wext_handle_ioctl(struct net *net, unsigned int cmd,
16 unsigned long arg);
15#else 17#else
16static inline int wext_proc_init(struct net *net) 18static inline int wext_proc_init(struct net *net)
17{ 19{
@@ -26,6 +28,11 @@ static inline int wext_handle_ioctl(struct net *net, struct ifreq *ifr, unsigned
26{ 28{
27 return -EINVAL; 29 return -EINVAL;
28} 30}
31static inline int compat_wext_handle_ioctl(struct net *net, unsigned int cmd,
32 unsigned long arg)
33{
34 return -EINVAL;
35}
29#endif 36#endif
30 37
31#endif /* __NET_WEXT_H */ 38#endif /* __NET_WEXT_H */
diff --git a/include/net/wireless.h b/include/net/wireless.h
index 667b4080d30f..9324f8dd183e 100644
--- a/include/net/wireless.h
+++ b/include/net/wireless.h
@@ -39,12 +39,18 @@ enum ieee80211_band {
39 * on this channel. 39 * on this channel.
40 * @IEEE80211_CHAN_NO_IBSS: IBSS is not allowed 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. 41 * @IEEE80211_CHAN_RADAR: Radar detection is required on this channel.
42 * @IEEE80211_CHAN_NO_FAT_ABOVE: extension channel above this channel
43 * is not permitted.
44 * @IEEE80211_CHAN_NO_FAT_BELOW: extension channel below this channel
45 * is not permitted.
42 */ 46 */
43enum ieee80211_channel_flags { 47enum ieee80211_channel_flags {
44 IEEE80211_CHAN_DISABLED = 1<<0, 48 IEEE80211_CHAN_DISABLED = 1<<0,
45 IEEE80211_CHAN_PASSIVE_SCAN = 1<<1, 49 IEEE80211_CHAN_PASSIVE_SCAN = 1<<1,
46 IEEE80211_CHAN_NO_IBSS = 1<<2, 50 IEEE80211_CHAN_NO_IBSS = 1<<2,
47 IEEE80211_CHAN_RADAR = 1<<3, 51 IEEE80211_CHAN_RADAR = 1<<3,
52 IEEE80211_CHAN_NO_FAT_ABOVE = 1<<4,
53 IEEE80211_CHAN_NO_FAT_BELOW = 1<<5,
48}; 54};
49 55
50/** 56/**