aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/asm-generic/socket.h1
-rw-r--r--include/linux/brcmphy.h19
-rw-r--r--include/linux/can/core.h2
-rw-r--r--include/linux/can/dev.h20
-rw-r--r--include/linux/can/platform/mcp251x.h36
-rw-r--r--include/linux/can/platform/ti_hecc.h40
-rw-r--r--include/linux/compat.h44
-rw-r--r--include/linux/cryptohash.h1
-rw-r--r--include/linux/dn.h9
-rw-r--r--include/linux/errqueue.h6
-rw-r--r--include/linux/ethtool.h43
-rw-r--r--include/linux/fib_rules.h17
-rw-r--r--include/linux/filter.h10
-rw-r--r--include/linux/gen_stats.h15
-rw-r--r--include/linux/i2c/twl4030.h19
-rw-r--r--include/linux/i82593.h229
-rw-r--r--include/linux/ieee80211.h45
-rw-r--r--include/linux/if.h16
-rw-r--r--include/linux/if_addr.h9
-rw-r--r--include/linux/if_addrlabel.h6
-rw-r--r--include/linux/if_arcnet.h18
-rw-r--r--include/linux/if_arp.h3
-rw-r--r--include/linux/if_bonding.h3
-rw-r--r--include/linux/if_bridge.h9
-rw-r--r--include/linux/if_ec.h12
-rw-r--r--include/linux/if_ether.h4
-rw-r--r--include/linux/if_fddi.h22
-rw-r--r--include/linux/if_hippi.h15
-rw-r--r--include/linux/if_link.h42
-rw-r--r--include/linux/if_packet.h27
-rw-r--r--include/linux/if_plip.h3
-rw-r--r--include/linux/if_pppol2tp.h3
-rw-r--r--include/linux/if_tunnel.h18
-rw-r--r--include/linux/if_vlan.h41
-rw-r--r--include/linux/igmp.h15
-rw-r--r--include/linux/in.h18
-rw-r--r--include/linux/in6.h9
-rw-r--r--include/linux/inetdevice.h10
-rw-r--r--include/linux/ip_vs.h3
-rw-r--r--include/linux/ipv6.h4
-rw-r--r--include/linux/kvm.h272
-rw-r--r--include/linux/kvm_host.h53
-rw-r--r--include/linux/mfd/twl4030-codec.h272
-rw-r--r--include/linux/mmc/sdio_ids.h1
-rw-r--r--include/linux/mroute.h31
-rw-r--r--include/linux/mroute6.h15
-rw-r--r--include/linux/neighbour.h18
-rw-r--r--include/linux/net.h90
-rw-r--r--include/linux/netdevice.h156
-rw-r--r--include/linux/netfilter.h6
-rw-r--r--include/linux/netfilter/nf_conntrack_common.h6
-rw-r--r--include/linux/netfilter/nf_conntrack_ftp.h3
-rw-r--r--include/linux/netfilter/nf_conntrack_sctp.h3
-rw-r--r--include/linux/netfilter/nf_conntrack_tcp.h6
-rw-r--r--include/linux/netfilter/nfnetlink.h6
-rw-r--r--include/linux/netfilter/nfnetlink_compat.h3
-rw-r--r--include/linux/netfilter/x_tables.h45
-rw-r--r--include/linux/netfilter/xt_connbytes.h3
-rw-r--r--include/linux/netfilter/xt_esp.h3
-rw-r--r--include/linux/netfilter/xt_multiport.h9
-rw-r--r--include/linux/netfilter/xt_policy.h18
-rw-r--r--include/linux/netfilter/xt_state.h3
-rw-r--r--include/linux/netfilter/xt_string.h3
-rw-r--r--include/linux/netfilter/xt_tcpudp.h6
-rw-r--r--include/linux/netfilter_arp/arp_tables.h21
-rw-r--r--include/linux/netfilter_bridge/ebt_802_3.h3
-rw-r--r--include/linux/netfilter_bridge/ebt_among.h9
-rw-r--r--include/linux/netfilter_bridge/ebt_arpreply.h3
-rw-r--r--include/linux/netfilter_bridge/ebt_ip.h3
-rw-r--r--include/linux/netfilter_bridge/ebt_ip6.h3
-rw-r--r--include/linux/netfilter_bridge/ebt_limit.h3
-rw-r--r--include/linux/netfilter_bridge/ebt_log.h3
-rw-r--r--include/linux/netfilter_bridge/ebt_mark_m.h3
-rw-r--r--include/linux/netfilter_bridge/ebt_mark_t.h3
-rw-r--r--include/linux/netfilter_bridge/ebt_nat.h3
-rw-r--r--include/linux/netfilter_bridge/ebt_pkttype.h3
-rw-r--r--include/linux/netfilter_bridge/ebt_redirect.h3
-rw-r--r--include/linux/netfilter_bridge/ebt_stp.h6
-rw-r--r--include/linux/netfilter_bridge/ebtables.h39
-rw-r--r--include/linux/netfilter_ipv4/ip_tables.h27
-rw-r--r--include/linux/netfilter_ipv4/ipt_SAME.h3
-rw-r--r--include/linux/netfilter_ipv4/ipt_ah.h3
-rw-r--r--include/linux/netfilter_ipv6/ip6_tables.h27
-rw-r--r--include/linux/netfilter_ipv6/ip6t_ah.h3
-rw-r--r--include/linux/netfilter_ipv6/ip6t_frag.h3
-rw-r--r--include/linux/netfilter_ipv6/ip6t_ipv6header.h3
-rw-r--r--include/linux/netfilter_ipv6/ip6t_mh.h3
-rw-r--r--include/linux/netfilter_ipv6/ip6t_opts.h3
-rw-r--r--include/linux/netfilter_ipv6/ip6t_rt.h3
-rw-r--r--include/linux/netlink.h24
-rw-r--r--include/linux/nl80211.h62
-rw-r--r--include/linux/nl802154.h6
-rw-r--r--include/linux/notifier.h2
-rw-r--r--include/linux/of.h103
-rw-r--r--include/linux/of_fdt.h86
-rw-r--r--include/linux/pkt_cls.h84
-rw-r--r--include/linux/pkt_sched.h111
-rw-r--r--include/linux/pm.h8
-rw-r--r--include/linux/pm_runtime.h12
-rw-r--r--include/linux/rculist.h14
-rw-r--r--include/linux/rds.h8
-rw-r--r--include/linux/rfkill.h3
-rw-r--r--include/linux/route.h3
-rw-r--r--include/linux/rtnetlink.h63
-rw-r--r--include/linux/sctp.h1
-rw-r--r--include/linux/serial_core.h3
-rw-r--r--include/linux/skbuff.h31
-rw-r--r--include/linux/smsc911x.h1
-rw-r--r--include/linux/socket.h13
-rw-r--r--include/linux/spi/wl12xx.h1
-rw-r--r--include/linux/ssb/ssb.h20
-rw-r--r--include/linux/syscalls.h4
-rw-r--r--include/linux/sysctl.h45
-rw-r--r--include/linux/tc_act/tc_defact.h6
-rw-r--r--include/linux/tc_act/tc_gact.h9
-rw-r--r--include/linux/tc_act/tc_ipt.h3
-rw-r--r--include/linux/tc_act/tc_mirred.h6
-rw-r--r--include/linux/tc_act/tc_nat.h6
-rw-r--r--include/linux/tc_act/tc_pedit.h9
-rw-r--r--include/linux/tc_act/tc_skbedit.h2
-rw-r--r--include/linux/tc_ematch/tc_em_cmp.h6
-rw-r--r--include/linux/tc_ematch/tc_em_meta.h15
-rw-r--r--include/linux/tc_ematch/tc_em_nbyte.h3
-rw-r--r--include/linux/tc_ematch/tc_em_text.h3
-rw-r--r--include/linux/tcp.h72
-rw-r--r--include/linux/udp.h15
-rw-r--r--include/linux/usb/usbnet.h8
-rw-r--r--include/linux/user-return-notifier.h49
-rw-r--r--include/linux/wimax/debug.h72
-rw-r--r--include/linux/wimax/i2400m.h13
-rw-r--r--include/linux/x25.h1
-rw-r--r--include/linux/xfrm.h35
-rw-r--r--include/net/ah.h33
-rw-r--r--include/net/bluetooth/bluetooth.h2
-rw-r--r--include/net/bluetooth/hci_core.h39
-rw-r--r--include/net/bluetooth/l2cap.h2
-rw-r--r--include/net/cfg80211.h198
-rw-r--r--include/net/compat.h14
-rw-r--r--include/net/dn_dev.h13
-rw-r--r--include/net/dn_fib.h3
-rw-r--r--include/net/dn_nsp.h24
-rw-r--r--include/net/dst.h23
-rw-r--r--include/net/fib_rules.h21
-rw-r--r--include/net/gen_stats.h4
-rw-r--r--include/net/genetlink.h12
-rw-r--r--include/net/ieee80211_radiotap.h2
-rw-r--r--include/net/ieee802154_netdev.h16
-rw-r--r--include/net/if_inet6.h24
-rw-r--r--include/net/inet6_hashtables.h4
-rw-r--r--include/net/inet_hashtables.h20
-rw-r--r--include/net/inet_sock.h36
-rw-r--r--include/net/inet_timewait_sock.h10
-rw-r--r--include/net/inetpeer.h19
-rw-r--r--include/net/ip.h27
-rw-r--r--include/net/ip6_fib.h15
-rw-r--r--include/net/ip6_route.h3
-rw-r--r--include/net/ip_fib.h25
-rw-r--r--include/net/ip_vs.h6
-rw-r--r--include/net/ipip.h25
-rw-r--r--include/net/ipv6.h12
-rw-r--r--include/net/iw_handler.h26
-rw-r--r--include/net/mac80211.h203
-rw-r--r--include/net/neighbour.h21
-rw-r--r--include/net/net_namespace.h16
-rw-r--r--include/net/netfilter/nf_conntrack_ecache.h3
-rw-r--r--include/net/netfilter/nf_conntrack_expect.h6
-rw-r--r--include/net/netfilter/nf_conntrack_extend.h6
-rw-r--r--include/net/netfilter/nf_conntrack_helper.h3
-rw-r--r--include/net/netfilter/nf_conntrack_l3proto.h3
-rw-r--r--include/net/netfilter/nf_conntrack_l4proto.h3
-rw-r--r--include/net/netfilter/nf_conntrack_tuple.h12
-rw-r--r--include/net/netfilter/nf_nat.h15
-rw-r--r--include/net/netfilter/nf_nat_protocol.h3
-rw-r--r--include/net/netns/generic.h8
-rw-r--r--include/net/netns/xfrm.h1
-rw-r--r--include/net/phonet/phonet.h2
-rw-r--r--include/net/phonet/pn_dev.h8
-rw-r--r--include/net/pkt_cls.h28
-rw-r--r--include/net/pkt_sched.h3
-rw-r--r--include/net/protocol.h7
-rw-r--r--include/net/red.h6
-rw-r--r--include/net/request_sock.h8
-rw-r--r--include/net/route.h13
-rw-r--r--include/net/rtnetlink.h11
-rw-r--r--include/net/sch_generic.h30
-rw-r--r--include/net/scm.h9
-rw-r--r--include/net/sctp/constants.h4
-rw-r--r--include/net/sctp/sctp.h3
-rw-r--r--include/net/sctp/sm.h3
-rw-r--r--include/net/sctp/structs.h16
-rw-r--r--include/net/sctp/user.h134
-rw-r--r--include/net/sock.h46
-rw-r--r--include/net/tc_act/tc_skbedit.h2
-rw-r--r--include/net/tcp.h111
-rw-r--r--include/net/udp.h42
-rw-r--r--include/net/wext.h49
-rw-r--r--include/net/wimax.h6
-rw-r--r--include/net/wpan-phy.h22
-rw-r--r--include/net/x25.h6
-rw-r--r--include/net/xfrm.h47
-rw-r--r--include/sound/Kbuild1
-rw-r--r--include/sound/aci.h90
-rw-r--r--include/sound/ak4113.h321
-rw-r--r--include/sound/ak4114.h12
-rw-r--r--include/sound/ak4xxx-adda.h5
-rw-r--r--include/sound/control.h5
-rw-r--r--include/sound/cs4231-regs.h1
-rw-r--r--include/sound/pcm.h3
-rw-r--r--include/sound/rawmidi.h2
-rw-r--r--include/sound/sh_dac_audio.h21
-rw-r--r--include/sound/soc-dai.h14
-rw-r--r--include/sound/soc-dapm.h17
-rw-r--r--include/sound/soc.h15
-rw-r--r--include/sound/sscape_ioctl.h21
-rw-r--r--include/sound/tlv320dac33-plat.h20
-rw-r--r--include/sound/tpa6130a2-plat.h30
-rw-r--r--include/sound/wss.h1
217 files changed, 3541 insertions, 1739 deletions
diff --git a/include/asm-generic/socket.h b/include/asm-generic/socket.h
index 538991cef6f0..9a6115e7cf63 100644
--- a/include/asm-generic/socket.h
+++ b/include/asm-generic/socket.h
@@ -63,4 +63,5 @@
63#define SO_PROTOCOL 38 63#define SO_PROTOCOL 38
64#define SO_DOMAIN 39 64#define SO_DOMAIN 39
65 65
66#define SO_RXQ_OVFL 40
66#endif /* __ASM_GENERIC_SOCKET_H */ 67#endif /* __ASM_GENERIC_SOCKET_H */
diff --git a/include/linux/brcmphy.h b/include/linux/brcmphy.h
index 9b64b6d67873..2b31b91f5871 100644
--- a/include/linux/brcmphy.h
+++ b/include/linux/brcmphy.h
@@ -1,6 +1,13 @@
1#define PHY_BRCM_WIRESPEED_ENABLE 0x00000001 1#define PHY_BCM_FLAGS_MODE_COPPER 0x00000001
2#define PHY_BRCM_AUTO_PWRDWN_ENABLE 0x00000002 2#define PHY_BCM_FLAGS_MODE_1000BX 0x00000002
3#define PHY_BRCM_APD_CLK125_ENABLE 0x00000004 3#define PHY_BCM_FLAGS_INTF_SGMII 0x00000010
4#define PHY_BRCM_STD_IBND_DISABLE 0x00000008 4#define PHY_BCM_FLAGS_INTF_XAUI 0x00000020
5#define PHY_BRCM_EXT_IBND_RX_ENABLE 0x00000010 5#define PHY_BRCM_WIRESPEED_ENABLE 0x00000100
6#define PHY_BRCM_EXT_IBND_TX_ENABLE 0x00000020 6#define PHY_BRCM_AUTO_PWRDWN_ENABLE 0x00000200
7#define PHY_BRCM_RX_REFCLK_UNUSED 0x00000400
8#define PHY_BRCM_STD_IBND_DISABLE 0x00000800
9#define PHY_BRCM_EXT_IBND_RX_ENABLE 0x00001000
10#define PHY_BRCM_EXT_IBND_TX_ENABLE 0x00002000
11#define PHY_BRCM_CLEAR_RGMII_MODE 0x00004000
12#define PHY_BRCM_DIS_TXCRXC_NOENRGY 0x00008000
13#define PHY_BCM_FLAGS_VALID 0x80000000
diff --git a/include/linux/can/core.h b/include/linux/can/core.h
index 25085cbadcfc..6c507bea275f 100644
--- a/include/linux/can/core.h
+++ b/include/linux/can/core.h
@@ -32,14 +32,12 @@
32 * struct can_proto - CAN protocol structure 32 * struct can_proto - CAN protocol structure
33 * @type: type argument in socket() syscall, e.g. SOCK_DGRAM. 33 * @type: type argument in socket() syscall, e.g. SOCK_DGRAM.
34 * @protocol: protocol number in socket() syscall. 34 * @protocol: protocol number in socket() syscall.
35 * @capability: capability needed to open the socket, or -1 for no restriction.
36 * @ops: pointer to struct proto_ops for sock->ops. 35 * @ops: pointer to struct proto_ops for sock->ops.
37 * @prot: pointer to struct proto structure. 36 * @prot: pointer to struct proto structure.
38 */ 37 */
39struct can_proto { 38struct can_proto {
40 int type; 39 int type;
41 int protocol; 40 int protocol;
42 int capability;
43 struct proto_ops *ops; 41 struct proto_ops *ops;
44 struct proto *prot; 42 struct proto *prot;
45}; 43};
diff --git a/include/linux/can/dev.h b/include/linux/can/dev.h
index 5824b20b5fcb..1ed2a5cc03f5 100644
--- a/include/linux/can/dev.h
+++ b/include/linux/can/dev.h
@@ -29,8 +29,6 @@ enum can_mode {
29/* 29/*
30 * CAN common private data 30 * CAN common private data
31 */ 31 */
32#define CAN_ECHO_SKB_MAX 4
33
34struct can_priv { 32struct can_priv {
35 struct can_device_stats can_stats; 33 struct can_device_stats can_stats;
36 34
@@ -44,15 +42,16 @@ struct can_priv {
44 int restart_ms; 42 int restart_ms;
45 struct timer_list restart_timer; 43 struct timer_list restart_timer;
46 44
47 struct sk_buff *echo_skb[CAN_ECHO_SKB_MAX];
48
49 int (*do_set_bittiming)(struct net_device *dev); 45 int (*do_set_bittiming)(struct net_device *dev);
50 int (*do_set_mode)(struct net_device *dev, enum can_mode mode); 46 int (*do_set_mode)(struct net_device *dev, enum can_mode mode);
51 int (*do_get_state)(const struct net_device *dev, 47 int (*do_get_state)(const struct net_device *dev,
52 enum can_state *state); 48 enum can_state *state);
49
50 unsigned int echo_skb_max;
51 struct sk_buff **echo_skb;
53}; 52};
54 53
55struct net_device *alloc_candev(int sizeof_priv); 54struct net_device *alloc_candev(int sizeof_priv, unsigned int echo_skb_max);
56void free_candev(struct net_device *dev); 55void free_candev(struct net_device *dev);
57 56
58int open_candev(struct net_device *dev); 57int open_candev(struct net_device *dev);
@@ -64,8 +63,13 @@ void unregister_candev(struct net_device *dev);
64int can_restart_now(struct net_device *dev); 63int can_restart_now(struct net_device *dev);
65void can_bus_off(struct net_device *dev); 64void can_bus_off(struct net_device *dev);
66 65
67void can_put_echo_skb(struct sk_buff *skb, struct net_device *dev, int idx); 66void can_put_echo_skb(struct sk_buff *skb, struct net_device *dev,
68void can_get_echo_skb(struct net_device *dev, int idx); 67 unsigned int idx);
69void can_free_echo_skb(struct net_device *dev, int idx); 68void can_get_echo_skb(struct net_device *dev, unsigned int idx);
69void can_free_echo_skb(struct net_device *dev, unsigned int idx);
70
71struct sk_buff *alloc_can_skb(struct net_device *dev, struct can_frame **cf);
72struct sk_buff *alloc_can_err_skb(struct net_device *dev,
73 struct can_frame **cf);
70 74
71#endif /* CAN_DEV_H */ 75#endif /* CAN_DEV_H */
diff --git a/include/linux/can/platform/mcp251x.h b/include/linux/can/platform/mcp251x.h
new file mode 100644
index 000000000000..1448177d86d5
--- /dev/null
+++ b/include/linux/can/platform/mcp251x.h
@@ -0,0 +1,36 @@
1#ifndef __CAN_PLATFORM_MCP251X_H__
2#define __CAN_PLATFORM_MCP251X_H__
3
4/*
5 *
6 * CAN bus driver for Microchip 251x CAN Controller with SPI Interface
7 *
8 */
9
10#include <linux/spi/spi.h>
11
12/**
13 * struct mcp251x_platform_data - MCP251X SPI CAN controller platform data
14 * @oscillator_frequency: - oscillator frequency in Hz
15 * @model: - actual type of chip
16 * @board_specific_setup: - called before probing the chip (power,reset)
17 * @transceiver_enable: - called to power on/off the transceiver
18 * @power_enable: - called to power on/off the mcp *and* the
19 * transceiver
20 *
21 * Please note that you should define power_enable or transceiver_enable or
22 * none of them. Defining both of them is no use.
23 *
24 */
25
26struct mcp251x_platform_data {
27 unsigned long oscillator_frequency;
28 int model;
29#define CAN_MCP251X_MCP2510 0
30#define CAN_MCP251X_MCP2515 1
31 int (*board_specific_setup)(struct spi_device *spi);
32 int (*transceiver_enable)(int enable);
33 int (*power_enable) (int enable);
34};
35
36#endif /* __CAN_PLATFORM_MCP251X_H__ */
diff --git a/include/linux/can/platform/ti_hecc.h b/include/linux/can/platform/ti_hecc.h
new file mode 100644
index 000000000000..4688c7bb1bd1
--- /dev/null
+++ b/include/linux/can/platform/ti_hecc.h
@@ -0,0 +1,40 @@
1/*
2 * TI HECC (High End CAN Controller) driver platform header
3 *
4 * Copyright (C) 2009 Texas Instruments Incorporated - http://www.ti.com/
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License as
8 * published by the Free Software Foundation version 2.
9 *
10 * This program is distributed as is WITHOUT ANY WARRANTY of any
11 * kind, whether express or implied; without even the implied warranty
12 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 */
16
17/**
18 * struct hecc_platform_data - HECC Platform Data
19 *
20 * @scc_hecc_offset: mostly 0 - should really never change
21 * @scc_ram_offset: SCC RAM offset
22 * @hecc_ram_offset: HECC RAM offset
23 * @mbx_offset: Mailbox RAM offset
24 * @int_line: Interrupt line to use - 0 or 1
25 * @version: version for future use
26 *
27 * Platform data structure to get all platform specific settings.
28 * this structure also accounts the fact that the IP may have different
29 * RAM and mailbox offsets for different SOC's
30 */
31struct ti_hecc_platform_data {
32 u32 scc_hecc_offset;
33 u32 scc_ram_offset;
34 u32 hecc_ram_offset;
35 u32 mbx_offset;
36 u32 int_line;
37 u32 version;
38};
39
40
diff --git a/include/linux/compat.h b/include/linux/compat.h
index af931ee43dd8..ef68119a4fd2 100644
--- a/include/linux/compat.h
+++ b/include/linux/compat.h
@@ -10,6 +10,8 @@
10#include <linux/stat.h> 10#include <linux/stat.h>
11#include <linux/param.h> /* for HZ */ 11#include <linux/param.h> /* for HZ */
12#include <linux/sem.h> 12#include <linux/sem.h>
13#include <linux/socket.h>
14#include <linux/if.h>
13 15
14#include <asm/compat.h> 16#include <asm/compat.h>
15#include <asm/siginfo.h> 17#include <asm/siginfo.h>
@@ -154,6 +156,48 @@ typedef struct compat_sigevent {
154 } _sigev_un; 156 } _sigev_un;
155} compat_sigevent_t; 157} compat_sigevent_t;
156 158
159struct compat_ifmap {
160 compat_ulong_t mem_start;
161 compat_ulong_t mem_end;
162 unsigned short base_addr;
163 unsigned char irq;
164 unsigned char dma;
165 unsigned char port;
166};
167
168struct compat_if_settings
169{
170 unsigned int type; /* Type of physical device or protocol */
171 unsigned int size; /* Size of the data allocated by the caller */
172 compat_uptr_t ifs_ifsu; /* union of pointers */
173};
174
175struct compat_ifreq {
176 union {
177 char ifrn_name[IFNAMSIZ]; /* if name, e.g. "en0" */
178 } ifr_ifrn;
179 union {
180 struct sockaddr ifru_addr;
181 struct sockaddr ifru_dstaddr;
182 struct sockaddr ifru_broadaddr;
183 struct sockaddr ifru_netmask;
184 struct sockaddr ifru_hwaddr;
185 short ifru_flags;
186 compat_int_t ifru_ivalue;
187 compat_int_t ifru_mtu;
188 struct compat_ifmap ifru_map;
189 char ifru_slave[IFNAMSIZ]; /* Just fits the size */
190 char ifru_newname[IFNAMSIZ];
191 compat_caddr_t ifru_data;
192 struct compat_if_settings ifru_settings;
193 } ifr_ifru;
194};
195
196struct compat_ifconf {
197 compat_int_t ifc_len; /* size of buffer */
198 compat_caddr_t ifcbuf;
199};
200
157struct compat_robust_list { 201struct compat_robust_list {
158 compat_uptr_t next; 202 compat_uptr_t next;
159}; 203};
diff --git a/include/linux/cryptohash.h b/include/linux/cryptohash.h
index c118b2ad9807..ec78a4bbe1d5 100644
--- a/include/linux/cryptohash.h
+++ b/include/linux/cryptohash.h
@@ -2,6 +2,7 @@
2#define __CRYPTOHASH_H 2#define __CRYPTOHASH_H
3 3
4#define SHA_DIGEST_WORDS 5 4#define SHA_DIGEST_WORDS 5
5#define SHA_MESSAGE_BYTES (512 /*bits*/ / 8)
5#define SHA_WORKSPACE_WORDS 80 6#define SHA_WORKSPACE_WORDS 80
6 7
7void sha_init(__u32 *buf); 8void sha_init(__u32 *buf);
diff --git a/include/linux/dn.h b/include/linux/dn.h
index fe9990823193..9c50445462d9 100644
--- a/include/linux/dn.h
+++ b/include/linux/dn.h
@@ -71,14 +71,12 @@
71/* Structures */ 71/* Structures */
72 72
73 73
74struct dn_naddr 74struct dn_naddr {
75{
76 __le16 a_len; 75 __le16 a_len;
77 __u8 a_addr[DN_MAXADDL]; /* Two bytes little endian */ 76 __u8 a_addr[DN_MAXADDL]; /* Two bytes little endian */
78}; 77};
79 78
80struct sockaddr_dn 79struct sockaddr_dn {
81{
82 __u16 sdn_family; 80 __u16 sdn_family;
83 __u8 sdn_flags; 81 __u8 sdn_flags;
84 __u8 sdn_objnum; 82 __u8 sdn_objnum;
@@ -101,8 +99,7 @@ struct optdata_dn {
101 __u8 opt_data[16]; /* User data */ 99 __u8 opt_data[16]; /* User data */
102}; 100};
103 101
104struct accessdata_dn 102struct accessdata_dn {
105{
106 __u8 acc_accl; 103 __u8 acc_accl;
107 __u8 acc_acc[DN_MAXACCL]; 104 __u8 acc_acc[DN_MAXACCL];
108 __u8 acc_passl; 105 __u8 acc_passl;
diff --git a/include/linux/errqueue.h b/include/linux/errqueue.h
index ec12cc74366f..034072cea853 100644
--- a/include/linux/errqueue.h
+++ b/include/linux/errqueue.h
@@ -3,8 +3,7 @@
3 3
4#include <linux/types.h> 4#include <linux/types.h>
5 5
6struct sock_extended_err 6struct sock_extended_err {
7{
8 __u32 ee_errno; 7 __u32 ee_errno;
9 __u8 ee_origin; 8 __u8 ee_origin;
10 __u8 ee_type; 9 __u8 ee_type;
@@ -31,8 +30,7 @@ struct sock_extended_err
31 30
32#define SKB_EXT_ERR(skb) ((struct sock_exterr_skb *) ((skb)->cb)) 31#define SKB_EXT_ERR(skb) ((struct sock_exterr_skb *) ((skb)->cb))
33 32
34struct sock_exterr_skb 33struct sock_exterr_skb {
35{
36 union { 34 union {
37 struct inet_skb_parm h4; 35 struct inet_skb_parm h4;
38#if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE) 36#if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE)
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h
index 15e4eb713694..ef4a2d84d922 100644
--- a/include/linux/ethtool.h
+++ b/include/linux/ethtool.h
@@ -49,13 +49,14 @@ static inline __u32 ethtool_cmd_speed(struct ethtool_cmd *ep)
49 return (ep->speed_hi << 16) | ep->speed; 49 return (ep->speed_hi << 16) | ep->speed;
50} 50}
51 51
52#define ETHTOOL_FWVERS_LEN 32
52#define ETHTOOL_BUSINFO_LEN 32 53#define ETHTOOL_BUSINFO_LEN 32
53/* these strings are set to whatever the driver author decides... */ 54/* these strings are set to whatever the driver author decides... */
54struct ethtool_drvinfo { 55struct ethtool_drvinfo {
55 __u32 cmd; 56 __u32 cmd;
56 char driver[32]; /* driver short name, "tulip", "eepro100" */ 57 char driver[32]; /* driver short name, "tulip", "eepro100" */
57 char version[32]; /* driver version string */ 58 char version[32]; /* driver version string */
58 char fw_version[32]; /* firmware version string, if applicable */ 59 char fw_version[ETHTOOL_FWVERS_LEN]; /* firmware version string */
59 char bus_info[ETHTOOL_BUSINFO_LEN]; /* Bus info for this IF. */ 60 char bus_info[ETHTOOL_BUSINFO_LEN]; /* Bus info for this IF. */
60 /* For PCI devices, use pci_name(pci_dev). */ 61 /* For PCI devices, use pci_name(pci_dev). */
61 char reserved1[32]; 62 char reserved1[32];
@@ -495,13 +496,10 @@ struct ethtool_ops {
495 u32 (*get_priv_flags)(struct net_device *); 496 u32 (*get_priv_flags)(struct net_device *);
496 int (*set_priv_flags)(struct net_device *, u32); 497 int (*set_priv_flags)(struct net_device *, u32);
497 int (*get_sset_count)(struct net_device *, int); 498 int (*get_sset_count)(struct net_device *, int);
498
499 /* the following hooks are obsolete */
500 int (*self_test_count)(struct net_device *);/* use get_sset_count */
501 int (*get_stats_count)(struct net_device *);/* use get_sset_count */
502 int (*get_rxnfc)(struct net_device *, struct ethtool_rxnfc *, void *); 499 int (*get_rxnfc)(struct net_device *, struct ethtool_rxnfc *, void *);
503 int (*set_rxnfc)(struct net_device *, struct ethtool_rxnfc *); 500 int (*set_rxnfc)(struct net_device *, struct ethtool_rxnfc *);
504 int (*flash_device)(struct net_device *, struct ethtool_flash *); 501 int (*flash_device)(struct net_device *, struct ethtool_flash *);
502 int (*reset)(struct net_device *, u32 *);
505}; 503};
506#endif /* __KERNEL__ */ 504#endif /* __KERNEL__ */
507 505
@@ -559,6 +557,7 @@ struct ethtool_ops {
559#define ETHTOOL_SRXCLSRLDEL 0x00000031 /* Delete RX classification rule */ 557#define ETHTOOL_SRXCLSRLDEL 0x00000031 /* Delete RX classification rule */
560#define ETHTOOL_SRXCLSRLINS 0x00000032 /* Insert RX classification rule */ 558#define ETHTOOL_SRXCLSRLINS 0x00000032 /* Insert RX classification rule */
561#define ETHTOOL_FLASHDEV 0x00000033 /* Flash firmware to device */ 559#define ETHTOOL_FLASHDEV 0x00000033 /* Flash firmware to device */
560#define ETHTOOL_RESET 0x00000034 /* Reset hardware */
562 561
563/* compatibility with older code */ 562/* compatibility with older code */
564#define SPARC_ETH_GSET ETHTOOL_GSET 563#define SPARC_ETH_GSET ETHTOOL_GSET
@@ -633,6 +632,8 @@ struct ethtool_ops {
633#define PORT_MII 0x02 632#define PORT_MII 0x02
634#define PORT_FIBRE 0x03 633#define PORT_FIBRE 0x03
635#define PORT_BNC 0x04 634#define PORT_BNC 0x04
635#define PORT_DA 0x05
636#define PORT_NONE 0xef
636#define PORT_OTHER 0xff 637#define PORT_OTHER 0xff
637 638
638/* Which transceiver to use. */ 639/* Which transceiver to use. */
@@ -676,6 +677,8 @@ struct ethtool_ops {
676#define AH_V6_FLOW 0x0b 677#define AH_V6_FLOW 0x0b
677#define ESP_V6_FLOW 0x0c 678#define ESP_V6_FLOW 0x0c
678#define IP_USER_FLOW 0x0d 679#define IP_USER_FLOW 0x0d
680#define IPV4_FLOW 0x10
681#define IPV6_FLOW 0x11
679 682
680/* L3-L4 network traffic flow hash options */ 683/* L3-L4 network traffic flow hash options */
681#define RXH_L2DA (1 << 1) 684#define RXH_L2DA (1 << 1)
@@ -689,4 +692,34 @@ struct ethtool_ops {
689 692
690#define RX_CLS_FLOW_DISC 0xffffffffffffffffULL 693#define RX_CLS_FLOW_DISC 0xffffffffffffffffULL
691 694
695/* Reset flags */
696/* The reset() operation must clear the flags for the components which
697 * were actually reset. On successful return, the flags indicate the
698 * components which were not reset, either because they do not exist
699 * in the hardware or because they cannot be reset independently. The
700 * driver must never reset any components that were not requested.
701 */
702enum ethtool_reset_flags {
703 /* These flags represent components dedicated to the interface
704 * the command is addressed to. Shift any flag left by
705 * ETH_RESET_SHARED_SHIFT to reset a shared component of the
706 * same type.
707 */
708 ETH_RESET_MGMT = 1 << 0, /* Management processor */
709 ETH_RESET_IRQ = 1 << 1, /* Interrupt requester */
710 ETH_RESET_DMA = 1 << 2, /* DMA engine */
711 ETH_RESET_FILTER = 1 << 3, /* Filtering/flow direction */
712 ETH_RESET_OFFLOAD = 1 << 4, /* Protocol offload */
713 ETH_RESET_MAC = 1 << 5, /* Media access controller */
714 ETH_RESET_PHY = 1 << 6, /* Transceiver/PHY */
715 ETH_RESET_RAM = 1 << 7, /* RAM shared between
716 * multiple components */
717
718 ETH_RESET_DEDICATED = 0x0000ffff, /* All components dedicated to
719 * this interface */
720 ETH_RESET_ALL = 0xffffffff, /* All components used by this
721 * interface, even if shared */
722};
723#define ETH_RESET_SHARED_SHIFT 16
724
692#endif /* _LINUX_ETHTOOL_H */ 725#endif /* _LINUX_ETHTOOL_H */
diff --git a/include/linux/fib_rules.h b/include/linux/fib_rules.h
index 87b606b63f1e..51da65b68b85 100644
--- a/include/linux/fib_rules.h
+++ b/include/linux/fib_rules.h
@@ -8,13 +8,14 @@
8#define FIB_RULE_PERMANENT 0x00000001 8#define FIB_RULE_PERMANENT 0x00000001
9#define FIB_RULE_INVERT 0x00000002 9#define FIB_RULE_INVERT 0x00000002
10#define FIB_RULE_UNRESOLVED 0x00000004 10#define FIB_RULE_UNRESOLVED 0x00000004
11#define FIB_RULE_DEV_DETACHED 0x00000008 11#define FIB_RULE_IIF_DETACHED 0x00000008
12#define FIB_RULE_DEV_DETACHED FIB_RULE_IIF_DETACHED
13#define FIB_RULE_OIF_DETACHED 0x00000010
12 14
13/* try to find source address in routing lookups */ 15/* try to find source address in routing lookups */
14#define FIB_RULE_FIND_SADDR 0x00010000 16#define FIB_RULE_FIND_SADDR 0x00010000
15 17
16struct fib_rule_hdr 18struct fib_rule_hdr {
17{
18 __u8 family; 19 __u8 family;
19 __u8 dst_len; 20 __u8 dst_len;
20 __u8 src_len; 21 __u8 src_len;
@@ -28,12 +29,12 @@ struct fib_rule_hdr
28 __u32 flags; 29 __u32 flags;
29}; 30};
30 31
31enum 32enum {
32{
33 FRA_UNSPEC, 33 FRA_UNSPEC,
34 FRA_DST, /* destination address */ 34 FRA_DST, /* destination address */
35 FRA_SRC, /* source address */ 35 FRA_SRC, /* source address */
36 FRA_IFNAME, /* interface name */ 36 FRA_IIFNAME, /* interface name */
37#define FRA_IFNAME FRA_IIFNAME
37 FRA_GOTO, /* target to jump to (FR_ACT_GOTO) */ 38 FRA_GOTO, /* target to jump to (FR_ACT_GOTO) */
38 FRA_UNUSED2, 39 FRA_UNUSED2,
39 FRA_PRIORITY, /* priority/preference */ 40 FRA_PRIORITY, /* priority/preference */
@@ -47,13 +48,13 @@ enum
47 FRA_UNUSED8, 48 FRA_UNUSED8,
48 FRA_TABLE, /* Extended table id */ 49 FRA_TABLE, /* Extended table id */
49 FRA_FWMASK, /* mask for netfilter mark */ 50 FRA_FWMASK, /* mask for netfilter mark */
51 FRA_OIFNAME,
50 __FRA_MAX 52 __FRA_MAX
51}; 53};
52 54
53#define FRA_MAX (__FRA_MAX - 1) 55#define FRA_MAX (__FRA_MAX - 1)
54 56
55enum 57enum {
56{
57 FR_ACT_UNSPEC, 58 FR_ACT_UNSPEC,
58 FR_ACT_TO_TBL, /* Pass to fixed table */ 59 FR_ACT_TO_TBL, /* Pass to fixed table */
59 FR_ACT_GOTO, /* Jump to another rule */ 60 FR_ACT_GOTO, /* Jump to another rule */
diff --git a/include/linux/filter.h b/include/linux/filter.h
index 1354aaf6abbe..29a0e3db9f43 100644
--- a/include/linux/filter.h
+++ b/include/linux/filter.h
@@ -23,16 +23,14 @@
23 * the BPF code definitions which need to match so you can share filters 23 * the BPF code definitions which need to match so you can share filters
24 */ 24 */
25 25
26struct sock_filter /* Filter block */ 26struct sock_filter { /* Filter block */
27{
28 __u16 code; /* Actual filter code */ 27 __u16 code; /* Actual filter code */
29 __u8 jt; /* Jump true */ 28 __u8 jt; /* Jump true */
30 __u8 jf; /* Jump false */ 29 __u8 jf; /* Jump false */
31 __u32 k; /* Generic multiuse field */ 30 __u32 k; /* Generic multiuse field */
32}; 31};
33 32
34struct sock_fprog /* Required for SO_ATTACH_FILTER. */ 33struct sock_fprog { /* Required for SO_ATTACH_FILTER. */
35{
36 unsigned short len; /* Number of filter blocks */ 34 unsigned short len; /* Number of filter blocks */
37 struct sock_filter __user *filter; 35 struct sock_filter __user *filter;
38}; 36};
@@ -123,7 +121,9 @@ struct sock_fprog /* Required for SO_ATTACH_FILTER. */
123#define SKF_AD_IFINDEX 8 121#define SKF_AD_IFINDEX 8
124#define SKF_AD_NLATTR 12 122#define SKF_AD_NLATTR 12
125#define SKF_AD_NLATTR_NEST 16 123#define SKF_AD_NLATTR_NEST 16
126#define SKF_AD_MAX 20 124#define SKF_AD_MARK 20
125#define SKF_AD_QUEUE 24
126#define SKF_AD_MAX 28
127#define SKF_NET_OFF (-0x100000) 127#define SKF_NET_OFF (-0x100000)
128#define SKF_LL_OFF (-0x200000) 128#define SKF_LL_OFF (-0x200000)
129 129
diff --git a/include/linux/gen_stats.h b/include/linux/gen_stats.h
index 710e901085d0..552c8a0a12d1 100644
--- a/include/linux/gen_stats.h
+++ b/include/linux/gen_stats.h
@@ -18,13 +18,11 @@ enum {
18 * @bytes: number of seen bytes 18 * @bytes: number of seen bytes
19 * @packets: number of seen packets 19 * @packets: number of seen packets
20 */ 20 */
21struct gnet_stats_basic 21struct gnet_stats_basic {
22{
23 __u64 bytes; 22 __u64 bytes;
24 __u32 packets; 23 __u32 packets;
25}; 24};
26struct gnet_stats_basic_packed 25struct gnet_stats_basic_packed {
27{
28 __u64 bytes; 26 __u64 bytes;
29 __u32 packets; 27 __u32 packets;
30} __attribute__ ((packed)); 28} __attribute__ ((packed));
@@ -34,8 +32,7 @@ struct gnet_stats_basic_packed
34 * @bps: current byte rate 32 * @bps: current byte rate
35 * @pps: current packet rate 33 * @pps: current packet rate
36 */ 34 */
37struct gnet_stats_rate_est 35struct gnet_stats_rate_est {
38{
39 __u32 bps; 36 __u32 bps;
40 __u32 pps; 37 __u32 pps;
41}; 38};
@@ -48,8 +45,7 @@ struct gnet_stats_rate_est
48 * @requeues: number of requeues 45 * @requeues: number of requeues
49 * @overlimits: number of enqueues over the limit 46 * @overlimits: number of enqueues over the limit
50 */ 47 */
51struct gnet_stats_queue 48struct gnet_stats_queue {
52{
53 __u32 qlen; 49 __u32 qlen;
54 __u32 backlog; 50 __u32 backlog;
55 __u32 drops; 51 __u32 drops;
@@ -62,8 +58,7 @@ struct gnet_stats_queue
62 * @interval: sampling period 58 * @interval: sampling period
63 * @ewma_log: the log of measurement window weight 59 * @ewma_log: the log of measurement window weight
64 */ 60 */
65struct gnet_estimator 61struct gnet_estimator {
66{
67 signed char interval; 62 signed char interval;
68 unsigned char ewma_log; 63 unsigned char ewma_log;
69}; 64};
diff --git a/include/linux/i2c/twl4030.h b/include/linux/i2c/twl4030.h
index 508824ee35e6..5306a759cbde 100644
--- a/include/linux/i2c/twl4030.h
+++ b/include/linux/i2c/twl4030.h
@@ -401,6 +401,24 @@ struct twl4030_power_data {
401 401
402extern void twl4030_power_init(struct twl4030_power_data *triton2_scripts); 402extern void twl4030_power_init(struct twl4030_power_data *triton2_scripts);
403 403
404struct twl4030_codec_audio_data {
405 unsigned int audio_mclk;
406 unsigned int ramp_delay_value;
407 unsigned int hs_extmute:1;
408 void (*set_hs_extmute)(int mute);
409};
410
411struct twl4030_codec_vibra_data {
412 unsigned int audio_mclk;
413 unsigned int coexist;
414};
415
416struct twl4030_codec_data {
417 unsigned int audio_mclk;
418 struct twl4030_codec_audio_data *audio;
419 struct twl4030_codec_vibra_data *vibra;
420};
421
404struct twl4030_platform_data { 422struct twl4030_platform_data {
405 unsigned irq_base, irq_end; 423 unsigned irq_base, irq_end;
406 struct twl4030_bci_platform_data *bci; 424 struct twl4030_bci_platform_data *bci;
@@ -409,6 +427,7 @@ struct twl4030_platform_data {
409 struct twl4030_keypad_data *keypad; 427 struct twl4030_keypad_data *keypad;
410 struct twl4030_usb_data *usb; 428 struct twl4030_usb_data *usb;
411 struct twl4030_power_data *power; 429 struct twl4030_power_data *power;
430 struct twl4030_codec_data *codec;
412 431
413 /* LDO regulators */ 432 /* LDO regulators */
414 struct regulator_init_data *vdac; 433 struct regulator_init_data *vdac;
diff --git a/include/linux/i82593.h b/include/linux/i82593.h
new file mode 100644
index 000000000000..afac5c7a323d
--- /dev/null
+++ b/include/linux/i82593.h
@@ -0,0 +1,229 @@
1/*
2 * Definitions for Intel 82593 CSMA/CD Core LAN Controller
3 * The definitions are taken from the 1992 users manual with Intel
4 * order number 297125-001.
5 *
6 * /usr/src/pc/RCS/i82593.h,v 1.1 1996/07/17 15:23:12 root Exp
7 *
8 * Copyright 1994, Anders Klemets <klemets@it.kth.se>
9 *
10 * HISTORY
11 * i82593.h,v
12 * Revision 1.4 2005/11/4 09:15:00 baroniunas
13 * Modified copyright with permission of author as follows:
14 *
15 * "If I82539.H is the only file with my copyright statement
16 * that is included in the Source Forge project, then you have
17 * my approval to change the copyright statement to be a GPL
18 * license, in the way you proposed on October 10."
19 *
20 * Revision 1.1 1996/07/17 15:23:12 root
21 * Initial revision
22 *
23 * Revision 1.3 1995/04/05 15:13:58 adj
24 * Initial alpha release
25 *
26 * Revision 1.2 1994/06/16 23:57:31 klemets
27 * Mirrored all the fields in the configuration block.
28 *
29 * Revision 1.1 1994/06/02 20:25:34 klemets
30 * Initial revision
31 *
32 *
33 */
34#ifndef _I82593_H
35#define _I82593_H
36
37/* Intel 82593 CSMA/CD Core LAN Controller */
38
39/* Port 0 Command Register definitions */
40
41/* Execution operations */
42#define OP0_NOP 0 /* CHNL = 0 */
43#define OP0_SWIT_TO_PORT_1 0 /* CHNL = 1 */
44#define OP0_IA_SETUP 1
45#define OP0_CONFIGURE 2
46#define OP0_MC_SETUP 3
47#define OP0_TRANSMIT 4
48#define OP0_TDR 5
49#define OP0_DUMP 6
50#define OP0_DIAGNOSE 7
51#define OP0_TRANSMIT_NO_CRC 9
52#define OP0_RETRANSMIT 12
53#define OP0_ABORT 13
54/* Reception operations */
55#define OP0_RCV_ENABLE 8
56#define OP0_RCV_DISABLE 10
57#define OP0_STOP_RCV 11
58/* Status pointer control operations */
59#define OP0_FIX_PTR 15 /* CHNL = 1 */
60#define OP0_RLS_PTR 15 /* CHNL = 0 */
61#define OP0_RESET 14
62
63#define CR0_CHNL (1 << 4) /* 0=Channel 0, 1=Channel 1 */
64#define CR0_STATUS_0 0x00
65#define CR0_STATUS_1 0x20
66#define CR0_STATUS_2 0x40
67#define CR0_STATUS_3 0x60
68#define CR0_INT_ACK (1 << 7) /* 0=No ack, 1=acknowledge */
69
70/* Port 0 Status Register definitions */
71
72#define SR0_NO_RESULT 0 /* dummy */
73#define SR0_EVENT_MASK 0x0f
74#define SR0_IA_SETUP_DONE 1
75#define SR0_CONFIGURE_DONE 2
76#define SR0_MC_SETUP_DONE 3
77#define SR0_TRANSMIT_DONE 4
78#define SR0_TDR_DONE 5
79#define SR0_DUMP_DONE 6
80#define SR0_DIAGNOSE_PASSED 7
81#define SR0_TRANSMIT_NO_CRC_DONE 9
82#define SR0_RETRANSMIT_DONE 12
83#define SR0_EXECUTION_ABORTED 13
84#define SR0_END_OF_FRAME 8
85#define SR0_RECEPTION_ABORTED 10
86#define SR0_DIAGNOSE_FAILED 15
87#define SR0_STOP_REG_HIT 11
88
89#define SR0_CHNL (1 << 4)
90#define SR0_EXECUTION (1 << 5)
91#define SR0_RECEPTION (1 << 6)
92#define SR0_INTERRUPT (1 << 7)
93#define SR0_BOTH_RX_TX (SR0_EXECUTION | SR0_RECEPTION)
94
95#define SR3_EXEC_STATE_MASK 0x03
96#define SR3_EXEC_IDLE 0
97#define SR3_TX_ABORT_IN_PROGRESS 1
98#define SR3_EXEC_ACTIVE 2
99#define SR3_ABORT_IN_PROGRESS 3
100#define SR3_EXEC_CHNL (1 << 2)
101#define SR3_STP_ON_NO_RSRC (1 << 3)
102#define SR3_RCVING_NO_RSRC (1 << 4)
103#define SR3_RCV_STATE_MASK 0x60
104#define SR3_RCV_IDLE 0x00
105#define SR3_RCV_READY 0x20
106#define SR3_RCV_ACTIVE 0x40
107#define SR3_RCV_STOP_IN_PROG 0x60
108#define SR3_RCV_CHNL (1 << 7)
109
110/* Port 1 Command Register definitions */
111
112#define OP1_NOP 0
113#define OP1_SWIT_TO_PORT_0 1
114#define OP1_INT_DISABLE 2
115#define OP1_INT_ENABLE 3
116#define OP1_SET_TS 5
117#define OP1_RST_TS 7
118#define OP1_POWER_DOWN 8
119#define OP1_RESET_RING_MNGMT 11
120#define OP1_RESET 14
121#define OP1_SEL_RST 15
122
123#define CR1_STATUS_4 0x00
124#define CR1_STATUS_5 0x20
125#define CR1_STATUS_6 0x40
126#define CR1_STOP_REG_UPDATE (1 << 7)
127
128/* Receive frame status bits */
129
130#define RX_RCLD (1 << 0)
131#define RX_IA_MATCH (1 << 1)
132#define RX_NO_AD_MATCH (1 << 2)
133#define RX_NO_SFD (1 << 3)
134#define RX_SRT_FRM (1 << 7)
135#define RX_OVRRUN (1 << 8)
136#define RX_ALG_ERR (1 << 10)
137#define RX_CRC_ERR (1 << 11)
138#define RX_LEN_ERR (1 << 12)
139#define RX_RCV_OK (1 << 13)
140#define RX_TYP_LEN (1 << 15)
141
142/* Transmit status bits */
143
144#define TX_NCOL_MASK 0x0f
145#define TX_FRTL (1 << 4)
146#define TX_MAX_COL (1 << 5)
147#define TX_HRT_BEAT (1 << 6)
148#define TX_DEFER (1 << 7)
149#define TX_UND_RUN (1 << 8)
150#define TX_LOST_CTS (1 << 9)
151#define TX_LOST_CRS (1 << 10)
152#define TX_LTCOL (1 << 11)
153#define TX_OK (1 << 13)
154#define TX_COLL (1 << 15)
155
156struct i82593_conf_block {
157 u_char fifo_limit : 4,
158 forgnesi : 1,
159 fifo_32 : 1,
160 d6mod : 1,
161 throttle_enb : 1;
162 u_char throttle : 6,
163 cntrxint : 1,
164 contin : 1;
165 u_char addr_len : 3,
166 acloc : 1,
167 preamb_len : 2,
168 loopback : 2;
169 u_char lin_prio : 3,
170 tbofstop : 1,
171 exp_prio : 3,
172 bof_met : 1;
173 u_char : 4,
174 ifrm_spc : 4;
175 u_char : 5,
176 slottim_low : 3;
177 u_char slottim_hi : 3,
178 : 1,
179 max_retr : 4;
180 u_char prmisc : 1,
181 bc_dis : 1,
182 : 1,
183 crs_1 : 1,
184 nocrc_ins : 1,
185 crc_1632 : 1,
186 : 1,
187 crs_cdt : 1;
188 u_char cs_filter : 3,
189 crs_src : 1,
190 cd_filter : 3,
191 : 1;
192 u_char : 2,
193 min_fr_len : 6;
194 u_char lng_typ : 1,
195 lng_fld : 1,
196 rxcrc_xf : 1,
197 artx : 1,
198 sarec : 1,
199 tx_jabber : 1, /* why is this called max_len in the manual? */
200 hash_1 : 1,
201 lbpkpol : 1;
202 u_char : 6,
203 fdx : 1,
204 : 1;
205 u_char dummy_6 : 6, /* supposed to be ones */
206 mult_ia : 1,
207 dis_bof : 1;
208 u_char dummy_1 : 1, /* supposed to be one */
209 tx_ifs_retrig : 2,
210 mc_all : 1,
211 rcv_mon : 2,
212 frag_acpt : 1,
213 tstrttrs : 1;
214 u_char fretx : 1,
215 runt_eop : 1,
216 hw_sw_pin : 1,
217 big_endn : 1,
218 syncrqs : 1,
219 sttlen : 1,
220 tx_eop : 1,
221 rx_eop : 1;
222 u_char rbuf_size : 5,
223 rcvstop : 1,
224 : 2;
225};
226
227#define I82593_MAX_MULTICAST_ADDRESSES 128 /* Hardware hashed filter */
228
229#endif /* _I82593_H */
diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h
index 52e15e079c61..d9724a28c0c2 100644
--- a/include/linux/ieee80211.h
+++ b/include/linux/ieee80211.h
@@ -115,7 +115,6 @@
115#define IEEE80211_MAX_SSID_LEN 32 115#define IEEE80211_MAX_SSID_LEN 32
116 116
117#define IEEE80211_MAX_MESH_ID_LEN 32 117#define IEEE80211_MAX_MESH_ID_LEN 32
118#define IEEE80211_MESH_CONFIG_LEN 24
119 118
120#define IEEE80211_QOS_CTL_LEN 2 119#define IEEE80211_QOS_CTL_LEN 2
121#define IEEE80211_QOS_CTL_TID_MASK 0x000F 120#define IEEE80211_QOS_CTL_TID_MASK 0x000F
@@ -472,7 +471,7 @@ static inline int ieee80211_is_cfendack(__le16 fc)
472} 471}
473 472
474/** 473/**
475 * ieee80211_is_nullfunc - check if FTYPE=IEEE80211_FTYPE_DATA and STYPE=IEEE80211_STYPE_NULLFUNC 474 * ieee80211_is_nullfunc - check if frame is a regular (non-QoS) nullfunc frame
476 * @fc: frame control bytes in little-endian byteorder 475 * @fc: frame control bytes in little-endian byteorder
477 */ 476 */
478static inline int ieee80211_is_nullfunc(__le16 fc) 477static inline int ieee80211_is_nullfunc(__le16 fc)
@@ -481,6 +480,16 @@ static inline int ieee80211_is_nullfunc(__le16 fc)
481 cpu_to_le16(IEEE80211_FTYPE_DATA | IEEE80211_STYPE_NULLFUNC); 480 cpu_to_le16(IEEE80211_FTYPE_DATA | IEEE80211_STYPE_NULLFUNC);
482} 481}
483 482
483/**
484 * ieee80211_is_qos_nullfunc - check if frame is a QoS nullfunc frame
485 * @fc: frame control bytes in little-endian byteorder
486 */
487static inline int ieee80211_is_qos_nullfunc(__le16 fc)
488{
489 return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) ==
490 cpu_to_le16(IEEE80211_FTYPE_DATA | IEEE80211_STYPE_QOS_NULLFUNC);
491}
492
484struct ieee80211s_hdr { 493struct ieee80211s_hdr {
485 u8 flags; 494 u8 flags;
486 u8 ttl; 495 u8 ttl;
@@ -544,6 +553,35 @@ struct ieee80211_tim_ie {
544 u8 virtual_map[1]; 553 u8 virtual_map[1];
545} __attribute__ ((packed)); 554} __attribute__ ((packed));
546 555
556/**
557 * struct ieee80211_meshconf_ie
558 *
559 * This structure refers to "Mesh Configuration information element"
560 */
561struct ieee80211_meshconf_ie {
562 u8 meshconf_psel;
563 u8 meshconf_pmetric;
564 u8 meshconf_congest;
565 u8 meshconf_synch;
566 u8 meshconf_auth;
567 u8 meshconf_form;
568 u8 meshconf_cap;
569} __attribute__ ((packed));
570
571/**
572 * struct ieee80211_rann_ie
573 *
574 * This structure refers to "Root Announcement information element"
575 */
576struct ieee80211_rann_ie {
577 u8 rann_flags;
578 u8 rann_hopcount;
579 u8 rann_ttl;
580 u8 rann_addr[6];
581 u32 rann_seq;
582 u32 rann_metric;
583} __attribute__ ((packed));
584
547#define WLAN_SA_QUERY_TR_ID_LEN 2 585#define WLAN_SA_QUERY_TR_ID_LEN 2
548 586
549struct ieee80211_mgmt { 587struct ieee80211_mgmt {
@@ -1060,6 +1098,7 @@ enum ieee80211_eid {
1060 WLAN_EID_PREQ = 68, 1098 WLAN_EID_PREQ = 68,
1061 WLAN_EID_PREP = 69, 1099 WLAN_EID_PREP = 69,
1062 WLAN_EID_PERR = 70, 1100 WLAN_EID_PERR = 70,
1101 WLAN_EID_RANN = 49, /* compatible with FreeBSD */
1063 /* 802.11h */ 1102 /* 802.11h */
1064 WLAN_EID_PWR_CONSTRAINT = 32, 1103 WLAN_EID_PWR_CONSTRAINT = 32,
1065 WLAN_EID_PWR_CAPABILITY = 33, 1104 WLAN_EID_PWR_CAPABILITY = 33,
@@ -1227,6 +1266,8 @@ enum ieee80211_sa_query_action {
1227 1266
1228#define WLAN_MAX_KEY_LEN 32 1267#define WLAN_MAX_KEY_LEN 32
1229 1268
1269#define WLAN_PMKID_LEN 16
1270
1230/** 1271/**
1231 * ieee80211_get_qos_ctl - get pointer to qos control bytes 1272 * ieee80211_get_qos_ctl - get pointer to qos control bytes
1232 * @hdr: the frame 1273 * @hdr: the frame
diff --git a/include/linux/if.h b/include/linux/if.h
index b9a6229f3be7..3a9f410a296b 100644
--- a/include/linux/if.h
+++ b/include/linux/if.h
@@ -70,6 +70,7 @@
70#define IFF_XMIT_DST_RELEASE 0x400 /* dev_hard_start_xmit() is allowed to 70#define IFF_XMIT_DST_RELEASE 0x400 /* dev_hard_start_xmit() is allowed to
71 * release skb->dst 71 * release skb->dst
72 */ 72 */
73#define IFF_DONT_BRIDGE 0x800 /* disallow bridging this ether dev */
73 74
74#define IF_GET_IFACE 0x0001 /* for querying only */ 75#define IF_GET_IFACE 0x0001 /* for querying only */
75#define IF_GET_PROTO 0x0002 76#define IF_GET_PROTO 0x0002
@@ -125,8 +126,7 @@ enum {
125 * being very small might be worth keeping for clean configuration. 126 * being very small might be worth keeping for clean configuration.
126 */ 127 */
127 128
128struct ifmap 129struct ifmap {
129{
130 unsigned long mem_start; 130 unsigned long mem_start;
131 unsigned long mem_end; 131 unsigned long mem_end;
132 unsigned short base_addr; 132 unsigned short base_addr;
@@ -136,8 +136,7 @@ struct ifmap
136 /* 3 bytes spare */ 136 /* 3 bytes spare */
137}; 137};
138 138
139struct if_settings 139struct if_settings {
140{
141 unsigned int type; /* Type of physical device or protocol */ 140 unsigned int type; /* Type of physical device or protocol */
142 unsigned int size; /* Size of the data allocated by the caller */ 141 unsigned int size; /* Size of the data allocated by the caller */
143 union { 142 union {
@@ -161,8 +160,7 @@ struct if_settings
161 * remainder may be interface specific. 160 * remainder may be interface specific.
162 */ 161 */
163 162
164struct ifreq 163struct ifreq {
165{
166#define IFHWADDRLEN 6 164#define IFHWADDRLEN 6
167 union 165 union
168 { 166 {
@@ -211,11 +209,9 @@ struct ifreq
211 * must know all networks accessible). 209 * must know all networks accessible).
212 */ 210 */
213 211
214struct ifconf 212struct ifconf {
215{
216 int ifc_len; /* size of buffer */ 213 int ifc_len; /* size of buffer */
217 union 214 union {
218 {
219 char __user *ifcu_buf; 215 char __user *ifcu_buf;
220 struct ifreq __user *ifcu_req; 216 struct ifreq __user *ifcu_req;
221 } ifc_ifcu; 217 } ifc_ifcu;
diff --git a/include/linux/if_addr.h b/include/linux/if_addr.h
index fd9740466757..23357ab81a77 100644
--- a/include/linux/if_addr.h
+++ b/include/linux/if_addr.h
@@ -4,8 +4,7 @@
4#include <linux/types.h> 4#include <linux/types.h>
5#include <linux/netlink.h> 5#include <linux/netlink.h>
6 6
7struct ifaddrmsg 7struct ifaddrmsg {
8{
9 __u8 ifa_family; 8 __u8 ifa_family;
10 __u8 ifa_prefixlen; /* The prefix length */ 9 __u8 ifa_prefixlen; /* The prefix length */
11 __u8 ifa_flags; /* Flags */ 10 __u8 ifa_flags; /* Flags */
@@ -20,8 +19,7 @@ struct ifaddrmsg
20 * but for point-to-point IFA_ADDRESS is DESTINATION address, 19 * but for point-to-point IFA_ADDRESS is DESTINATION address,
21 * local address is supplied in IFA_LOCAL attribute. 20 * local address is supplied in IFA_LOCAL attribute.
22 */ 21 */
23enum 22enum {
24{
25 IFA_UNSPEC, 23 IFA_UNSPEC,
26 IFA_ADDRESS, 24 IFA_ADDRESS,
27 IFA_LOCAL, 25 IFA_LOCAL,
@@ -47,8 +45,7 @@ enum
47#define IFA_F_TENTATIVE 0x40 45#define IFA_F_TENTATIVE 0x40
48#define IFA_F_PERMANENT 0x80 46#define IFA_F_PERMANENT 0x80
49 47
50struct ifa_cacheinfo 48struct ifa_cacheinfo {
51{
52 __u32 ifa_prefered; 49 __u32 ifa_prefered;
53 __u32 ifa_valid; 50 __u32 ifa_valid;
54 __u32 cstamp; /* created timestamp, hundredths of seconds */ 51 __u32 cstamp; /* created timestamp, hundredths of seconds */
diff --git a/include/linux/if_addrlabel.h b/include/linux/if_addrlabel.h
index 89571f65d6de..54580c298187 100644
--- a/include/linux/if_addrlabel.h
+++ b/include/linux/if_addrlabel.h
@@ -12,8 +12,7 @@
12 12
13#include <linux/types.h> 13#include <linux/types.h>
14 14
15struct ifaddrlblmsg 15struct ifaddrlblmsg {
16{
17 __u8 ifal_family; /* Address family */ 16 __u8 ifal_family; /* Address family */
18 __u8 __ifal_reserved; /* Reserved */ 17 __u8 __ifal_reserved; /* Reserved */
19 __u8 ifal_prefixlen; /* Prefix length */ 18 __u8 ifal_prefixlen; /* Prefix length */
@@ -22,8 +21,7 @@ struct ifaddrlblmsg
22 __u32 ifal_seq; /* sequence number */ 21 __u32 ifal_seq; /* sequence number */
23}; 22};
24 23
25enum 24enum {
26{
27 IFAL_ADDRESS = 1, 25 IFAL_ADDRESS = 1,
28 IFAL_LABEL = 2, 26 IFAL_LABEL = 2,
29 __IFAL_MAX 27 __IFAL_MAX
diff --git a/include/linux/if_arcnet.h b/include/linux/if_arcnet.h
index 0835debab115..46e34bd0e783 100644
--- a/include/linux/if_arcnet.h
+++ b/include/linux/if_arcnet.h
@@ -56,8 +56,7 @@
56/* 56/*
57 * The RFC1201-specific components of an arcnet packet header. 57 * The RFC1201-specific components of an arcnet packet header.
58 */ 58 */
59struct arc_rfc1201 59struct arc_rfc1201 {
60{
61 __u8 proto; /* protocol ID field - varies */ 60 __u8 proto; /* protocol ID field - varies */
62 __u8 split_flag; /* for use with split packets */ 61 __u8 split_flag; /* for use with split packets */
63 __be16 sequence; /* sequence number */ 62 __be16 sequence; /* sequence number */
@@ -69,8 +68,7 @@ struct arc_rfc1201
69/* 68/*
70 * The RFC1051-specific components. 69 * The RFC1051-specific components.
71 */ 70 */
72struct arc_rfc1051 71struct arc_rfc1051 {
73{
74 __u8 proto; /* ARC_P_RFC1051_ARP/RFC1051_IP */ 72 __u8 proto; /* ARC_P_RFC1051_ARP/RFC1051_IP */
75 __u8 payload[0]; /* 507 bytes */ 73 __u8 payload[0]; /* 507 bytes */
76}; 74};
@@ -81,8 +79,7 @@ struct arc_rfc1051
81 * The ethernet-encap-specific components. We have a real ethernet header 79 * The ethernet-encap-specific components. We have a real ethernet header
82 * and some data. 80 * and some data.
83 */ 81 */
84struct arc_eth_encap 82struct arc_eth_encap {
85{
86 __u8 proto; /* Always ARC_P_ETHER */ 83 __u8 proto; /* Always ARC_P_ETHER */
87 struct ethhdr eth; /* standard ethernet header (yuck!) */ 84 struct ethhdr eth; /* standard ethernet header (yuck!) */
88 __u8 payload[0]; /* 493 bytes */ 85 __u8 payload[0]; /* 493 bytes */
@@ -90,8 +87,7 @@ struct arc_eth_encap
90#define ETH_ENCAP_HDR_SIZE 14 87#define ETH_ENCAP_HDR_SIZE 14
91 88
92 89
93struct arc_cap 90struct arc_cap {
94{
95 __u8 proto; 91 __u8 proto;
96 __u8 cookie[sizeof(int)]; /* Actually NOT sent over the network */ 92 __u8 cookie[sizeof(int)]; /* Actually NOT sent over the network */
97 union { 93 union {
@@ -108,8 +104,7 @@ struct arc_cap
108 * the _end_ of the 512-byte buffer. We hide this complexity inside the 104 * the _end_ of the 512-byte buffer. We hide this complexity inside the
109 * driver. 105 * driver.
110 */ 106 */
111struct arc_hardware 107struct arc_hardware {
112{
113 __u8 source, /* source ARCnet - filled in automagically */ 108 __u8 source, /* source ARCnet - filled in automagically */
114 dest, /* destination ARCnet - 0 for broadcast */ 109 dest, /* destination ARCnet - 0 for broadcast */
115 offset[2]; /* offset bytes (some weird semantics) */ 110 offset[2]; /* offset bytes (some weird semantics) */
@@ -120,8 +115,7 @@ struct arc_hardware
120 * This is an ARCnet frame header, as seen by the kernel (and userspace, 115 * This is an ARCnet frame header, as seen by the kernel (and userspace,
121 * when you do a raw packet capture). 116 * when you do a raw packet capture).
122 */ 117 */
123struct archdr 118struct archdr {
124{
125 /* hardware requirements */ 119 /* hardware requirements */
126 struct arc_hardware hard; 120 struct arc_hardware hard;
127 121
diff --git a/include/linux/if_arp.h b/include/linux/if_arp.h
index 282eb37e2dec..e80b7f88f7c6 100644
--- a/include/linux/if_arp.h
+++ b/include/linux/if_arp.h
@@ -133,8 +133,7 @@ struct arpreq_old {
133 * This structure defines an ethernet arp header. 133 * This structure defines an ethernet arp header.
134 */ 134 */
135 135
136struct arphdr 136struct arphdr {
137{
138 __be16 ar_hrd; /* format of hardware address */ 137 __be16 ar_hrd; /* format of hardware address */
139 __be16 ar_pro; /* format of protocol address */ 138 __be16 ar_pro; /* format of protocol address */
140 unsigned char ar_hln; /* length of hardware address */ 139 unsigned char ar_hln; /* length of hardware address */
diff --git a/include/linux/if_bonding.h b/include/linux/if_bonding.h
index 65c2d247068b..cd525fae3c98 100644
--- a/include/linux/if_bonding.h
+++ b/include/linux/if_bonding.h
@@ -94,8 +94,7 @@ typedef struct ifbond {
94 __s32 miimon; 94 __s32 miimon;
95} ifbond; 95} ifbond;
96 96
97typedef struct ifslave 97typedef struct ifslave {
98{
99 __s32 slave_id; /* Used as an IN param to the BOND_SLAVE_INFO_QUERY ioctl */ 98 __s32 slave_id; /* Used as an IN param to the BOND_SLAVE_INFO_QUERY ioctl */
100 char slave_name[IFNAMSIZ]; 99 char slave_name[IFNAMSIZ];
101 __s8 link; 100 __s8 link;
diff --git a/include/linux/if_bridge.h b/include/linux/if_bridge.h
index 6badb3e2c4e4..938b7e81df95 100644
--- a/include/linux/if_bridge.h
+++ b/include/linux/if_bridge.h
@@ -49,8 +49,7 @@
49#define BR_STATE_FORWARDING 3 49#define BR_STATE_FORWARDING 3
50#define BR_STATE_BLOCKING 4 50#define BR_STATE_BLOCKING 4
51 51
52struct __bridge_info 52struct __bridge_info {
53{
54 __u64 designated_root; 53 __u64 designated_root;
55 __u64 bridge_id; 54 __u64 bridge_id;
56 __u32 root_path_cost; 55 __u32 root_path_cost;
@@ -72,8 +71,7 @@ struct __bridge_info
72 __u32 gc_timer_value; 71 __u32 gc_timer_value;
73}; 72};
74 73
75struct __port_info 74struct __port_info {
76{
77 __u64 designated_root; 75 __u64 designated_root;
78 __u64 designated_bridge; 76 __u64 designated_bridge;
79 __u16 port_id; 77 __u16 port_id;
@@ -89,8 +87,7 @@ struct __port_info
89 __u32 hold_timer_value; 87 __u32 hold_timer_value;
90}; 88};
91 89
92struct __fdb_entry 90struct __fdb_entry {
93{
94 __u8 mac_addr[6]; 91 __u8 mac_addr[6];
95 __u8 port_no; 92 __u8 port_no;
96 __u8 is_local; 93 __u8 is_local;
diff --git a/include/linux/if_ec.h b/include/linux/if_ec.h
index e7499aa79783..d85f9f48129f 100644
--- a/include/linux/if_ec.h
+++ b/include/linux/if_ec.h
@@ -5,14 +5,12 @@
5 5
6/* User visible stuff. Glibc provides its own but libc5 folk will use these */ 6/* User visible stuff. Glibc provides its own but libc5 folk will use these */
7 7
8struct ec_addr 8struct ec_addr {
9{
10 unsigned char station; /* Station number. */ 9 unsigned char station; /* Station number. */
11 unsigned char net; /* Network number. */ 10 unsigned char net; /* Network number. */
12}; 11};
13 12
14struct sockaddr_ec 13struct sockaddr_ec {
15{
16 unsigned short sec_family; 14 unsigned short sec_family;
17 unsigned char port; /* Port number. */ 15 unsigned char port; /* Port number. */
18 unsigned char cb; /* Control/flag byte. */ 16 unsigned char cb; /* Control/flag byte. */
@@ -37,8 +35,7 @@ struct sockaddr_ec
37#define EC_HLEN 6 35#define EC_HLEN 6
38 36
39/* This is what an Econet frame looks like on the wire. */ 37/* This is what an Econet frame looks like on the wire. */
40struct ec_framehdr 38struct ec_framehdr {
41{
42 unsigned char dst_stn; 39 unsigned char dst_stn;
43 unsigned char dst_net; 40 unsigned char dst_net;
44 unsigned char src_stn; 41 unsigned char src_stn;
@@ -62,8 +59,7 @@ static inline struct econet_sock *ec_sk(const struct sock *sk)
62 return (struct econet_sock *)sk; 59 return (struct econet_sock *)sk;
63} 60}
64 61
65struct ec_device 62struct ec_device {
66{
67 unsigned char station, net; /* Econet protocol address */ 63 unsigned char station, net; /* Econet protocol address */
68}; 64};
69 65
diff --git a/include/linux/if_ether.h b/include/linux/if_ether.h
index 580b6004d00e..005e1525ab86 100644
--- a/include/linux/if_ether.h
+++ b/include/linux/if_ether.h
@@ -136,10 +136,6 @@ extern struct ctl_table ether_table[];
136 136
137extern ssize_t sysfs_format_mac(char *buf, const unsigned char *addr, int len); 137extern ssize_t sysfs_format_mac(char *buf, const unsigned char *addr, int len);
138 138
139/*
140 * Display a 6 byte device address (MAC) in a readable format.
141 */
142extern char *print_mac(char *buf, const unsigned char *addr) __deprecated;
143#define MAC_FMT "%02x:%02x:%02x:%02x:%02x:%02x" 139#define MAC_FMT "%02x:%02x:%02x:%02x:%02x:%02x"
144#define MAC_BUF_SIZE 18 140#define MAC_BUF_SIZE 18
145#define DECLARE_MAC_BUF(var) char var[MAC_BUF_SIZE] 141#define DECLARE_MAC_BUF(var) char var[MAC_BUF_SIZE]
diff --git a/include/linux/if_fddi.h b/include/linux/if_fddi.h
index 45de1046dbbf..5459c5c09930 100644
--- a/include/linux/if_fddi.h
+++ b/include/linux/if_fddi.h
@@ -63,36 +63,32 @@
63#define FDDI_UI_CMD 0x03 63#define FDDI_UI_CMD 0x03
64 64
65/* Define 802.2 Type 1 header */ 65/* Define 802.2 Type 1 header */
66struct fddi_8022_1_hdr 66struct fddi_8022_1_hdr {
67 {
68 __u8 dsap; /* destination service access point */ 67 __u8 dsap; /* destination service access point */
69 __u8 ssap; /* source service access point */ 68 __u8 ssap; /* source service access point */
70 __u8 ctrl; /* control byte #1 */ 69 __u8 ctrl; /* control byte #1 */
71 } __attribute__ ((packed)); 70} __attribute__ ((packed));
72 71
73/* Define 802.2 Type 2 header */ 72/* Define 802.2 Type 2 header */
74struct fddi_8022_2_hdr 73struct fddi_8022_2_hdr {
75 {
76 __u8 dsap; /* destination service access point */ 74 __u8 dsap; /* destination service access point */
77 __u8 ssap; /* source service access point */ 75 __u8 ssap; /* source service access point */
78 __u8 ctrl_1; /* control byte #1 */ 76 __u8 ctrl_1; /* control byte #1 */
79 __u8 ctrl_2; /* control byte #2 */ 77 __u8 ctrl_2; /* control byte #2 */
80 } __attribute__ ((packed)); 78} __attribute__ ((packed));
81 79
82/* Define 802.2 SNAP header */ 80/* Define 802.2 SNAP header */
83#define FDDI_K_OUI_LEN 3 81#define FDDI_K_OUI_LEN 3
84struct fddi_snap_hdr 82struct fddi_snap_hdr {
85 {
86 __u8 dsap; /* always 0xAA */ 83 __u8 dsap; /* always 0xAA */
87 __u8 ssap; /* always 0xAA */ 84 __u8 ssap; /* always 0xAA */
88 __u8 ctrl; /* always 0x03 */ 85 __u8 ctrl; /* always 0x03 */
89 __u8 oui[FDDI_K_OUI_LEN]; /* organizational universal id */ 86 __u8 oui[FDDI_K_OUI_LEN]; /* organizational universal id */
90 __be16 ethertype; /* packet type ID field */ 87 __be16 ethertype; /* packet type ID field */
91 } __attribute__ ((packed)); 88} __attribute__ ((packed));
92 89
93/* Define FDDI LLC frame header */ 90/* Define FDDI LLC frame header */
94struct fddihdr 91struct fddihdr {
95 {
96 __u8 fc; /* frame control */ 92 __u8 fc; /* frame control */
97 __u8 daddr[FDDI_K_ALEN]; /* destination address */ 93 __u8 daddr[FDDI_K_ALEN]; /* destination address */
98 __u8 saddr[FDDI_K_ALEN]; /* source address */ 94 __u8 saddr[FDDI_K_ALEN]; /* source address */
@@ -102,7 +98,7 @@ struct fddihdr
102 struct fddi_8022_2_hdr llc_8022_2; 98 struct fddi_8022_2_hdr llc_8022_2;
103 struct fddi_snap_hdr llc_snap; 99 struct fddi_snap_hdr llc_snap;
104 } hdr; 100 } hdr;
105 } __attribute__ ((packed)); 101} __attribute__ ((packed));
106 102
107#ifdef __KERNEL__ 103#ifdef __KERNEL__
108#include <linux/netdevice.h> 104#include <linux/netdevice.h>
@@ -197,7 +193,7 @@ struct fddi_statistics {
197 __u32 port_pc_withhold[2]; 193 __u32 port_pc_withhold[2];
198 __u32 port_ler_flag[2]; 194 __u32 port_ler_flag[2];
199 __u32 port_hardware_present[2]; 195 __u32 port_hardware_present[2];
200 }; 196};
201#endif /* __KERNEL__ */ 197#endif /* __KERNEL__ */
202 198
203#endif /* _LINUX_IF_FDDI_H */ 199#endif /* _LINUX_IF_FDDI_H */
diff --git a/include/linux/if_hippi.h b/include/linux/if_hippi.h
index 4a7c9940b080..8d038eb8db5c 100644
--- a/include/linux/if_hippi.h
+++ b/include/linux/if_hippi.h
@@ -51,8 +51,7 @@
51 * HIPPI statistics collection data. 51 * HIPPI statistics collection data.
52 */ 52 */
53 53
54struct hipnet_statistics 54struct hipnet_statistics {
55{
56 int rx_packets; /* total packets received */ 55 int rx_packets; /* total packets received */
57 int tx_packets; /* total packets transmitted */ 56 int tx_packets; /* total packets transmitted */
58 int rx_errors; /* bad packets received */ 57 int rx_errors; /* bad packets received */
@@ -77,8 +76,7 @@ struct hipnet_statistics
77}; 76};
78 77
79 78
80struct hippi_fp_hdr 79struct hippi_fp_hdr {
81{
82#if 0 80#if 0
83 __u8 ulp; /* must contain 4 */ 81 __u8 ulp; /* must contain 4 */
84#if defined (__BIG_ENDIAN_BITFIELD) 82#if defined (__BIG_ENDIAN_BITFIELD)
@@ -108,8 +106,7 @@ struct hippi_fp_hdr
108 __be32 d2_size; 106 __be32 d2_size;
109} __attribute__ ((packed)); 107} __attribute__ ((packed));
110 108
111struct hippi_le_hdr 109struct hippi_le_hdr {
112{
113#if defined (__BIG_ENDIAN_BITFIELD) 110#if defined (__BIG_ENDIAN_BITFIELD)
114 __u8 fc:3; 111 __u8 fc:3;
115 __u8 double_wide:1; 112 __u8 double_wide:1;
@@ -139,8 +136,7 @@ struct hippi_le_hdr
139 * Looks like the dsap and ssap fields have been swapped by mistake in 136 * Looks like the dsap and ssap fields have been swapped by mistake in
140 * RFC 2067 "IP over HIPPI". 137 * RFC 2067 "IP over HIPPI".
141 */ 138 */
142struct hippi_snap_hdr 139struct hippi_snap_hdr {
143{
144 __u8 dsap; /* always 0xAA */ 140 __u8 dsap; /* always 0xAA */
145 __u8 ssap; /* always 0xAA */ 141 __u8 ssap; /* always 0xAA */
146 __u8 ctrl; /* always 0x03 */ 142 __u8 ctrl; /* always 0x03 */
@@ -148,8 +144,7 @@ struct hippi_snap_hdr
148 __be16 ethertype; /* packet type ID field */ 144 __be16 ethertype; /* packet type ID field */
149} __attribute__ ((packed)); 145} __attribute__ ((packed));
150 146
151struct hippi_hdr 147struct hippi_hdr {
152{
153 struct hippi_fp_hdr fp; 148 struct hippi_fp_hdr fp;
154 struct hippi_le_hdr le; 149 struct hippi_le_hdr le;
155 struct hippi_snap_hdr snap; 150 struct hippi_snap_hdr snap;
diff --git a/include/linux/if_link.h b/include/linux/if_link.h
index 176c5182c515..6674791622ca 100644
--- a/include/linux/if_link.h
+++ b/include/linux/if_link.h
@@ -5,8 +5,7 @@
5#include <linux/netlink.h> 5#include <linux/netlink.h>
6 6
7/* The struct should be in sync with struct net_device_stats */ 7/* The struct should be in sync with struct net_device_stats */
8struct rtnl_link_stats 8struct rtnl_link_stats {
9{
10 __u32 rx_packets; /* total packets received */ 9 __u32 rx_packets; /* total packets received */
11 __u32 tx_packets; /* total packets transmitted */ 10 __u32 tx_packets; /* total packets transmitted */
12 __u32 rx_bytes; /* total bytes received */ 11 __u32 rx_bytes; /* total bytes received */
@@ -39,8 +38,7 @@ struct rtnl_link_stats
39}; 38};
40 39
41/* The struct should be in sync with struct ifmap */ 40/* The struct should be in sync with struct ifmap */
42struct rtnl_link_ifmap 41struct rtnl_link_ifmap {
43{
44 __u64 mem_start; 42 __u64 mem_start;
45 __u64 mem_end; 43 __u64 mem_end;
46 __u64 base_addr; 44 __u64 base_addr;
@@ -49,8 +47,7 @@ struct rtnl_link_ifmap
49 __u8 port; 47 __u8 port;
50}; 48};
51 49
52enum 50enum {
53{
54 IFLA_UNSPEC, 51 IFLA_UNSPEC,
55 IFLA_ADDRESS, 52 IFLA_ADDRESS,
56 IFLA_BROADCAST, 53 IFLA_BROADCAST,
@@ -123,8 +120,7 @@ enum
123 */ 120 */
124 121
125/* Subtype attributes for IFLA_PROTINFO */ 122/* Subtype attributes for IFLA_PROTINFO */
126enum 123enum {
127{
128 IFLA_INET6_UNSPEC, 124 IFLA_INET6_UNSPEC,
129 IFLA_INET6_FLAGS, /* link flags */ 125 IFLA_INET6_FLAGS, /* link flags */
130 IFLA_INET6_CONF, /* sysctl parameters */ 126 IFLA_INET6_CONF, /* sysctl parameters */
@@ -137,16 +133,14 @@ enum
137 133
138#define IFLA_INET6_MAX (__IFLA_INET6_MAX - 1) 134#define IFLA_INET6_MAX (__IFLA_INET6_MAX - 1)
139 135
140struct ifla_cacheinfo 136struct ifla_cacheinfo {
141{
142 __u32 max_reasm_len; 137 __u32 max_reasm_len;
143 __u32 tstamp; /* ipv6InterfaceTable updated timestamp */ 138 __u32 tstamp; /* ipv6InterfaceTable updated timestamp */
144 __u32 reachable_time; 139 __u32 reachable_time;
145 __u32 retrans_time; 140 __u32 retrans_time;
146}; 141};
147 142
148enum 143enum {
149{
150 IFLA_INFO_UNSPEC, 144 IFLA_INFO_UNSPEC,
151 IFLA_INFO_KIND, 145 IFLA_INFO_KIND,
152 IFLA_INFO_DATA, 146 IFLA_INFO_DATA,
@@ -158,8 +152,7 @@ enum
158 152
159/* VLAN section */ 153/* VLAN section */
160 154
161enum 155enum {
162{
163 IFLA_VLAN_UNSPEC, 156 IFLA_VLAN_UNSPEC,
164 IFLA_VLAN_ID, 157 IFLA_VLAN_ID,
165 IFLA_VLAN_FLAGS, 158 IFLA_VLAN_FLAGS,
@@ -175,8 +168,7 @@ struct ifla_vlan_flags {
175 __u32 mask; 168 __u32 mask;
176}; 169};
177 170
178enum 171enum {
179{
180 IFLA_VLAN_QOS_UNSPEC, 172 IFLA_VLAN_QOS_UNSPEC,
181 IFLA_VLAN_QOS_MAPPING, 173 IFLA_VLAN_QOS_MAPPING,
182 __IFLA_VLAN_QOS_MAX 174 __IFLA_VLAN_QOS_MAX
@@ -184,10 +176,24 @@ enum
184 176
185#define IFLA_VLAN_QOS_MAX (__IFLA_VLAN_QOS_MAX - 1) 177#define IFLA_VLAN_QOS_MAX (__IFLA_VLAN_QOS_MAX - 1)
186 178
187struct ifla_vlan_qos_mapping 179struct ifla_vlan_qos_mapping {
188{
189 __u32 from; 180 __u32 from;
190 __u32 to; 181 __u32 to;
191}; 182};
192 183
184/* MACVLAN section */
185enum {
186 IFLA_MACVLAN_UNSPEC,
187 IFLA_MACVLAN_MODE,
188 __IFLA_MACVLAN_MAX,
189};
190
191#define IFLA_MACVLAN_MAX (__IFLA_MACVLAN_MAX - 1)
192
193enum macvlan_mode {
194 MACVLAN_MODE_PRIVATE = 1, /* don't talk to other macvlans */
195 MACVLAN_MODE_VEPA = 2, /* talk to other ports through ext bridge */
196 MACVLAN_MODE_BRIDGE = 4, /* talk to bridge ports directly */
197};
198
193#endif /* _LINUX_IF_LINK_H */ 199#endif /* _LINUX_IF_LINK_H */
diff --git a/include/linux/if_packet.h b/include/linux/if_packet.h
index dea7d6b7cf98..4021d47cc437 100644
--- a/include/linux/if_packet.h
+++ b/include/linux/if_packet.h
@@ -3,15 +3,13 @@
3 3
4#include <linux/types.h> 4#include <linux/types.h>
5 5
6struct sockaddr_pkt 6struct sockaddr_pkt {
7{
8 unsigned short spkt_family; 7 unsigned short spkt_family;
9 unsigned char spkt_device[14]; 8 unsigned char spkt_device[14];
10 __be16 spkt_protocol; 9 __be16 spkt_protocol;
11}; 10};
12 11
13struct sockaddr_ll 12struct sockaddr_ll {
14{
15 unsigned short sll_family; 13 unsigned short sll_family;
16 __be16 sll_protocol; 14 __be16 sll_protocol;
17 int sll_ifindex; 15 int sll_ifindex;
@@ -49,14 +47,12 @@ struct sockaddr_ll
49#define PACKET_TX_RING 13 47#define PACKET_TX_RING 13
50#define PACKET_LOSS 14 48#define PACKET_LOSS 14
51 49
52struct tpacket_stats 50struct tpacket_stats {
53{
54 unsigned int tp_packets; 51 unsigned int tp_packets;
55 unsigned int tp_drops; 52 unsigned int tp_drops;
56}; 53};
57 54
58struct tpacket_auxdata 55struct tpacket_auxdata {
59{
60 __u32 tp_status; 56 __u32 tp_status;
61 __u32 tp_len; 57 __u32 tp_len;
62 __u32 tp_snaplen; 58 __u32 tp_snaplen;
@@ -78,8 +74,7 @@ struct tpacket_auxdata
78#define TP_STATUS_SENDING 0x2 74#define TP_STATUS_SENDING 0x2
79#define TP_STATUS_WRONG_FORMAT 0x4 75#define TP_STATUS_WRONG_FORMAT 0x4
80 76
81struct tpacket_hdr 77struct tpacket_hdr {
82{
83 unsigned long tp_status; 78 unsigned long tp_status;
84 unsigned int tp_len; 79 unsigned int tp_len;
85 unsigned int tp_snaplen; 80 unsigned int tp_snaplen;
@@ -93,8 +88,7 @@ struct tpacket_hdr
93#define TPACKET_ALIGN(x) (((x)+TPACKET_ALIGNMENT-1)&~(TPACKET_ALIGNMENT-1)) 88#define TPACKET_ALIGN(x) (((x)+TPACKET_ALIGNMENT-1)&~(TPACKET_ALIGNMENT-1))
94#define TPACKET_HDRLEN (TPACKET_ALIGN(sizeof(struct tpacket_hdr)) + sizeof(struct sockaddr_ll)) 89#define TPACKET_HDRLEN (TPACKET_ALIGN(sizeof(struct tpacket_hdr)) + sizeof(struct sockaddr_ll))
95 90
96struct tpacket2_hdr 91struct tpacket2_hdr {
97{
98 __u32 tp_status; 92 __u32 tp_status;
99 __u32 tp_len; 93 __u32 tp_len;
100 __u32 tp_snaplen; 94 __u32 tp_snaplen;
@@ -107,8 +101,7 @@ struct tpacket2_hdr
107 101
108#define TPACKET2_HDRLEN (TPACKET_ALIGN(sizeof(struct tpacket2_hdr)) + sizeof(struct sockaddr_ll)) 102#define TPACKET2_HDRLEN (TPACKET_ALIGN(sizeof(struct tpacket2_hdr)) + sizeof(struct sockaddr_ll))
109 103
110enum tpacket_versions 104enum tpacket_versions {
111{
112 TPACKET_V1, 105 TPACKET_V1,
113 TPACKET_V2, 106 TPACKET_V2,
114}; 107};
@@ -126,16 +119,14 @@ enum tpacket_versions
126 - Pad to align to TPACKET_ALIGNMENT=16 119 - Pad to align to TPACKET_ALIGNMENT=16
127 */ 120 */
128 121
129struct tpacket_req 122struct tpacket_req {
130{
131 unsigned int tp_block_size; /* Minimal size of contiguous block */ 123 unsigned int tp_block_size; /* Minimal size of contiguous block */
132 unsigned int tp_block_nr; /* Number of blocks */ 124 unsigned int tp_block_nr; /* Number of blocks */
133 unsigned int tp_frame_size; /* Size of frame */ 125 unsigned int tp_frame_size; /* Size of frame */
134 unsigned int tp_frame_nr; /* Total number of frames */ 126 unsigned int tp_frame_nr; /* Total number of frames */
135}; 127};
136 128
137struct packet_mreq 129struct packet_mreq {
138{
139 int mr_ifindex; 130 int mr_ifindex;
140 unsigned short mr_type; 131 unsigned short mr_type;
141 unsigned short mr_alen; 132 unsigned short mr_alen;
diff --git a/include/linux/if_plip.h b/include/linux/if_plip.h
index 153a649915a2..6298c7e88b2b 100644
--- a/include/linux/if_plip.h
+++ b/include/linux/if_plip.h
@@ -15,8 +15,7 @@
15 15
16#define SIOCDEVPLIP SIOCDEVPRIVATE 16#define SIOCDEVPLIP SIOCDEVPRIVATE
17 17
18struct plipconf 18struct plipconf {
19{
20 unsigned short pcmd; 19 unsigned short pcmd;
21 unsigned long nibble; 20 unsigned long nibble;
22 unsigned long trigger; 21 unsigned long trigger;
diff --git a/include/linux/if_pppol2tp.h b/include/linux/if_pppol2tp.h
index 3a14b088c8ec..c58baea4a25b 100644
--- a/include/linux/if_pppol2tp.h
+++ b/include/linux/if_pppol2tp.h
@@ -24,8 +24,7 @@
24/* Structure used to connect() the socket to a particular tunnel UDP 24/* Structure used to connect() the socket to a particular tunnel UDP
25 * socket. 25 * socket.
26 */ 26 */
27struct pppol2tp_addr 27struct pppol2tp_addr {
28{
29 __kernel_pid_t pid; /* pid that owns the fd. 28 __kernel_pid_t pid; /* pid that owns the fd.
30 * 0 => current */ 29 * 0 => current */
31 int fd; /* FD of UDP socket to use */ 30 int fd; /* FD of UDP socket to use */
diff --git a/include/linux/if_tunnel.h b/include/linux/if_tunnel.h
index 5a9aae4adb44..1822d635be6b 100644
--- a/include/linux/if_tunnel.h
+++ b/include/linux/if_tunnel.h
@@ -5,6 +5,7 @@
5 5
6#ifdef __KERNEL__ 6#ifdef __KERNEL__
7#include <linux/ip.h> 7#include <linux/ip.h>
8#include <linux/in6.h>
8#endif 9#endif
9 10
10#define SIOCGETTUNNEL (SIOCDEVPRIVATE + 0) 11#define SIOCGETTUNNEL (SIOCDEVPRIVATE + 0)
@@ -15,6 +16,10 @@
15#define SIOCADDPRL (SIOCDEVPRIVATE + 5) 16#define SIOCADDPRL (SIOCDEVPRIVATE + 5)
16#define SIOCDELPRL (SIOCDEVPRIVATE + 6) 17#define SIOCDELPRL (SIOCDEVPRIVATE + 6)
17#define SIOCCHGPRL (SIOCDEVPRIVATE + 7) 18#define SIOCCHGPRL (SIOCDEVPRIVATE + 7)
19#define SIOCGET6RD (SIOCDEVPRIVATE + 8)
20#define SIOCADD6RD (SIOCDEVPRIVATE + 9)
21#define SIOCDEL6RD (SIOCDEVPRIVATE + 10)
22#define SIOCCHG6RD (SIOCDEVPRIVATE + 11)
18 23
19#define GRE_CSUM __cpu_to_be16(0x8000) 24#define GRE_CSUM __cpu_to_be16(0x8000)
20#define GRE_ROUTING __cpu_to_be16(0x4000) 25#define GRE_ROUTING __cpu_to_be16(0x4000)
@@ -25,8 +30,7 @@
25#define GRE_FLAGS __cpu_to_be16(0x00F8) 30#define GRE_FLAGS __cpu_to_be16(0x00F8)
26#define GRE_VERSION __cpu_to_be16(0x0007) 31#define GRE_VERSION __cpu_to_be16(0x0007)
27 32
28struct ip_tunnel_parm 33struct ip_tunnel_parm {
29{
30 char name[IFNAMSIZ]; 34 char name[IFNAMSIZ];
31 int link; 35 int link;
32 __be16 i_flags; 36 __be16 i_flags;
@@ -51,8 +55,14 @@ struct ip_tunnel_prl {
51/* PRL flags */ 55/* PRL flags */
52#define PRL_DEFAULT 0x0001 56#define PRL_DEFAULT 0x0001
53 57
54enum 58struct ip_tunnel_6rd {
55{ 59 struct in6_addr prefix;
60 __be32 relay_prefix;
61 __u16 prefixlen;
62 __u16 relay_prefixlen;
63};
64
65enum {
56 IFLA_GRE_UNSPEC, 66 IFLA_GRE_UNSPEC,
57 IFLA_GRE_LINK, 67 IFLA_GRE_LINK,
58 IFLA_GRE_IFLAGS, 68 IFLA_GRE_IFLAGS,
diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h
index 7ff9af1d0f05..3d870fda8c4f 100644
--- a/include/linux/if_vlan.h
+++ b/include/linux/if_vlan.h
@@ -63,7 +63,11 @@ static inline struct vlan_ethhdr *vlan_eth_hdr(const struct sk_buff *skb)
63 return (struct vlan_ethhdr *)skb_mac_header(skb); 63 return (struct vlan_ethhdr *)skb_mac_header(skb);
64} 64}
65 65
66#define VLAN_VID_MASK 0xfff 66#define VLAN_PRIO_MASK 0xe000 /* Priority Code Point */
67#define VLAN_PRIO_SHIFT 13
68#define VLAN_CFI_MASK 0x1000 /* Canonical Format Indicator */
69#define VLAN_TAG_PRESENT VLAN_CFI_MASK
70#define VLAN_VID_MASK 0x0fff /* VLAN Identifier */
67 71
68/* found in socket.c */ 72/* found in socket.c */
69extern void vlan_ioctl_set(int (*hook)(struct net *, void __user *)); 73extern void vlan_ioctl_set(int (*hook)(struct net *, void __user *));
@@ -81,6 +85,7 @@ struct vlan_group {
81 * the vlan is attached to. 85 * the vlan is attached to.
82 */ 86 */
83 unsigned int nr_vlans; 87 unsigned int nr_vlans;
88 int killall;
84 struct hlist_node hlist; /* linked list */ 89 struct hlist_node hlist; /* linked list */
85 struct net_device **vlan_devices_arrays[VLAN_GROUP_ARRAY_SPLIT_PARTS]; 90 struct net_device **vlan_devices_arrays[VLAN_GROUP_ARRAY_SPLIT_PARTS];
86 struct rcu_head rcu; 91 struct rcu_head rcu;
@@ -105,8 +110,8 @@ static inline void vlan_group_set_device(struct vlan_group *vg,
105 array[vlan_id % VLAN_GROUP_ARRAY_PART_LEN] = dev; 110 array[vlan_id % VLAN_GROUP_ARRAY_PART_LEN] = dev;
106} 111}
107 112
108#define vlan_tx_tag_present(__skb) ((__skb)->vlan_tci) 113#define vlan_tx_tag_present(__skb) ((__skb)->vlan_tci & VLAN_TAG_PRESENT)
109#define vlan_tx_tag_get(__skb) ((__skb)->vlan_tci) 114#define vlan_tx_tag_get(__skb) ((__skb)->vlan_tci & ~VLAN_TAG_PRESENT)
110 115
111#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE) 116#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE)
112extern struct net_device *vlan_dev_real_dev(const struct net_device *dev); 117extern struct net_device *vlan_dev_real_dev(const struct net_device *dev);
@@ -115,10 +120,12 @@ extern u16 vlan_dev_vlan_id(const struct net_device *dev);
115extern int __vlan_hwaccel_rx(struct sk_buff *skb, struct vlan_group *grp, 120extern int __vlan_hwaccel_rx(struct sk_buff *skb, struct vlan_group *grp,
116 u16 vlan_tci, int polling); 121 u16 vlan_tci, int polling);
117extern int vlan_hwaccel_do_receive(struct sk_buff *skb); 122extern int vlan_hwaccel_do_receive(struct sk_buff *skb);
118extern int vlan_gro_receive(struct napi_struct *napi, struct vlan_group *grp, 123extern gro_result_t
119 unsigned int vlan_tci, struct sk_buff *skb); 124vlan_gro_receive(struct napi_struct *napi, struct vlan_group *grp,
120extern int vlan_gro_frags(struct napi_struct *napi, struct vlan_group *grp, 125 unsigned int vlan_tci, struct sk_buff *skb);
121 unsigned int vlan_tci); 126extern gro_result_t
127vlan_gro_frags(struct napi_struct *napi, struct vlan_group *grp,
128 unsigned int vlan_tci);
122 129
123#else 130#else
124static inline struct net_device *vlan_dev_real_dev(const struct net_device *dev) 131static inline struct net_device *vlan_dev_real_dev(const struct net_device *dev)
@@ -145,17 +152,18 @@ static inline int vlan_hwaccel_do_receive(struct sk_buff *skb)
145 return 0; 152 return 0;
146} 153}
147 154
148static inline int vlan_gro_receive(struct napi_struct *napi, 155static inline gro_result_t
149 struct vlan_group *grp, 156vlan_gro_receive(struct napi_struct *napi, struct vlan_group *grp,
150 unsigned int vlan_tci, struct sk_buff *skb) 157 unsigned int vlan_tci, struct sk_buff *skb)
151{ 158{
152 return NET_RX_DROP; 159 return GRO_DROP;
153} 160}
154 161
155static inline int vlan_gro_frags(struct napi_struct *napi, 162static inline gro_result_t
156 struct vlan_group *grp, unsigned int vlan_tci) 163vlan_gro_frags(struct napi_struct *napi, struct vlan_group *grp,
164 unsigned int vlan_tci)
157{ 165{
158 return NET_RX_DROP; 166 return GRO_DROP;
159} 167}
160#endif 168#endif
161 169
@@ -231,7 +239,7 @@ static inline struct sk_buff *__vlan_put_tag(struct sk_buff *skb, u16 vlan_tci)
231static inline struct sk_buff *__vlan_hwaccel_put_tag(struct sk_buff *skb, 239static inline struct sk_buff *__vlan_hwaccel_put_tag(struct sk_buff *skb,
232 u16 vlan_tci) 240 u16 vlan_tci)
233{ 241{
234 skb->vlan_tci = vlan_tci; 242 skb->vlan_tci = VLAN_TAG_PRESENT | vlan_tci;
235 return skb; 243 return skb;
236} 244}
237 245
@@ -284,7 +292,7 @@ static inline int __vlan_hwaccel_get_tag(const struct sk_buff *skb,
284 u16 *vlan_tci) 292 u16 *vlan_tci)
285{ 293{
286 if (vlan_tx_tag_present(skb)) { 294 if (vlan_tx_tag_present(skb)) {
287 *vlan_tci = skb->vlan_tci; 295 *vlan_tci = vlan_tx_tag_get(skb);
288 return 0; 296 return 0;
289 } else { 297 } else {
290 *vlan_tci = 0; 298 *vlan_tci = 0;
@@ -331,6 +339,7 @@ enum vlan_ioctl_cmds {
331enum vlan_flags { 339enum vlan_flags {
332 VLAN_FLAG_REORDER_HDR = 0x1, 340 VLAN_FLAG_REORDER_HDR = 0x1,
333 VLAN_FLAG_GVRP = 0x2, 341 VLAN_FLAG_GVRP = 0x2,
342 VLAN_FLAG_LOOSE_BINDING = 0x4,
334}; 343};
335 344
336enum vlan_name_types { 345enum vlan_name_types {
diff --git a/include/linux/igmp.h b/include/linux/igmp.h
index fe158e0e20e6..724c27e5d173 100644
--- a/include/linux/igmp.h
+++ b/include/linux/igmp.h
@@ -27,8 +27,7 @@
27 * Header in on cable format 27 * Header in on cable format
28 */ 28 */
29 29
30struct igmphdr 30struct igmphdr {
31{
32 __u8 type; 31 __u8 type;
33 __u8 code; /* For newer IGMP */ 32 __u8 code; /* For newer IGMP */
34 __sum16 csum; 33 __sum16 csum;
@@ -151,8 +150,7 @@ static inline struct igmpv3_query *
151extern int sysctl_igmp_max_memberships; 150extern int sysctl_igmp_max_memberships;
152extern int sysctl_igmp_max_msf; 151extern int sysctl_igmp_max_msf;
153 152
154struct ip_sf_socklist 153struct ip_sf_socklist {
155{
156 unsigned int sl_max; 154 unsigned int sl_max;
157 unsigned int sl_count; 155 unsigned int sl_count;
158 __be32 sl_addr[0]; 156 __be32 sl_addr[0];
@@ -167,16 +165,14 @@ struct ip_sf_socklist
167 this list never used in fast path code 165 this list never used in fast path code
168 */ 166 */
169 167
170struct ip_mc_socklist 168struct ip_mc_socklist {
171{
172 struct ip_mc_socklist *next; 169 struct ip_mc_socklist *next;
173 struct ip_mreqn multi; 170 struct ip_mreqn multi;
174 unsigned int sfmode; /* MCAST_{INCLUDE,EXCLUDE} */ 171 unsigned int sfmode; /* MCAST_{INCLUDE,EXCLUDE} */
175 struct ip_sf_socklist *sflist; 172 struct ip_sf_socklist *sflist;
176}; 173};
177 174
178struct ip_sf_list 175struct ip_sf_list {
179{
180 struct ip_sf_list *sf_next; 176 struct ip_sf_list *sf_next;
181 __be32 sf_inaddr; 177 __be32 sf_inaddr;
182 unsigned long sf_count[2]; /* include/exclude counts */ 178 unsigned long sf_count[2]; /* include/exclude counts */
@@ -185,8 +181,7 @@ struct ip_sf_list
185 unsigned char sf_crcount; /* retrans. left to send */ 181 unsigned char sf_crcount; /* retrans. left to send */
186}; 182};
187 183
188struct ip_mc_list 184struct ip_mc_list {
189{
190 struct in_device *interface; 185 struct in_device *interface;
191 __be32 multiaddr; 186 __be32 multiaddr;
192 struct ip_sf_list *sources; 187 struct ip_sf_list *sources;
diff --git a/include/linux/in.h b/include/linux/in.h
index cf196da04ec9..b615649db129 100644
--- a/include/linux/in.h
+++ b/include/linux/in.h
@@ -118,14 +118,12 @@ struct in_addr {
118 118
119/* Request struct for multicast socket ops */ 119/* Request struct for multicast socket ops */
120 120
121struct ip_mreq 121struct ip_mreq {
122{
123 struct in_addr imr_multiaddr; /* IP multicast address of group */ 122 struct in_addr imr_multiaddr; /* IP multicast address of group */
124 struct in_addr imr_interface; /* local IP address of interface */ 123 struct in_addr imr_interface; /* local IP address of interface */
125}; 124};
126 125
127struct ip_mreqn 126struct ip_mreqn {
128{
129 struct in_addr imr_multiaddr; /* IP multicast address of group */ 127 struct in_addr imr_multiaddr; /* IP multicast address of group */
130 struct in_addr imr_address; /* local IP address of interface */ 128 struct in_addr imr_address; /* local IP address of interface */
131 int imr_ifindex; /* Interface index */ 129 int imr_ifindex; /* Interface index */
@@ -149,21 +147,18 @@ struct ip_msfilter {
149 (sizeof(struct ip_msfilter) - sizeof(__u32) \ 147 (sizeof(struct ip_msfilter) - sizeof(__u32) \
150 + (numsrc) * sizeof(__u32)) 148 + (numsrc) * sizeof(__u32))
151 149
152struct group_req 150struct group_req {
153{
154 __u32 gr_interface; /* interface index */ 151 __u32 gr_interface; /* interface index */
155 struct __kernel_sockaddr_storage gr_group; /* group address */ 152 struct __kernel_sockaddr_storage gr_group; /* group address */
156}; 153};
157 154
158struct group_source_req 155struct group_source_req {
159{
160 __u32 gsr_interface; /* interface index */ 156 __u32 gsr_interface; /* interface index */
161 struct __kernel_sockaddr_storage gsr_group; /* group address */ 157 struct __kernel_sockaddr_storage gsr_group; /* group address */
162 struct __kernel_sockaddr_storage gsr_source; /* source address */ 158 struct __kernel_sockaddr_storage gsr_source; /* source address */
163}; 159};
164 160
165struct group_filter 161struct group_filter {
166{
167 __u32 gf_interface; /* interface index */ 162 __u32 gf_interface; /* interface index */
168 struct __kernel_sockaddr_storage gf_group; /* multicast address */ 163 struct __kernel_sockaddr_storage gf_group; /* multicast address */
169 __u32 gf_fmode; /* filter mode */ 164 __u32 gf_fmode; /* filter mode */
@@ -175,8 +170,7 @@ struct group_filter
175 (sizeof(struct group_filter) - sizeof(struct __kernel_sockaddr_storage) \ 170 (sizeof(struct group_filter) - sizeof(struct __kernel_sockaddr_storage) \
176 + (numsrc) * sizeof(struct __kernel_sockaddr_storage)) 171 + (numsrc) * sizeof(struct __kernel_sockaddr_storage))
177 172
178struct in_pktinfo 173struct in_pktinfo {
179{
180 int ipi_ifindex; 174 int ipi_ifindex;
181 struct in_addr ipi_spec_dst; 175 struct in_addr ipi_spec_dst;
182 struct in_addr ipi_addr; 176 struct in_addr ipi_addr;
diff --git a/include/linux/in6.h b/include/linux/in6.h
index 718bf21c5754..dfa29168e6ab 100644
--- a/include/linux/in6.h
+++ b/include/linux/in6.h
@@ -27,10 +27,8 @@
27 * IPv6 address structure 27 * IPv6 address structure
28 */ 28 */
29 29
30struct in6_addr 30struct in6_addr {
31{ 31 union {
32 union
33 {
34 __u8 u6_addr8[16]; 32 __u8 u6_addr8[16];
35 __be16 u6_addr16[8]; 33 __be16 u6_addr16[8];
36 __be32 u6_addr32[4]; 34 __be32 u6_addr32[4];
@@ -75,8 +73,7 @@ struct ipv6_mreq {
75 73
76#define ipv6mr_acaddr ipv6mr_multiaddr 74#define ipv6mr_acaddr ipv6mr_multiaddr
77 75
78struct in6_flowlabel_req 76struct in6_flowlabel_req {
79{
80 struct in6_addr flr_dst; 77 struct in6_addr flr_dst;
81 __be32 flr_label; 78 __be32 flr_label;
82 __u8 flr_action; 79 __u8 flr_action;
diff --git a/include/linux/inetdevice.h b/include/linux/inetdevice.h
index ad27c7da8798..699e85c01a4d 100644
--- a/include/linux/inetdevice.h
+++ b/include/linux/inetdevice.h
@@ -10,15 +10,13 @@
10#include <linux/timer.h> 10#include <linux/timer.h>
11#include <linux/sysctl.h> 11#include <linux/sysctl.h>
12 12
13struct ipv4_devconf 13struct ipv4_devconf {
14{
15 void *sysctl; 14 void *sysctl;
16 int data[__NET_IPV4_CONF_MAX - 1]; 15 int data[__NET_IPV4_CONF_MAX - 1];
17 DECLARE_BITMAP(state, __NET_IPV4_CONF_MAX - 1); 16 DECLARE_BITMAP(state, __NET_IPV4_CONF_MAX - 1);
18}; 17};
19 18
20struct in_device 19struct in_device {
21{
22 struct net_device *dev; 20 struct net_device *dev;
23 atomic_t refcnt; 21 atomic_t refcnt;
24 int dead; 22 int dead;
@@ -85,6 +83,7 @@ static inline void ipv4_devconf_setall(struct in_device *in_dev)
85#define IN_DEV_RPFILTER(in_dev) IN_DEV_MAXCONF((in_dev), RP_FILTER) 83#define IN_DEV_RPFILTER(in_dev) IN_DEV_MAXCONF((in_dev), RP_FILTER)
86#define IN_DEV_SOURCE_ROUTE(in_dev) IN_DEV_ANDCONF((in_dev), \ 84#define IN_DEV_SOURCE_ROUTE(in_dev) IN_DEV_ANDCONF((in_dev), \
87 ACCEPT_SOURCE_ROUTE) 85 ACCEPT_SOURCE_ROUTE)
86#define IN_DEV_ACCEPT_LOCAL(in_dev) IN_DEV_ORCONF((in_dev), ACCEPT_LOCAL)
88#define IN_DEV_BOOTP_RELAY(in_dev) IN_DEV_ANDCONF((in_dev), BOOTP_RELAY) 87#define IN_DEV_BOOTP_RELAY(in_dev) IN_DEV_ANDCONF((in_dev), BOOTP_RELAY)
89 88
90#define IN_DEV_LOG_MARTIANS(in_dev) IN_DEV_ORCONF((in_dev), LOG_MARTIANS) 89#define IN_DEV_LOG_MARTIANS(in_dev) IN_DEV_ORCONF((in_dev), LOG_MARTIANS)
@@ -110,8 +109,7 @@ static inline void ipv4_devconf_setall(struct in_device *in_dev)
110#define IN_DEV_ARP_IGNORE(in_dev) IN_DEV_MAXCONF((in_dev), ARP_IGNORE) 109#define IN_DEV_ARP_IGNORE(in_dev) IN_DEV_MAXCONF((in_dev), ARP_IGNORE)
111#define IN_DEV_ARP_NOTIFY(in_dev) IN_DEV_MAXCONF((in_dev), ARP_NOTIFY) 110#define IN_DEV_ARP_NOTIFY(in_dev) IN_DEV_MAXCONF((in_dev), ARP_NOTIFY)
112 111
113struct in_ifaddr 112struct in_ifaddr {
114{
115 struct in_ifaddr *ifa_next; 113 struct in_ifaddr *ifa_next;
116 struct in_device *ifa_dev; 114 struct in_device *ifa_dev;
117 struct rcu_head rcu_head; 115 struct rcu_head rcu_head;
diff --git a/include/linux/ip_vs.h b/include/linux/ip_vs.h
index 148265e63e8d..dfc170362842 100644
--- a/include/linux/ip_vs.h
+++ b/include/linux/ip_vs.h
@@ -127,8 +127,7 @@ struct ip_vs_dest_user {
127/* 127/*
128 * IPVS statistics object (for user space) 128 * IPVS statistics object (for user space)
129 */ 129 */
130struct ip_vs_stats_user 130struct ip_vs_stats_user {
131{
132 __u32 conns; /* connections scheduled */ 131 __u32 conns; /* connections scheduled */
133 __u32 inpkts; /* incoming packets */ 132 __u32 inpkts; /* incoming packets */
134 __u32 outpkts; /* outgoing packets */ 133 __u32 outpkts; /* outgoing packets */
diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h
index c662efa68289..e0cc9a7db2b5 100644
--- a/include/linux/ipv6.h
+++ b/include/linux/ipv6.h
@@ -167,6 +167,7 @@ struct ipv6_devconf {
167#endif 167#endif
168 __s32 disable_ipv6; 168 __s32 disable_ipv6;
169 __s32 accept_dad; 169 __s32 accept_dad;
170 __s32 force_tllao;
170 void *sysctl; 171 void *sysctl;
171}; 172};
172 173
@@ -207,6 +208,7 @@ enum {
207 DEVCONF_MC_FORWARDING, 208 DEVCONF_MC_FORWARDING,
208 DEVCONF_DISABLE_IPV6, 209 DEVCONF_DISABLE_IPV6,
209 DEVCONF_ACCEPT_DAD, 210 DEVCONF_ACCEPT_DAD,
211 DEVCONF_FORCE_TLLAO,
210 DEVCONF_MAX 212 DEVCONF_MAX
211}; 213};
212 214
@@ -503,7 +505,7 @@ static inline struct raw6_sock *raw6_sk(const struct sock *sk)
503 505
504#define INET6_MATCH(__sk, __net, __hash, __saddr, __daddr, __ports, __dif)\ 506#define INET6_MATCH(__sk, __net, __hash, __saddr, __daddr, __ports, __dif)\
505 (((__sk)->sk_hash == (__hash)) && sock_net((__sk)) == (__net) && \ 507 (((__sk)->sk_hash == (__hash)) && sock_net((__sk)) == (__net) && \
506 ((*((__portpair *)&(inet_sk(__sk)->dport))) == (__ports)) && \ 508 ((*((__portpair *)&(inet_sk(__sk)->inet_dport))) == (__ports)) && \
507 ((__sk)->sk_family == AF_INET6) && \ 509 ((__sk)->sk_family == AF_INET6) && \
508 ipv6_addr_equal(&inet6_sk(__sk)->daddr, (__saddr)) && \ 510 ipv6_addr_equal(&inet6_sk(__sk)->daddr, (__saddr)) && \
509 ipv6_addr_equal(&inet6_sk(__sk)->rcv_saddr, (__daddr)) && \ 511 ipv6_addr_equal(&inet6_sk(__sk)->rcv_saddr, (__daddr)) && \
diff --git a/include/linux/kvm.h b/include/linux/kvm.h
index f8f8900fc5ec..2d241da07236 100644
--- a/include/linux/kvm.h
+++ b/include/linux/kvm.h
@@ -14,12 +14,76 @@
14 14
15#define KVM_API_VERSION 12 15#define KVM_API_VERSION 12
16 16
17/* for KVM_TRACE_ENABLE, deprecated */ 17/* *** Deprecated interfaces *** */
18
19#define KVM_TRC_SHIFT 16
20
21#define KVM_TRC_ENTRYEXIT (1 << KVM_TRC_SHIFT)
22#define KVM_TRC_HANDLER (1 << (KVM_TRC_SHIFT + 1))
23
24#define KVM_TRC_VMENTRY (KVM_TRC_ENTRYEXIT + 0x01)
25#define KVM_TRC_VMEXIT (KVM_TRC_ENTRYEXIT + 0x02)
26#define KVM_TRC_PAGE_FAULT (KVM_TRC_HANDLER + 0x01)
27
28#define KVM_TRC_HEAD_SIZE 12
29#define KVM_TRC_CYCLE_SIZE 8
30#define KVM_TRC_EXTRA_MAX 7
31
32#define KVM_TRC_INJ_VIRQ (KVM_TRC_HANDLER + 0x02)
33#define KVM_TRC_REDELIVER_EVT (KVM_TRC_HANDLER + 0x03)
34#define KVM_TRC_PEND_INTR (KVM_TRC_HANDLER + 0x04)
35#define KVM_TRC_IO_READ (KVM_TRC_HANDLER + 0x05)
36#define KVM_TRC_IO_WRITE (KVM_TRC_HANDLER + 0x06)
37#define KVM_TRC_CR_READ (KVM_TRC_HANDLER + 0x07)
38#define KVM_TRC_CR_WRITE (KVM_TRC_HANDLER + 0x08)
39#define KVM_TRC_DR_READ (KVM_TRC_HANDLER + 0x09)
40#define KVM_TRC_DR_WRITE (KVM_TRC_HANDLER + 0x0A)
41#define KVM_TRC_MSR_READ (KVM_TRC_HANDLER + 0x0B)
42#define KVM_TRC_MSR_WRITE (KVM_TRC_HANDLER + 0x0C)
43#define KVM_TRC_CPUID (KVM_TRC_HANDLER + 0x0D)
44#define KVM_TRC_INTR (KVM_TRC_HANDLER + 0x0E)
45#define KVM_TRC_NMI (KVM_TRC_HANDLER + 0x0F)
46#define KVM_TRC_VMMCALL (KVM_TRC_HANDLER + 0x10)
47#define KVM_TRC_HLT (KVM_TRC_HANDLER + 0x11)
48#define KVM_TRC_CLTS (KVM_TRC_HANDLER + 0x12)
49#define KVM_TRC_LMSW (KVM_TRC_HANDLER + 0x13)
50#define KVM_TRC_APIC_ACCESS (KVM_TRC_HANDLER + 0x14)
51#define KVM_TRC_TDP_FAULT (KVM_TRC_HANDLER + 0x15)
52#define KVM_TRC_GTLB_WRITE (KVM_TRC_HANDLER + 0x16)
53#define KVM_TRC_STLB_WRITE (KVM_TRC_HANDLER + 0x17)
54#define KVM_TRC_STLB_INVAL (KVM_TRC_HANDLER + 0x18)
55#define KVM_TRC_PPC_INSTR (KVM_TRC_HANDLER + 0x19)
56
18struct kvm_user_trace_setup { 57struct kvm_user_trace_setup {
19 __u32 buf_size; /* sub_buffer size of each per-cpu */ 58 __u32 buf_size;
20 __u32 buf_nr; /* the number of sub_buffers of each per-cpu */ 59 __u32 buf_nr;
60};
61
62#define __KVM_DEPRECATED_MAIN_W_0x06 \
63 _IOW(KVMIO, 0x06, struct kvm_user_trace_setup)
64#define __KVM_DEPRECATED_MAIN_0x07 _IO(KVMIO, 0x07)
65#define __KVM_DEPRECATED_MAIN_0x08 _IO(KVMIO, 0x08)
66
67#define __KVM_DEPRECATED_VM_R_0x70 _IOR(KVMIO, 0x70, struct kvm_assigned_irq)
68
69struct kvm_breakpoint {
70 __u32 enabled;
71 __u32 padding;
72 __u64 address;
73};
74
75struct kvm_debug_guest {
76 __u32 enabled;
77 __u32 pad;
78 struct kvm_breakpoint breakpoints[4];
79 __u32 singlestep;
21}; 80};
22 81
82#define __KVM_DEPRECATED_VCPU_W_0x87 _IOW(KVMIO, 0x87, struct kvm_debug_guest)
83
84/* *** End of deprecated interfaces *** */
85
86
23/* for KVM_CREATE_MEMORY_REGION */ 87/* for KVM_CREATE_MEMORY_REGION */
24struct kvm_memory_region { 88struct kvm_memory_region {
25 __u32 slot; 89 __u32 slot;
@@ -99,6 +163,7 @@ struct kvm_pit_config {
99 163
100/* For KVM_EXIT_INTERNAL_ERROR */ 164/* For KVM_EXIT_INTERNAL_ERROR */
101#define KVM_INTERNAL_ERROR_EMULATION 1 165#define KVM_INTERNAL_ERROR_EMULATION 1
166#define KVM_INTERNAL_ERROR_SIMUL_EX 2
102 167
103/* for KVM_RUN, returned by mmap(vcpu_fd, offset=0) */ 168/* for KVM_RUN, returned by mmap(vcpu_fd, offset=0) */
104struct kvm_run { 169struct kvm_run {
@@ -116,6 +181,11 @@ struct kvm_run {
116 __u64 cr8; 181 __u64 cr8;
117 __u64 apic_base; 182 __u64 apic_base;
118 183
184#ifdef __KVM_S390
185 /* the processor status word for s390 */
186 __u64 psw_mask; /* psw upper half */
187 __u64 psw_addr; /* psw lower half */
188#endif
119 union { 189 union {
120 /* KVM_EXIT_UNKNOWN */ 190 /* KVM_EXIT_UNKNOWN */
121 struct { 191 struct {
@@ -167,8 +237,6 @@ struct kvm_run {
167 /* KVM_EXIT_S390_SIEIC */ 237 /* KVM_EXIT_S390_SIEIC */
168 struct { 238 struct {
169 __u8 icptcode; 239 __u8 icptcode;
170 __u64 mask; /* psw upper half */
171 __u64 addr; /* psw lower half */
172 __u16 ipa; 240 __u16 ipa;
173 __u32 ipb; 241 __u32 ipb;
174 } s390_sieic; 242 } s390_sieic;
@@ -187,6 +255,9 @@ struct kvm_run {
187 } dcr; 255 } dcr;
188 struct { 256 struct {
189 __u32 suberror; 257 __u32 suberror;
258 /* Available with KVM_CAP_INTERNAL_ERROR_DATA: */
259 __u32 ndata;
260 __u64 data[16];
190 } internal; 261 } internal;
191 /* Fix the size of the union. */ 262 /* Fix the size of the union. */
192 char padding[256]; 263 char padding[256];
@@ -329,24 +400,6 @@ struct kvm_ioeventfd {
329 __u8 pad[36]; 400 __u8 pad[36];
330}; 401};
331 402
332#define KVM_TRC_SHIFT 16
333/*
334 * kvm trace categories
335 */
336#define KVM_TRC_ENTRYEXIT (1 << KVM_TRC_SHIFT)
337#define KVM_TRC_HANDLER (1 << (KVM_TRC_SHIFT + 1)) /* only 12 bits */
338
339/*
340 * kvm trace action
341 */
342#define KVM_TRC_VMENTRY (KVM_TRC_ENTRYEXIT + 0x01)
343#define KVM_TRC_VMEXIT (KVM_TRC_ENTRYEXIT + 0x02)
344#define KVM_TRC_PAGE_FAULT (KVM_TRC_HANDLER + 0x01)
345
346#define KVM_TRC_HEAD_SIZE 12
347#define KVM_TRC_CYCLE_SIZE 8
348#define KVM_TRC_EXTRA_MAX 7
349
350#define KVMIO 0xAE 403#define KVMIO 0xAE
351 404
352/* 405/*
@@ -367,12 +420,10 @@ struct kvm_ioeventfd {
367 */ 420 */
368#define KVM_GET_VCPU_MMAP_SIZE _IO(KVMIO, 0x04) /* in bytes */ 421#define KVM_GET_VCPU_MMAP_SIZE _IO(KVMIO, 0x04) /* in bytes */
369#define KVM_GET_SUPPORTED_CPUID _IOWR(KVMIO, 0x05, struct kvm_cpuid2) 422#define KVM_GET_SUPPORTED_CPUID _IOWR(KVMIO, 0x05, struct kvm_cpuid2)
370/* 423#define KVM_TRACE_ENABLE __KVM_DEPRECATED_MAIN_W_0x06
371 * ioctls for kvm trace 424#define KVM_TRACE_PAUSE __KVM_DEPRECATED_MAIN_0x07
372 */ 425#define KVM_TRACE_DISABLE __KVM_DEPRECATED_MAIN_0x08
373#define KVM_TRACE_ENABLE _IOW(KVMIO, 0x06, struct kvm_user_trace_setup) 426
374#define KVM_TRACE_PAUSE _IO(KVMIO, 0x07)
375#define KVM_TRACE_DISABLE _IO(KVMIO, 0x08)
376/* 427/*
377 * Extension capability list. 428 * Extension capability list.
378 */ 429 */
@@ -436,6 +487,15 @@ struct kvm_ioeventfd {
436#endif 487#endif
437#define KVM_CAP_IOEVENTFD 36 488#define KVM_CAP_IOEVENTFD 36
438#define KVM_CAP_SET_IDENTITY_MAP_ADDR 37 489#define KVM_CAP_SET_IDENTITY_MAP_ADDR 37
490#ifdef __KVM_HAVE_XEN_HVM
491#define KVM_CAP_XEN_HVM 38
492#endif
493#define KVM_CAP_ADJUST_CLOCK 39
494#define KVM_CAP_INTERNAL_ERROR_DATA 40
495#ifdef __KVM_HAVE_VCPU_EVENTS
496#define KVM_CAP_VCPU_EVENTS 41
497#endif
498#define KVM_CAP_S390_PSW 42
439 499
440#ifdef KVM_CAP_IRQ_ROUTING 500#ifdef KVM_CAP_IRQ_ROUTING
441 501
@@ -488,6 +548,18 @@ struct kvm_x86_mce {
488}; 548};
489#endif 549#endif
490 550
551#ifdef KVM_CAP_XEN_HVM
552struct kvm_xen_hvm_config {
553 __u32 flags;
554 __u32 msr;
555 __u64 blob_addr_32;
556 __u64 blob_addr_64;
557 __u8 blob_size_32;
558 __u8 blob_size_64;
559 __u8 pad2[30];
560};
561#endif
562
491#define KVM_IRQFD_FLAG_DEASSIGN (1 << 0) 563#define KVM_IRQFD_FLAG_DEASSIGN (1 << 0)
492 564
493struct kvm_irqfd { 565struct kvm_irqfd {
@@ -497,55 +569,66 @@ struct kvm_irqfd {
497 __u8 pad[20]; 569 __u8 pad[20];
498}; 570};
499 571
572struct kvm_clock_data {
573 __u64 clock;
574 __u32 flags;
575 __u32 pad[9];
576};
577
500/* 578/*
501 * ioctls for VM fds 579 * ioctls for VM fds
502 */ 580 */
503#define KVM_SET_MEMORY_REGION _IOW(KVMIO, 0x40, struct kvm_memory_region) 581#define KVM_SET_MEMORY_REGION _IOW(KVMIO, 0x40, struct kvm_memory_region)
504/* 582/*
505 * KVM_CREATE_VCPU receives as a parameter the vcpu slot, and returns 583 * KVM_CREATE_VCPU receives as a parameter the vcpu slot, and returns
506 * a vcpu fd. 584 * a vcpu fd.
507 */ 585 */
508#define KVM_CREATE_VCPU _IO(KVMIO, 0x41) 586#define KVM_CREATE_VCPU _IO(KVMIO, 0x41)
509#define KVM_GET_DIRTY_LOG _IOW(KVMIO, 0x42, struct kvm_dirty_log) 587#define KVM_GET_DIRTY_LOG _IOW(KVMIO, 0x42, struct kvm_dirty_log)
510#define KVM_SET_MEMORY_ALIAS _IOW(KVMIO, 0x43, struct kvm_memory_alias) 588#define KVM_SET_MEMORY_ALIAS _IOW(KVMIO, 0x43, struct kvm_memory_alias)
511#define KVM_SET_NR_MMU_PAGES _IO(KVMIO, 0x44) 589#define KVM_SET_NR_MMU_PAGES _IO(KVMIO, 0x44)
512#define KVM_GET_NR_MMU_PAGES _IO(KVMIO, 0x45) 590#define KVM_GET_NR_MMU_PAGES _IO(KVMIO, 0x45)
513#define KVM_SET_USER_MEMORY_REGION _IOW(KVMIO, 0x46,\ 591#define KVM_SET_USER_MEMORY_REGION _IOW(KVMIO, 0x46, \
514 struct kvm_userspace_memory_region) 592 struct kvm_userspace_memory_region)
515#define KVM_SET_TSS_ADDR _IO(KVMIO, 0x47) 593#define KVM_SET_TSS_ADDR _IO(KVMIO, 0x47)
516#define KVM_SET_IDENTITY_MAP_ADDR _IOW(KVMIO, 0x48, __u64) 594#define KVM_SET_IDENTITY_MAP_ADDR _IOW(KVMIO, 0x48, __u64)
517/* Device model IOC */ 595/* Device model IOC */
518#define KVM_CREATE_IRQCHIP _IO(KVMIO, 0x60) 596#define KVM_CREATE_IRQCHIP _IO(KVMIO, 0x60)
519#define KVM_IRQ_LINE _IOW(KVMIO, 0x61, struct kvm_irq_level) 597#define KVM_IRQ_LINE _IOW(KVMIO, 0x61, struct kvm_irq_level)
520#define KVM_GET_IRQCHIP _IOWR(KVMIO, 0x62, struct kvm_irqchip) 598#define KVM_GET_IRQCHIP _IOWR(KVMIO, 0x62, struct kvm_irqchip)
521#define KVM_SET_IRQCHIP _IOR(KVMIO, 0x63, struct kvm_irqchip) 599#define KVM_SET_IRQCHIP _IOR(KVMIO, 0x63, struct kvm_irqchip)
522#define KVM_CREATE_PIT _IO(KVMIO, 0x64) 600#define KVM_CREATE_PIT _IO(KVMIO, 0x64)
523#define KVM_GET_PIT _IOWR(KVMIO, 0x65, struct kvm_pit_state) 601#define KVM_GET_PIT _IOWR(KVMIO, 0x65, struct kvm_pit_state)
524#define KVM_SET_PIT _IOR(KVMIO, 0x66, struct kvm_pit_state) 602#define KVM_SET_PIT _IOR(KVMIO, 0x66, struct kvm_pit_state)
525#define KVM_IRQ_LINE_STATUS _IOWR(KVMIO, 0x67, struct kvm_irq_level) 603#define KVM_IRQ_LINE_STATUS _IOWR(KVMIO, 0x67, struct kvm_irq_level)
526#define KVM_REGISTER_COALESCED_MMIO \ 604#define KVM_REGISTER_COALESCED_MMIO \
527 _IOW(KVMIO, 0x67, struct kvm_coalesced_mmio_zone) 605 _IOW(KVMIO, 0x67, struct kvm_coalesced_mmio_zone)
528#define KVM_UNREGISTER_COALESCED_MMIO \ 606#define KVM_UNREGISTER_COALESCED_MMIO \
529 _IOW(KVMIO, 0x68, struct kvm_coalesced_mmio_zone) 607 _IOW(KVMIO, 0x68, struct kvm_coalesced_mmio_zone)
530#define KVM_ASSIGN_PCI_DEVICE _IOR(KVMIO, 0x69, \ 608#define KVM_ASSIGN_PCI_DEVICE _IOR(KVMIO, 0x69, \
531 struct kvm_assigned_pci_dev) 609 struct kvm_assigned_pci_dev)
532#define KVM_SET_GSI_ROUTING _IOW(KVMIO, 0x6a, struct kvm_irq_routing) 610#define KVM_SET_GSI_ROUTING _IOW(KVMIO, 0x6a, struct kvm_irq_routing)
533/* deprecated, replaced by KVM_ASSIGN_DEV_IRQ */ 611/* deprecated, replaced by KVM_ASSIGN_DEV_IRQ */
534#define KVM_ASSIGN_IRQ _IOR(KVMIO, 0x70, \ 612#define KVM_ASSIGN_IRQ __KVM_DEPRECATED_VM_R_0x70
535 struct kvm_assigned_irq) 613#define KVM_ASSIGN_DEV_IRQ _IOW(KVMIO, 0x70, struct kvm_assigned_irq)
536#define KVM_ASSIGN_DEV_IRQ _IOW(KVMIO, 0x70, struct kvm_assigned_irq) 614#define KVM_REINJECT_CONTROL _IO(KVMIO, 0x71)
537#define KVM_REINJECT_CONTROL _IO(KVMIO, 0x71) 615#define KVM_DEASSIGN_PCI_DEVICE _IOW(KVMIO, 0x72, \
538#define KVM_DEASSIGN_PCI_DEVICE _IOW(KVMIO, 0x72, \ 616 struct kvm_assigned_pci_dev)
539 struct kvm_assigned_pci_dev) 617#define KVM_ASSIGN_SET_MSIX_NR _IOW(KVMIO, 0x73, \
540#define KVM_ASSIGN_SET_MSIX_NR \ 618 struct kvm_assigned_msix_nr)
541 _IOW(KVMIO, 0x73, struct kvm_assigned_msix_nr) 619#define KVM_ASSIGN_SET_MSIX_ENTRY _IOW(KVMIO, 0x74, \
542#define KVM_ASSIGN_SET_MSIX_ENTRY \ 620 struct kvm_assigned_msix_entry)
543 _IOW(KVMIO, 0x74, struct kvm_assigned_msix_entry) 621#define KVM_DEASSIGN_DEV_IRQ _IOW(KVMIO, 0x75, struct kvm_assigned_irq)
544#define KVM_DEASSIGN_DEV_IRQ _IOW(KVMIO, 0x75, struct kvm_assigned_irq) 622#define KVM_IRQFD _IOW(KVMIO, 0x76, struct kvm_irqfd)
545#define KVM_IRQFD _IOW(KVMIO, 0x76, struct kvm_irqfd) 623#define KVM_CREATE_PIT2 _IOW(KVMIO, 0x77, struct kvm_pit_config)
546#define KVM_CREATE_PIT2 _IOW(KVMIO, 0x77, struct kvm_pit_config) 624#define KVM_SET_BOOT_CPU_ID _IO(KVMIO, 0x78)
547#define KVM_SET_BOOT_CPU_ID _IO(KVMIO, 0x78) 625#define KVM_IOEVENTFD _IOW(KVMIO, 0x79, struct kvm_ioeventfd)
548#define KVM_IOEVENTFD _IOW(KVMIO, 0x79, struct kvm_ioeventfd) 626#define KVM_XEN_HVM_CONFIG _IOW(KVMIO, 0x7a, struct kvm_xen_hvm_config)
627#define KVM_SET_CLOCK _IOW(KVMIO, 0x7b, struct kvm_clock_data)
628#define KVM_GET_CLOCK _IOR(KVMIO, 0x7c, struct kvm_clock_data)
629/* Available with KVM_CAP_PIT_STATE2 */
630#define KVM_GET_PIT2 _IOR(KVMIO, 0x9f, struct kvm_pit_state2)
631#define KVM_SET_PIT2 _IOW(KVMIO, 0xa0, struct kvm_pit_state2)
549 632
550/* 633/*
551 * ioctls for vcpu fds 634 * ioctls for vcpu fds
@@ -558,7 +641,7 @@ struct kvm_irqfd {
558#define KVM_TRANSLATE _IOWR(KVMIO, 0x85, struct kvm_translation) 641#define KVM_TRANSLATE _IOWR(KVMIO, 0x85, struct kvm_translation)
559#define KVM_INTERRUPT _IOW(KVMIO, 0x86, struct kvm_interrupt) 642#define KVM_INTERRUPT _IOW(KVMIO, 0x86, struct kvm_interrupt)
560/* KVM_DEBUG_GUEST is no longer supported, use KVM_SET_GUEST_DEBUG instead */ 643/* KVM_DEBUG_GUEST is no longer supported, use KVM_SET_GUEST_DEBUG instead */
561#define KVM_DEBUG_GUEST __KVM_DEPRECATED_DEBUG_GUEST 644#define KVM_DEBUG_GUEST __KVM_DEPRECATED_VCPU_W_0x87
562#define KVM_GET_MSRS _IOWR(KVMIO, 0x88, struct kvm_msrs) 645#define KVM_GET_MSRS _IOWR(KVMIO, 0x88, struct kvm_msrs)
563#define KVM_SET_MSRS _IOW(KVMIO, 0x89, struct kvm_msrs) 646#define KVM_SET_MSRS _IOW(KVMIO, 0x89, struct kvm_msrs)
564#define KVM_SET_CPUID _IOW(KVMIO, 0x8a, struct kvm_cpuid) 647#define KVM_SET_CPUID _IOW(KVMIO, 0x8a, struct kvm_cpuid)
@@ -570,7 +653,7 @@ struct kvm_irqfd {
570#define KVM_SET_CPUID2 _IOW(KVMIO, 0x90, struct kvm_cpuid2) 653#define KVM_SET_CPUID2 _IOW(KVMIO, 0x90, struct kvm_cpuid2)
571#define KVM_GET_CPUID2 _IOWR(KVMIO, 0x91, struct kvm_cpuid2) 654#define KVM_GET_CPUID2 _IOWR(KVMIO, 0x91, struct kvm_cpuid2)
572/* Available with KVM_CAP_VAPIC */ 655/* Available with KVM_CAP_VAPIC */
573#define KVM_TPR_ACCESS_REPORTING _IOWR(KVMIO, 0x92, struct kvm_tpr_access_ctl) 656#define KVM_TPR_ACCESS_REPORTING _IOWR(KVMIO, 0x92, struct kvm_tpr_access_ctl)
574/* Available with KVM_CAP_VAPIC */ 657/* Available with KVM_CAP_VAPIC */
575#define KVM_SET_VAPIC_ADDR _IOW(KVMIO, 0x93, struct kvm_vapic_addr) 658#define KVM_SET_VAPIC_ADDR _IOW(KVMIO, 0x93, struct kvm_vapic_addr)
576/* valid for virtual machine (for floating interrupt)_and_ vcpu */ 659/* valid for virtual machine (for floating interrupt)_and_ vcpu */
@@ -582,66 +665,23 @@ struct kvm_irqfd {
582/* initial ipl psw for s390 */ 665/* initial ipl psw for s390 */
583#define KVM_S390_SET_INITIAL_PSW _IOW(KVMIO, 0x96, struct kvm_s390_psw) 666#define KVM_S390_SET_INITIAL_PSW _IOW(KVMIO, 0x96, struct kvm_s390_psw)
584/* initial reset for s390 */ 667/* initial reset for s390 */
585#define KVM_S390_INITIAL_RESET _IO(KVMIO, 0x97) 668#define KVM_S390_INITIAL_RESET _IO(KVMIO, 0x97)
586#define KVM_GET_MP_STATE _IOR(KVMIO, 0x98, struct kvm_mp_state) 669#define KVM_GET_MP_STATE _IOR(KVMIO, 0x98, struct kvm_mp_state)
587#define KVM_SET_MP_STATE _IOW(KVMIO, 0x99, struct kvm_mp_state) 670#define KVM_SET_MP_STATE _IOW(KVMIO, 0x99, struct kvm_mp_state)
588/* Available with KVM_CAP_NMI */ 671/* Available with KVM_CAP_NMI */
589#define KVM_NMI _IO(KVMIO, 0x9a) 672#define KVM_NMI _IO(KVMIO, 0x9a)
590/* Available with KVM_CAP_SET_GUEST_DEBUG */ 673/* Available with KVM_CAP_SET_GUEST_DEBUG */
591#define KVM_SET_GUEST_DEBUG _IOW(KVMIO, 0x9b, struct kvm_guest_debug) 674#define KVM_SET_GUEST_DEBUG _IOW(KVMIO, 0x9b, struct kvm_guest_debug)
592/* MCE for x86 */ 675/* MCE for x86 */
593#define KVM_X86_SETUP_MCE _IOW(KVMIO, 0x9c, __u64) 676#define KVM_X86_SETUP_MCE _IOW(KVMIO, 0x9c, __u64)
594#define KVM_X86_GET_MCE_CAP_SUPPORTED _IOR(KVMIO, 0x9d, __u64) 677#define KVM_X86_GET_MCE_CAP_SUPPORTED _IOR(KVMIO, 0x9d, __u64)
595#define KVM_X86_SET_MCE _IOW(KVMIO, 0x9e, struct kvm_x86_mce) 678#define KVM_X86_SET_MCE _IOW(KVMIO, 0x9e, struct kvm_x86_mce)
596 679/* IA64 stack access */
597/*
598 * Deprecated interfaces
599 */
600struct kvm_breakpoint {
601 __u32 enabled;
602 __u32 padding;
603 __u64 address;
604};
605
606struct kvm_debug_guest {
607 __u32 enabled;
608 __u32 pad;
609 struct kvm_breakpoint breakpoints[4];
610 __u32 singlestep;
611};
612
613#define __KVM_DEPRECATED_DEBUG_GUEST _IOW(KVMIO, 0x87, struct kvm_debug_guest)
614
615#define KVM_IA64_VCPU_GET_STACK _IOR(KVMIO, 0x9a, void *) 680#define KVM_IA64_VCPU_GET_STACK _IOR(KVMIO, 0x9a, void *)
616#define KVM_IA64_VCPU_SET_STACK _IOW(KVMIO, 0x9b, void *) 681#define KVM_IA64_VCPU_SET_STACK _IOW(KVMIO, 0x9b, void *)
617 682/* Available with KVM_CAP_VCPU_EVENTS */
618#define KVM_GET_PIT2 _IOR(KVMIO, 0x9f, struct kvm_pit_state2) 683#define KVM_GET_VCPU_EVENTS _IOR(KVMIO, 0x9f, struct kvm_vcpu_events)
619#define KVM_SET_PIT2 _IOW(KVMIO, 0xa0, struct kvm_pit_state2) 684#define KVM_SET_VCPU_EVENTS _IOW(KVMIO, 0xa0, struct kvm_vcpu_events)
620
621#define KVM_TRC_INJ_VIRQ (KVM_TRC_HANDLER + 0x02)
622#define KVM_TRC_REDELIVER_EVT (KVM_TRC_HANDLER + 0x03)
623#define KVM_TRC_PEND_INTR (KVM_TRC_HANDLER + 0x04)
624#define KVM_TRC_IO_READ (KVM_TRC_HANDLER + 0x05)
625#define KVM_TRC_IO_WRITE (KVM_TRC_HANDLER + 0x06)
626#define KVM_TRC_CR_READ (KVM_TRC_HANDLER + 0x07)
627#define KVM_TRC_CR_WRITE (KVM_TRC_HANDLER + 0x08)
628#define KVM_TRC_DR_READ (KVM_TRC_HANDLER + 0x09)
629#define KVM_TRC_DR_WRITE (KVM_TRC_HANDLER + 0x0A)
630#define KVM_TRC_MSR_READ (KVM_TRC_HANDLER + 0x0B)
631#define KVM_TRC_MSR_WRITE (KVM_TRC_HANDLER + 0x0C)
632#define KVM_TRC_CPUID (KVM_TRC_HANDLER + 0x0D)
633#define KVM_TRC_INTR (KVM_TRC_HANDLER + 0x0E)
634#define KVM_TRC_NMI (KVM_TRC_HANDLER + 0x0F)
635#define KVM_TRC_VMMCALL (KVM_TRC_HANDLER + 0x10)
636#define KVM_TRC_HLT (KVM_TRC_HANDLER + 0x11)
637#define KVM_TRC_CLTS (KVM_TRC_HANDLER + 0x12)
638#define KVM_TRC_LMSW (KVM_TRC_HANDLER + 0x13)
639#define KVM_TRC_APIC_ACCESS (KVM_TRC_HANDLER + 0x14)
640#define KVM_TRC_TDP_FAULT (KVM_TRC_HANDLER + 0x15)
641#define KVM_TRC_GTLB_WRITE (KVM_TRC_HANDLER + 0x16)
642#define KVM_TRC_STLB_WRITE (KVM_TRC_HANDLER + 0x17)
643#define KVM_TRC_STLB_INVAL (KVM_TRC_HANDLER + 0x18)
644#define KVM_TRC_PPC_INSTR (KVM_TRC_HANDLER + 0x19)
645 685
646#define KVM_DEV_ASSIGN_ENABLE_IOMMU (1 << 0) 686#define KVM_DEV_ASSIGN_ENABLE_IOMMU (1 << 0)
647 687
@@ -696,4 +736,4 @@ struct kvm_assigned_msix_entry {
696 __u16 padding[3]; 736 __u16 padding[3];
697}; 737};
698 738
699#endif 739#endif /* __LINUX_KVM_H */
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
index b7bbb5ddd7ae..bd5a616d9373 100644
--- a/include/linux/kvm_host.h
+++ b/include/linux/kvm_host.h
@@ -120,7 +120,7 @@ struct kvm_kernel_irq_routing_entry {
120 u32 gsi; 120 u32 gsi;
121 u32 type; 121 u32 type;
122 int (*set)(struct kvm_kernel_irq_routing_entry *e, 122 int (*set)(struct kvm_kernel_irq_routing_entry *e,
123 struct kvm *kvm, int level); 123 struct kvm *kvm, int irq_source_id, int level);
124 union { 124 union {
125 struct { 125 struct {
126 unsigned irqchip; 126 unsigned irqchip;
@@ -128,9 +128,28 @@ struct kvm_kernel_irq_routing_entry {
128 } irqchip; 128 } irqchip;
129 struct msi_msg msi; 129 struct msi_msg msi;
130 }; 130 };
131 struct list_head link; 131 struct hlist_node link;
132};
133
134#ifdef __KVM_HAVE_IOAPIC
135
136struct kvm_irq_routing_table {
137 int chip[KVM_NR_IRQCHIPS][KVM_IOAPIC_NUM_PINS];
138 struct kvm_kernel_irq_routing_entry *rt_entries;
139 u32 nr_rt_entries;
140 /*
141 * Array indexed by gsi. Each entry contains list of irq chips
142 * the gsi is connected to.
143 */
144 struct hlist_head map[0];
132}; 145};
133 146
147#else
148
149struct kvm_irq_routing_table {};
150
151#endif
152
134struct kvm { 153struct kvm {
135 spinlock_t mmu_lock; 154 spinlock_t mmu_lock;
136 spinlock_t requests_lock; 155 spinlock_t requests_lock;
@@ -166,8 +185,9 @@ struct kvm {
166 185
167 struct mutex irq_lock; 186 struct mutex irq_lock;
168#ifdef CONFIG_HAVE_KVM_IRQCHIP 187#ifdef CONFIG_HAVE_KVM_IRQCHIP
169 struct list_head irq_routing; /* of kvm_kernel_irq_routing_entry */ 188 struct kvm_irq_routing_table *irq_routing;
170 struct hlist_head mask_notifier_list; 189 struct hlist_head mask_notifier_list;
190 struct hlist_head irq_ack_notifier_list;
171#endif 191#endif
172 192
173#ifdef KVM_ARCH_WANT_MMU_NOTIFIER 193#ifdef KVM_ARCH_WANT_MMU_NOTIFIER
@@ -266,6 +286,7 @@ int kvm_is_visible_gfn(struct kvm *kvm, gfn_t gfn);
266void mark_page_dirty(struct kvm *kvm, gfn_t gfn); 286void mark_page_dirty(struct kvm *kvm, gfn_t gfn);
267 287
268void kvm_vcpu_block(struct kvm_vcpu *vcpu); 288void kvm_vcpu_block(struct kvm_vcpu *vcpu);
289void kvm_vcpu_on_spin(struct kvm_vcpu *vcpu);
269void kvm_resched(struct kvm_vcpu *vcpu); 290void kvm_resched(struct kvm_vcpu *vcpu);
270void kvm_load_guest_fpu(struct kvm_vcpu *vcpu); 291void kvm_load_guest_fpu(struct kvm_vcpu *vcpu);
271void kvm_put_guest_fpu(struct kvm_vcpu *vcpu); 292void kvm_put_guest_fpu(struct kvm_vcpu *vcpu);
@@ -325,7 +346,7 @@ int kvm_arch_vcpu_setup(struct kvm_vcpu *vcpu);
325void kvm_arch_vcpu_destroy(struct kvm_vcpu *vcpu); 346void kvm_arch_vcpu_destroy(struct kvm_vcpu *vcpu);
326 347
327int kvm_arch_vcpu_reset(struct kvm_vcpu *vcpu); 348int kvm_arch_vcpu_reset(struct kvm_vcpu *vcpu);
328void kvm_arch_hardware_enable(void *garbage); 349int kvm_arch_hardware_enable(void *garbage);
329void kvm_arch_hardware_disable(void *garbage); 350void kvm_arch_hardware_disable(void *garbage);
330int kvm_arch_hardware_setup(void); 351int kvm_arch_hardware_setup(void);
331void kvm_arch_hardware_unsetup(void); 352void kvm_arch_hardware_unsetup(void);
@@ -390,7 +411,12 @@ void kvm_unregister_irq_mask_notifier(struct kvm *kvm, int irq,
390 struct kvm_irq_mask_notifier *kimn); 411 struct kvm_irq_mask_notifier *kimn);
391void kvm_fire_mask_notifiers(struct kvm *kvm, int irq, bool mask); 412void kvm_fire_mask_notifiers(struct kvm *kvm, int irq, bool mask);
392 413
393int kvm_set_irq(struct kvm *kvm, int irq_source_id, int irq, int level); 414#ifdef __KVM_HAVE_IOAPIC
415void kvm_get_intr_delivery_bitmask(struct kvm_ioapic *ioapic,
416 union kvm_ioapic_redirect_entry *entry,
417 unsigned long *deliver_bitmask);
418#endif
419int kvm_set_irq(struct kvm *kvm, int irq_source_id, u32 irq, int level);
394void kvm_notify_acked_irq(struct kvm *kvm, unsigned irqchip, unsigned pin); 420void kvm_notify_acked_irq(struct kvm *kvm, unsigned irqchip, unsigned pin);
395void kvm_register_irq_ack_notifier(struct kvm *kvm, 421void kvm_register_irq_ack_notifier(struct kvm *kvm,
396 struct kvm_irq_ack_notifier *kian); 422 struct kvm_irq_ack_notifier *kian);
@@ -552,4 +578,21 @@ static inline bool kvm_vcpu_is_bsp(struct kvm_vcpu *vcpu)
552 return vcpu->kvm->bsp_vcpu_id == vcpu->vcpu_id; 578 return vcpu->kvm->bsp_vcpu_id == vcpu->vcpu_id;
553} 579}
554#endif 580#endif
581
582#ifdef __KVM_HAVE_DEVICE_ASSIGNMENT
583
584long kvm_vm_ioctl_assigned_device(struct kvm *kvm, unsigned ioctl,
585 unsigned long arg);
586
587#else
588
589static inline long kvm_vm_ioctl_assigned_device(struct kvm *kvm, unsigned ioctl,
590 unsigned long arg)
591{
592 return -ENOTTY;
593}
594
555#endif 595#endif
596
597#endif
598
diff --git a/include/linux/mfd/twl4030-codec.h b/include/linux/mfd/twl4030-codec.h
new file mode 100644
index 000000000000..2ec317c68e59
--- /dev/null
+++ b/include/linux/mfd/twl4030-codec.h
@@ -0,0 +1,272 @@
1/*
2 * MFD driver for twl4030 codec submodule
3 *
4 * Author: Peter Ujfalusi <peter.ujfalusi@nokia.com>
5 *
6 * Copyright: (C) 2009 Nokia Corporation
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 *
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20 * 02110-1301 USA
21 *
22 */
23
24#ifndef __TWL4030_CODEC_H__
25#define __TWL4030_CODEC_H__
26
27/* Codec registers */
28#define TWL4030_REG_CODEC_MODE 0x01
29#define TWL4030_REG_OPTION 0x02
30#define TWL4030_REG_UNKNOWN 0x03
31#define TWL4030_REG_MICBIAS_CTL 0x04
32#define TWL4030_REG_ANAMICL 0x05
33#define TWL4030_REG_ANAMICR 0x06
34#define TWL4030_REG_AVADC_CTL 0x07
35#define TWL4030_REG_ADCMICSEL 0x08
36#define TWL4030_REG_DIGMIXING 0x09
37#define TWL4030_REG_ATXL1PGA 0x0A
38#define TWL4030_REG_ATXR1PGA 0x0B
39#define TWL4030_REG_AVTXL2PGA 0x0C
40#define TWL4030_REG_AVTXR2PGA 0x0D
41#define TWL4030_REG_AUDIO_IF 0x0E
42#define TWL4030_REG_VOICE_IF 0x0F
43#define TWL4030_REG_ARXR1PGA 0x10
44#define TWL4030_REG_ARXL1PGA 0x11
45#define TWL4030_REG_ARXR2PGA 0x12
46#define TWL4030_REG_ARXL2PGA 0x13
47#define TWL4030_REG_VRXPGA 0x14
48#define TWL4030_REG_VSTPGA 0x15
49#define TWL4030_REG_VRX2ARXPGA 0x16
50#define TWL4030_REG_AVDAC_CTL 0x17
51#define TWL4030_REG_ARX2VTXPGA 0x18
52#define TWL4030_REG_ARXL1_APGA_CTL 0x19
53#define TWL4030_REG_ARXR1_APGA_CTL 0x1A
54#define TWL4030_REG_ARXL2_APGA_CTL 0x1B
55#define TWL4030_REG_ARXR2_APGA_CTL 0x1C
56#define TWL4030_REG_ATX2ARXPGA 0x1D
57#define TWL4030_REG_BT_IF 0x1E
58#define TWL4030_REG_BTPGA 0x1F
59#define TWL4030_REG_BTSTPGA 0x20
60#define TWL4030_REG_EAR_CTL 0x21
61#define TWL4030_REG_HS_SEL 0x22
62#define TWL4030_REG_HS_GAIN_SET 0x23
63#define TWL4030_REG_HS_POPN_SET 0x24
64#define TWL4030_REG_PREDL_CTL 0x25
65#define TWL4030_REG_PREDR_CTL 0x26
66#define TWL4030_REG_PRECKL_CTL 0x27
67#define TWL4030_REG_PRECKR_CTL 0x28
68#define TWL4030_REG_HFL_CTL 0x29
69#define TWL4030_REG_HFR_CTL 0x2A
70#define TWL4030_REG_ALC_CTL 0x2B
71#define TWL4030_REG_ALC_SET1 0x2C
72#define TWL4030_REG_ALC_SET2 0x2D
73#define TWL4030_REG_BOOST_CTL 0x2E
74#define TWL4030_REG_SOFTVOL_CTL 0x2F
75#define TWL4030_REG_DTMF_FREQSEL 0x30
76#define TWL4030_REG_DTMF_TONEXT1H 0x31
77#define TWL4030_REG_DTMF_TONEXT1L 0x32
78#define TWL4030_REG_DTMF_TONEXT2H 0x33
79#define TWL4030_REG_DTMF_TONEXT2L 0x34
80#define TWL4030_REG_DTMF_TONOFF 0x35
81#define TWL4030_REG_DTMF_WANONOFF 0x36
82#define TWL4030_REG_I2S_RX_SCRAMBLE_H 0x37
83#define TWL4030_REG_I2S_RX_SCRAMBLE_M 0x38
84#define TWL4030_REG_I2S_RX_SCRAMBLE_L 0x39
85#define TWL4030_REG_APLL_CTL 0x3A
86#define TWL4030_REG_DTMF_CTL 0x3B
87#define TWL4030_REG_DTMF_PGA_CTL2 0x3C
88#define TWL4030_REG_DTMF_PGA_CTL1 0x3D
89#define TWL4030_REG_MISC_SET_1 0x3E
90#define TWL4030_REG_PCMBTMUX 0x3F
91#define TWL4030_REG_RX_PATH_SEL 0x43
92#define TWL4030_REG_VDL_APGA_CTL 0x44
93#define TWL4030_REG_VIBRA_CTL 0x45
94#define TWL4030_REG_VIBRA_SET 0x46
95#define TWL4030_REG_VIBRA_PWM_SET 0x47
96#define TWL4030_REG_ANAMIC_GAIN 0x48
97#define TWL4030_REG_MISC_SET_2 0x49
98
99/* Bitfield Definitions */
100
101/* TWL4030_CODEC_MODE (0x01) Fields */
102#define TWL4030_APLL_RATE 0xF0
103#define TWL4030_APLL_RATE_8000 0x00
104#define TWL4030_APLL_RATE_11025 0x10
105#define TWL4030_APLL_RATE_12000 0x20
106#define TWL4030_APLL_RATE_16000 0x40
107#define TWL4030_APLL_RATE_22050 0x50
108#define TWL4030_APLL_RATE_24000 0x60
109#define TWL4030_APLL_RATE_32000 0x80
110#define TWL4030_APLL_RATE_44100 0x90
111#define TWL4030_APLL_RATE_48000 0xA0
112#define TWL4030_APLL_RATE_96000 0xE0
113#define TWL4030_SEL_16K 0x08
114#define TWL4030_CODECPDZ 0x02
115#define TWL4030_OPT_MODE 0x01
116#define TWL4030_OPTION_1 (1 << 0)
117#define TWL4030_OPTION_2 (0 << 0)
118
119/* TWL4030_OPTION (0x02) Fields */
120#define TWL4030_ATXL1_EN (1 << 0)
121#define TWL4030_ATXR1_EN (1 << 1)
122#define TWL4030_ATXL2_VTXL_EN (1 << 2)
123#define TWL4030_ATXR2_VTXR_EN (1 << 3)
124#define TWL4030_ARXL1_VRX_EN (1 << 4)
125#define TWL4030_ARXR1_EN (1 << 5)
126#define TWL4030_ARXL2_EN (1 << 6)
127#define TWL4030_ARXR2_EN (1 << 7)
128
129/* TWL4030_REG_MICBIAS_CTL (0x04) Fields */
130#define TWL4030_MICBIAS2_CTL 0x40
131#define TWL4030_MICBIAS1_CTL 0x20
132#define TWL4030_HSMICBIAS_EN 0x04
133#define TWL4030_MICBIAS2_EN 0x02
134#define TWL4030_MICBIAS1_EN 0x01
135
136/* ANAMICL (0x05) Fields */
137#define TWL4030_CNCL_OFFSET_START 0x80
138#define TWL4030_OFFSET_CNCL_SEL 0x60
139#define TWL4030_OFFSET_CNCL_SEL_ARX1 0x00
140#define TWL4030_OFFSET_CNCL_SEL_ARX2 0x20
141#define TWL4030_OFFSET_CNCL_SEL_VRX 0x40
142#define TWL4030_OFFSET_CNCL_SEL_ALL 0x60
143#define TWL4030_MICAMPL_EN 0x10
144#define TWL4030_CKMIC_EN 0x08
145#define TWL4030_AUXL_EN 0x04
146#define TWL4030_HSMIC_EN 0x02
147#define TWL4030_MAINMIC_EN 0x01
148
149/* ANAMICR (0x06) Fields */
150#define TWL4030_MICAMPR_EN 0x10
151#define TWL4030_AUXR_EN 0x04
152#define TWL4030_SUBMIC_EN 0x01
153
154/* AVADC_CTL (0x07) Fields */
155#define TWL4030_ADCL_EN 0x08
156#define TWL4030_AVADC_CLK_PRIORITY 0x04
157#define TWL4030_ADCR_EN 0x02
158
159/* TWL4030_REG_ADCMICSEL (0x08) Fields */
160#define TWL4030_DIGMIC1_EN 0x08
161#define TWL4030_TX2IN_SEL 0x04
162#define TWL4030_DIGMIC0_EN 0x02
163#define TWL4030_TX1IN_SEL 0x01
164
165/* AUDIO_IF (0x0E) Fields */
166#define TWL4030_AIF_SLAVE_EN 0x80
167#define TWL4030_DATA_WIDTH 0x60
168#define TWL4030_DATA_WIDTH_16S_16W 0x00
169#define TWL4030_DATA_WIDTH_32S_16W 0x40
170#define TWL4030_DATA_WIDTH_32S_24W 0x60
171#define TWL4030_AIF_FORMAT 0x18
172#define TWL4030_AIF_FORMAT_CODEC 0x00
173#define TWL4030_AIF_FORMAT_LEFT 0x08
174#define TWL4030_AIF_FORMAT_RIGHT 0x10
175#define TWL4030_AIF_FORMAT_TDM 0x18
176#define TWL4030_AIF_TRI_EN 0x04
177#define TWL4030_CLK256FS_EN 0x02
178#define TWL4030_AIF_EN 0x01
179
180/* VOICE_IF (0x0F) Fields */
181#define TWL4030_VIF_SLAVE_EN 0x80
182#define TWL4030_VIF_DIN_EN 0x40
183#define TWL4030_VIF_DOUT_EN 0x20
184#define TWL4030_VIF_SWAP 0x10
185#define TWL4030_VIF_FORMAT 0x08
186#define TWL4030_VIF_TRI_EN 0x04
187#define TWL4030_VIF_SUB_EN 0x02
188#define TWL4030_VIF_EN 0x01
189
190/* EAR_CTL (0x21) */
191#define TWL4030_EAR_GAIN 0x30
192
193/* HS_GAIN_SET (0x23) Fields */
194#define TWL4030_HSR_GAIN 0x0C
195#define TWL4030_HSR_GAIN_PWR_DOWN 0x00
196#define TWL4030_HSR_GAIN_PLUS_6DB 0x04
197#define TWL4030_HSR_GAIN_0DB 0x08
198#define TWL4030_HSR_GAIN_MINUS_6DB 0x0C
199#define TWL4030_HSL_GAIN 0x03
200#define TWL4030_HSL_GAIN_PWR_DOWN 0x00
201#define TWL4030_HSL_GAIN_PLUS_6DB 0x01
202#define TWL4030_HSL_GAIN_0DB 0x02
203#define TWL4030_HSL_GAIN_MINUS_6DB 0x03
204
205/* HS_POPN_SET (0x24) Fields */
206#define TWL4030_VMID_EN 0x40
207#define TWL4030_EXTMUTE 0x20
208#define TWL4030_RAMP_DELAY 0x1C
209#define TWL4030_RAMP_DELAY_20MS 0x00
210#define TWL4030_RAMP_DELAY_40MS 0x04
211#define TWL4030_RAMP_DELAY_81MS 0x08
212#define TWL4030_RAMP_DELAY_161MS 0x0C
213#define TWL4030_RAMP_DELAY_323MS 0x10
214#define TWL4030_RAMP_DELAY_645MS 0x14
215#define TWL4030_RAMP_DELAY_1291MS 0x18
216#define TWL4030_RAMP_DELAY_2581MS 0x1C
217#define TWL4030_RAMP_EN 0x02
218
219/* PREDL_CTL (0x25) */
220#define TWL4030_PREDL_GAIN 0x30
221
222/* PREDR_CTL (0x26) */
223#define TWL4030_PREDR_GAIN 0x30
224
225/* PRECKL_CTL (0x27) */
226#define TWL4030_PRECKL_GAIN 0x30
227
228/* PRECKR_CTL (0x28) */
229#define TWL4030_PRECKR_GAIN 0x30
230
231/* HFL_CTL (0x29, 0x2A) Fields */
232#define TWL4030_HF_CTL_HB_EN 0x04
233#define TWL4030_HF_CTL_LOOP_EN 0x08
234#define TWL4030_HF_CTL_RAMP_EN 0x10
235#define TWL4030_HF_CTL_REF_EN 0x20
236
237/* APLL_CTL (0x3A) Fields */
238#define TWL4030_APLL_EN 0x10
239#define TWL4030_APLL_INFREQ 0x0F
240#define TWL4030_APLL_INFREQ_19200KHZ 0x05
241#define TWL4030_APLL_INFREQ_26000KHZ 0x06
242#define TWL4030_APLL_INFREQ_38400KHZ 0x0F
243
244/* REG_MISC_SET_1 (0x3E) Fields */
245#define TWL4030_CLK64_EN 0x80
246#define TWL4030_SCRAMBLE_EN 0x40
247#define TWL4030_FMLOOP_EN 0x20
248#define TWL4030_SMOOTH_ANAVOL_EN 0x02
249#define TWL4030_DIGMIC_LR_SWAP_EN 0x01
250
251/* VIBRA_CTL (0x45) */
252#define TWL4030_VIBRA_EN 0x01
253#define TWL4030_VIBRA_DIR 0x02
254#define TWL4030_VIBRA_AUDIO_SEL_L1 (0x00 << 2)
255#define TWL4030_VIBRA_AUDIO_SEL_R1 (0x01 << 2)
256#define TWL4030_VIBRA_AUDIO_SEL_L2 (0x02 << 2)
257#define TWL4030_VIBRA_AUDIO_SEL_R2 (0x03 << 2)
258#define TWL4030_VIBRA_SEL 0x10
259#define TWL4030_VIBRA_DIR_SEL 0x20
260
261/* TWL4030 codec resource IDs */
262enum twl4030_codec_res {
263 TWL4030_CODEC_RES_POWER = 0,
264 TWL4030_CODEC_RES_APLL,
265 TWL4030_CODEC_RES_MAX,
266};
267
268int twl4030_codec_disable_resource(enum twl4030_codec_res id);
269int twl4030_codec_enable_resource(enum twl4030_codec_res id);
270unsigned int twl4030_codec_get_mclk(void);
271
272#endif /* End of __TWL4030_CODEC_H__ */
diff --git a/include/linux/mmc/sdio_ids.h b/include/linux/mmc/sdio_ids.h
index 2dbfb5a05994..33b2ea09a4ad 100644
--- a/include/linux/mmc/sdio_ids.h
+++ b/include/linux/mmc/sdio_ids.h
@@ -28,6 +28,7 @@
28#define SDIO_DEVICE_ID_INTEL_IWMC3200TOP 0x1404 28#define SDIO_DEVICE_ID_INTEL_IWMC3200TOP 0x1404
29#define SDIO_DEVICE_ID_INTEL_IWMC3200GPS 0x1405 29#define SDIO_DEVICE_ID_INTEL_IWMC3200GPS 0x1405
30#define SDIO_DEVICE_ID_INTEL_IWMC3200BT 0x1406 30#define SDIO_DEVICE_ID_INTEL_IWMC3200BT 0x1406
31#define SDIO_DEVICE_ID_INTEL_IWMC3200WIMAX_2G5 0x1407
31 32
32#define SDIO_VENDOR_ID_MARVELL 0x02df 33#define SDIO_VENDOR_ID_MARVELL 0x02df
33#define SDIO_DEVICE_ID_MARVELL_LIBERTAS 0x9103 34#define SDIO_DEVICE_ID_MARVELL_LIBERTAS 0x9103
diff --git a/include/linux/mroute.h b/include/linux/mroute.h
index 08bc776d05e2..c5f3d53548e2 100644
--- a/include/linux/mroute.h
+++ b/include/linux/mroute.h
@@ -59,20 +59,24 @@ struct vifctl {
59 unsigned char vifc_flags; /* VIFF_ flags */ 59 unsigned char vifc_flags; /* VIFF_ flags */
60 unsigned char vifc_threshold; /* ttl limit */ 60 unsigned char vifc_threshold; /* ttl limit */
61 unsigned int vifc_rate_limit; /* Rate limiter values (NI) */ 61 unsigned int vifc_rate_limit; /* Rate limiter values (NI) */
62 struct in_addr vifc_lcl_addr; /* Our address */ 62 union {
63 struct in_addr vifc_lcl_addr; /* Local interface address */
64 int vifc_lcl_ifindex; /* Local interface index */
65 };
63 struct in_addr vifc_rmt_addr; /* IPIP tunnel addr */ 66 struct in_addr vifc_rmt_addr; /* IPIP tunnel addr */
64}; 67};
65 68
66#define VIFF_TUNNEL 0x1 /* IPIP tunnel */ 69#define VIFF_TUNNEL 0x1 /* IPIP tunnel */
67#define VIFF_SRCRT 0x2 /* NI */ 70#define VIFF_SRCRT 0x2 /* NI */
68#define VIFF_REGISTER 0x4 /* register vif */ 71#define VIFF_REGISTER 0x4 /* register vif */
72#define VIFF_USE_IFINDEX 0x8 /* use vifc_lcl_ifindex instead of
73 vifc_lcl_addr to find an interface */
69 74
70/* 75/*
71 * Cache manipulation structures for mrouted and PIMd 76 * Cache manipulation structures for mrouted and PIMd
72 */ 77 */
73 78
74struct mfcctl 79struct mfcctl {
75{
76 struct in_addr mfcc_origin; /* Origin of mcast */ 80 struct in_addr mfcc_origin; /* Origin of mcast */
77 struct in_addr mfcc_mcastgrp; /* Group in question */ 81 struct in_addr mfcc_mcastgrp; /* Group in question */
78 vifi_t mfcc_parent; /* Where it arrived */ 82 vifi_t mfcc_parent; /* Where it arrived */
@@ -87,8 +91,7 @@ struct mfcctl
87 * Group count retrieval for mrouted 91 * Group count retrieval for mrouted
88 */ 92 */
89 93
90struct sioc_sg_req 94struct sioc_sg_req {
91{
92 struct in_addr src; 95 struct in_addr src;
93 struct in_addr grp; 96 struct in_addr grp;
94 unsigned long pktcnt; 97 unsigned long pktcnt;
@@ -100,8 +103,7 @@ struct sioc_sg_req
100 * To get vif packet counts 103 * To get vif packet counts
101 */ 104 */
102 105
103struct sioc_vif_req 106struct sioc_vif_req {
104{
105 vifi_t vifi; /* Which iface */ 107 vifi_t vifi; /* Which iface */
106 unsigned long icount; /* In packets */ 108 unsigned long icount; /* In packets */
107 unsigned long ocount; /* Out packets */ 109 unsigned long ocount; /* Out packets */
@@ -114,8 +116,7 @@ struct sioc_vif_req
114 * data. Magically happens to be like an IP packet as per the original 116 * data. Magically happens to be like an IP packet as per the original
115 */ 117 */
116 118
117struct igmpmsg 119struct igmpmsg {
118{
119 __u32 unused1,unused2; 120 __u32 unused1,unused2;
120 unsigned char im_msgtype; /* What is this */ 121 unsigned char im_msgtype; /* What is this */
121 unsigned char im_mbz; /* Must be zero */ 122 unsigned char im_mbz; /* Must be zero */
@@ -176,8 +177,7 @@ static inline int ip_mr_init(void)
176} 177}
177#endif 178#endif
178 179
179struct vif_device 180struct vif_device {
180{
181 struct net_device *dev; /* Device we are using */ 181 struct net_device *dev; /* Device we are using */
182 unsigned long bytes_in,bytes_out; 182 unsigned long bytes_in,bytes_out;
183 unsigned long pkt_in,pkt_out; /* Statistics */ 183 unsigned long pkt_in,pkt_out; /* Statistics */
@@ -190,8 +190,7 @@ struct vif_device
190 190
191#define VIFF_STATIC 0x8000 191#define VIFF_STATIC 0x8000
192 192
193struct mfc_cache 193struct mfc_cache {
194{
195 struct mfc_cache *next; /* Next entry on cache line */ 194 struct mfc_cache *next; /* Next entry on cache line */
196#ifdef CONFIG_NET_NS 195#ifdef CONFIG_NET_NS
197 struct net *mfc_net; 196 struct net *mfc_net;
diff --git a/include/linux/mroute6.h b/include/linux/mroute6.h
index b191865a6ca3..2caa1a8e525d 100644
--- a/include/linux/mroute6.h
+++ b/include/linux/mroute6.h
@@ -75,8 +75,7 @@ struct mif6ctl {
75 * Cache manipulation structures for mrouted and PIMd 75 * Cache manipulation structures for mrouted and PIMd
76 */ 76 */
77 77
78struct mf6cctl 78struct mf6cctl {
79{
80 struct sockaddr_in6 mf6cc_origin; /* Origin of mcast */ 79 struct sockaddr_in6 mf6cc_origin; /* Origin of mcast */
81 struct sockaddr_in6 mf6cc_mcastgrp; /* Group in question */ 80 struct sockaddr_in6 mf6cc_mcastgrp; /* Group in question */
82 mifi_t mf6cc_parent; /* Where it arrived */ 81 mifi_t mf6cc_parent; /* Where it arrived */
@@ -87,8 +86,7 @@ struct mf6cctl
87 * Group count retrieval for pim6sd 86 * Group count retrieval for pim6sd
88 */ 87 */
89 88
90struct sioc_sg_req6 89struct sioc_sg_req6 {
91{
92 struct sockaddr_in6 src; 90 struct sockaddr_in6 src;
93 struct sockaddr_in6 grp; 91 struct sockaddr_in6 grp;
94 unsigned long pktcnt; 92 unsigned long pktcnt;
@@ -100,8 +98,7 @@ struct sioc_sg_req6
100 * To get vif packet counts 98 * To get vif packet counts
101 */ 99 */
102 100
103struct sioc_mif_req6 101struct sioc_mif_req6 {
104{
105 mifi_t mifi; /* Which iface */ 102 mifi_t mifi; /* Which iface */
106 unsigned long icount; /* In packets */ 103 unsigned long icount; /* In packets */
107 unsigned long ocount; /* Out packets */ 104 unsigned long ocount; /* Out packets */
@@ -172,8 +169,7 @@ static inline void ip6_mr_cleanup(void)
172} 169}
173#endif 170#endif
174 171
175struct mif_device 172struct mif_device {
176{
177 struct net_device *dev; /* Device we are using */ 173 struct net_device *dev; /* Device we are using */
178 unsigned long bytes_in,bytes_out; 174 unsigned long bytes_in,bytes_out;
179 unsigned long pkt_in,pkt_out; /* Statistics */ 175 unsigned long pkt_in,pkt_out; /* Statistics */
@@ -185,8 +181,7 @@ struct mif_device
185 181
186#define VIFF_STATIC 0x8000 182#define VIFF_STATIC 0x8000
187 183
188struct mfc6_cache 184struct mfc6_cache {
189{
190 struct mfc6_cache *next; /* Next entry on cache line */ 185 struct mfc6_cache *next; /* Next entry on cache line */
191#ifdef CONFIG_NET_NS 186#ifdef CONFIG_NET_NS
192 struct net *mfc6_net; 187 struct net *mfc6_net;
diff --git a/include/linux/neighbour.h b/include/linux/neighbour.h
index 12c9de138451..a7003b7a695d 100644
--- a/include/linux/neighbour.h
+++ b/include/linux/neighbour.h
@@ -4,8 +4,7 @@
4#include <linux/types.h> 4#include <linux/types.h>
5#include <linux/netlink.h> 5#include <linux/netlink.h>
6 6
7struct ndmsg 7struct ndmsg {
8{
9 __u8 ndm_family; 8 __u8 ndm_family;
10 __u8 ndm_pad1; 9 __u8 ndm_pad1;
11 __u16 ndm_pad2; 10 __u16 ndm_pad2;
@@ -15,8 +14,7 @@ struct ndmsg
15 __u8 ndm_type; 14 __u8 ndm_type;
16}; 15};
17 16
18enum 17enum {
19{
20 NDA_UNSPEC, 18 NDA_UNSPEC,
21 NDA_DST, 19 NDA_DST,
22 NDA_LLADDR, 20 NDA_LLADDR,
@@ -56,8 +54,7 @@ enum
56 NUD_PERMANENT is also cannot be deleted by garbage collectors. 54 NUD_PERMANENT is also cannot be deleted by garbage collectors.
57 */ 55 */
58 56
59struct nda_cacheinfo 57struct nda_cacheinfo {
60{
61 __u32 ndm_confirmed; 58 __u32 ndm_confirmed;
62 __u32 ndm_used; 59 __u32 ndm_used;
63 __u32 ndm_updated; 60 __u32 ndm_updated;
@@ -89,8 +86,7 @@ struct nda_cacheinfo
89 * device. 86 * device.
90 ****/ 87 ****/
91 88
92struct ndt_stats 89struct ndt_stats {
93{
94 __u64 ndts_allocs; 90 __u64 ndts_allocs;
95 __u64 ndts_destroys; 91 __u64 ndts_destroys;
96 __u64 ndts_hash_grows; 92 __u64 ndts_hash_grows;
@@ -124,15 +120,13 @@ enum {
124}; 120};
125#define NDTPA_MAX (__NDTPA_MAX - 1) 121#define NDTPA_MAX (__NDTPA_MAX - 1)
126 122
127struct ndtmsg 123struct ndtmsg {
128{
129 __u8 ndtm_family; 124 __u8 ndtm_family;
130 __u8 ndtm_pad1; 125 __u8 ndtm_pad1;
131 __u16 ndtm_pad2; 126 __u16 ndtm_pad2;
132}; 127};
133 128
134struct ndt_config 129struct ndt_config {
135{
136 __u16 ndtc_key_len; 130 __u16 ndtc_key_len;
137 __u16 ndtc_entry_size; 131 __u16 ndtc_entry_size;
138 __u32 ndtc_entries; 132 __u32 ndtc_entries;
diff --git a/include/linux/net.h b/include/linux/net.h
index d7e26e30c8c2..5e8083cacc8b 100644
--- a/include/linux/net.h
+++ b/include/linux/net.h
@@ -41,6 +41,7 @@
41#define SYS_SENDMSG 16 /* sys_sendmsg(2) */ 41#define SYS_SENDMSG 16 /* sys_sendmsg(2) */
42#define SYS_RECVMSG 17 /* sys_recvmsg(2) */ 42#define SYS_RECVMSG 17 /* sys_recvmsg(2) */
43#define SYS_ACCEPT4 18 /* sys_accept4(2) */ 43#define SYS_ACCEPT4 18 /* sys_accept4(2) */
44#define SYS_RECVMMSG 19 /* sys_recvmmsg(2) */
44 45
45typedef enum { 46typedef enum {
46 SS_FREE = 0, /* not allocated */ 47 SS_FREE = 0, /* not allocated */
@@ -198,9 +199,13 @@ struct proto_ops {
198 struct pipe_inode_info *pipe, size_t len, unsigned int flags); 199 struct pipe_inode_info *pipe, size_t len, unsigned int flags);
199}; 200};
200 201
202#define DECLARE_SOCKADDR(type, dst, src) \
203 type dst = ({ __sockaddr_check_size(sizeof(*dst)); (type) src; })
204
201struct net_proto_family { 205struct net_proto_family {
202 int family; 206 int family;
203 int (*create)(struct net *net, struct socket *sock, int protocol); 207 int (*create)(struct net *net, struct socket *sock,
208 int protocol, int kern);
204 struct module *owner; 209 struct module *owner;
205}; 210};
206 211
@@ -263,89 +268,6 @@ extern int kernel_sock_ioctl(struct socket *sock, int cmd, unsigned long arg);
263extern int kernel_sock_shutdown(struct socket *sock, 268extern int kernel_sock_shutdown(struct socket *sock,
264 enum sock_shutdown_cmd how); 269 enum sock_shutdown_cmd how);
265 270
266#ifndef CONFIG_SMP
267#define SOCKOPS_WRAPPED(name) name
268#define SOCKOPS_WRAP(name, fam)
269#else
270
271#define SOCKOPS_WRAPPED(name) __unlocked_##name
272
273#define SOCKCALL_WRAP(name, call, parms, args) \
274static int __lock_##name##_##call parms \
275{ \
276 int ret; \
277 lock_kernel(); \
278 ret = __unlocked_##name##_ops.call args ;\
279 unlock_kernel(); \
280 return ret; \
281}
282
283#define SOCKCALL_UWRAP(name, call, parms, args) \
284static unsigned int __lock_##name##_##call parms \
285{ \
286 int ret; \
287 lock_kernel(); \
288 ret = __unlocked_##name##_ops.call args ;\
289 unlock_kernel(); \
290 return ret; \
291}
292
293
294#define SOCKOPS_WRAP(name, fam) \
295SOCKCALL_WRAP(name, release, (struct socket *sock), (sock)) \
296SOCKCALL_WRAP(name, bind, (struct socket *sock, struct sockaddr *uaddr, int addr_len), \
297 (sock, uaddr, addr_len)) \
298SOCKCALL_WRAP(name, connect, (struct socket *sock, struct sockaddr * uaddr, \
299 int addr_len, int flags), \
300 (sock, uaddr, addr_len, flags)) \
301SOCKCALL_WRAP(name, socketpair, (struct socket *sock1, struct socket *sock2), \
302 (sock1, sock2)) \
303SOCKCALL_WRAP(name, accept, (struct socket *sock, struct socket *newsock, \
304 int flags), (sock, newsock, flags)) \
305SOCKCALL_WRAP(name, getname, (struct socket *sock, struct sockaddr *uaddr, \
306 int *addr_len, int peer), (sock, uaddr, addr_len, peer)) \
307SOCKCALL_UWRAP(name, poll, (struct file *file, struct socket *sock, struct poll_table_struct *wait), \
308 (file, sock, wait)) \
309SOCKCALL_WRAP(name, ioctl, (struct socket *sock, unsigned int cmd, \
310 unsigned long arg), (sock, cmd, arg)) \
311SOCKCALL_WRAP(name, compat_ioctl, (struct socket *sock, unsigned int cmd, \
312 unsigned long arg), (sock, cmd, arg)) \
313SOCKCALL_WRAP(name, listen, (struct socket *sock, int len), (sock, len)) \
314SOCKCALL_WRAP(name, shutdown, (struct socket *sock, int flags), (sock, flags)) \
315SOCKCALL_WRAP(name, setsockopt, (struct socket *sock, int level, int optname, \
316 char __user *optval, unsigned int optlen), (sock, level, optname, optval, optlen)) \
317SOCKCALL_WRAP(name, getsockopt, (struct socket *sock, int level, int optname, \
318 char __user *optval, int __user *optlen), (sock, level, optname, optval, optlen)) \
319SOCKCALL_WRAP(name, sendmsg, (struct kiocb *iocb, struct socket *sock, struct msghdr *m, size_t len), \
320 (iocb, sock, m, len)) \
321SOCKCALL_WRAP(name, recvmsg, (struct kiocb *iocb, struct socket *sock, struct msghdr *m, size_t len, int flags), \
322 (iocb, sock, m, len, flags)) \
323SOCKCALL_WRAP(name, mmap, (struct file *file, struct socket *sock, struct vm_area_struct *vma), \
324 (file, sock, vma)) \
325 \
326static const struct proto_ops name##_ops = { \
327 .family = fam, \
328 .owner = THIS_MODULE, \
329 .release = __lock_##name##_release, \
330 .bind = __lock_##name##_bind, \
331 .connect = __lock_##name##_connect, \
332 .socketpair = __lock_##name##_socketpair, \
333 .accept = __lock_##name##_accept, \
334 .getname = __lock_##name##_getname, \
335 .poll = __lock_##name##_poll, \
336 .ioctl = __lock_##name##_ioctl, \
337 .compat_ioctl = __lock_##name##_compat_ioctl, \
338 .listen = __lock_##name##_listen, \
339 .shutdown = __lock_##name##_shutdown, \
340 .setsockopt = __lock_##name##_setsockopt, \
341 .getsockopt = __lock_##name##_getsockopt, \
342 .sendmsg = __lock_##name##_sendmsg, \
343 .recvmsg = __lock_##name##_recvmsg, \
344 .mmap = __lock_##name##_mmap, \
345};
346
347#endif
348
349#define MODULE_ALIAS_NETPROTO(proto) \ 271#define MODULE_ALIAS_NETPROTO(proto) \
350 MODULE_ALIAS("net-pf-" __stringify(proto)) 272 MODULE_ALIAS("net-pf-" __stringify(proto))
351 273
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 812a5f3c2abe..a3fccc85b1a0 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -63,30 +63,69 @@ struct wireless_dev;
63#define HAVE_FREE_NETDEV /* free_netdev() */ 63#define HAVE_FREE_NETDEV /* free_netdev() */
64#define HAVE_NETDEV_PRIV /* netdev_priv() */ 64#define HAVE_NETDEV_PRIV /* netdev_priv() */
65 65
66#define NET_XMIT_SUCCESS 0
67#define NET_XMIT_DROP 1 /* skb dropped */
68#define NET_XMIT_CN 2 /* congestion notification */
69#define NET_XMIT_POLICED 3 /* skb is shot by police */
70#define NET_XMIT_MASK 0xFFFF /* qdisc flags in net/sch_generic.h */
71
72/* Backlog congestion levels */ 66/* Backlog congestion levels */
73#define NET_RX_SUCCESS 0 /* keep 'em coming, baby */ 67#define NET_RX_SUCCESS 0 /* keep 'em coming, baby */
74#define NET_RX_DROP 1 /* packet dropped */ 68#define NET_RX_DROP 1 /* packet dropped */
69
70/*
71 * Transmit return codes: transmit return codes originate from three different
72 * namespaces:
73 *
74 * - qdisc return codes
75 * - driver transmit return codes
76 * - errno values
77 *
78 * Drivers are allowed to return any one of those in their hard_start_xmit()
79 * function. Real network devices commonly used with qdiscs should only return
80 * the driver transmit return codes though - when qdiscs are used, the actual
81 * transmission happens asynchronously, so the value is not propagated to
82 * higher layers. Virtual network devices transmit synchronously, in this case
83 * the driver transmit return codes are consumed by dev_queue_xmit(), all
84 * others are propagated to higher layers.
85 */
86
87/* qdisc ->enqueue() return codes. */
88#define NET_XMIT_SUCCESS 0x00
89#define NET_XMIT_DROP 0x01 /* skb dropped */
90#define NET_XMIT_CN 0x02 /* congestion notification */
91#define NET_XMIT_POLICED 0x03 /* skb is shot by police */
92#define NET_XMIT_MASK 0x0f /* qdisc flags in net/sch_generic.h */
75 93
76/* NET_XMIT_CN is special. It does not guarantee that this packet is lost. It 94/* NET_XMIT_CN is special. It does not guarantee that this packet is lost. It
77 * indicates that the device will soon be dropping packets, or already drops 95 * indicates that the device will soon be dropping packets, or already drops
78 * some packets of the same priority; prompting us to send less aggressively. */ 96 * some packets of the same priority; prompting us to send less aggressively. */
79#define net_xmit_eval(e) ((e) == NET_XMIT_CN? 0 : (e)) 97#define net_xmit_eval(e) ((e) == NET_XMIT_CN ? 0 : (e))
80#define net_xmit_errno(e) ((e) != NET_XMIT_CN ? -ENOBUFS : 0) 98#define net_xmit_errno(e) ((e) != NET_XMIT_CN ? -ENOBUFS : 0)
81 99
82/* Driver transmit return codes */ 100/* Driver transmit return codes */
101#define NETDEV_TX_MASK 0xf0
102
83enum netdev_tx { 103enum netdev_tx {
84 NETDEV_TX_OK = 0, /* driver took care of packet */ 104 __NETDEV_TX_MIN = INT_MIN, /* make sure enum is signed */
85 NETDEV_TX_BUSY, /* driver tx path was busy*/ 105 NETDEV_TX_OK = 0x00, /* driver took care of packet */
86 NETDEV_TX_LOCKED = -1, /* driver tx lock was already taken */ 106 NETDEV_TX_BUSY = 0x10, /* driver tx path was busy*/
107 NETDEV_TX_LOCKED = 0x20, /* driver tx lock was already taken */
87}; 108};
88typedef enum netdev_tx netdev_tx_t; 109typedef enum netdev_tx netdev_tx_t;
89 110
111/*
112 * Current order: NETDEV_TX_MASK > NET_XMIT_MASK >= 0 is significant;
113 * hard_start_xmit() return < NET_XMIT_MASK means skb was consumed.
114 */
115static inline bool dev_xmit_complete(int rc)
116{
117 /*
118 * Positive cases with an skb consumed by a driver:
119 * - successful transmission (rc == NETDEV_TX_OK)
120 * - error while transmitting (rc < 0)
121 * - error while queueing to a different device (rc & NET_XMIT_MASK)
122 */
123 if (likely(rc < NET_XMIT_MASK))
124 return true;
125
126 return false;
127}
128
90#endif 129#endif
91 130
92#define MAX_ADDR_LEN 32 /* Largest hardware address length */ 131#define MAX_ADDR_LEN 32 /* Largest hardware address length */
@@ -125,8 +164,7 @@ typedef enum netdev_tx netdev_tx_t;
125 * with byte counters. 164 * with byte counters.
126 */ 165 */
127 166
128struct net_device_stats 167struct net_device_stats {
129{
130 unsigned long rx_packets; /* total packets received */ 168 unsigned long rx_packets; /* total packets received */
131 unsigned long tx_packets; /* total packets transmitted */ 169 unsigned long tx_packets; /* total packets transmitted */
132 unsigned long rx_bytes; /* total bytes received */ 170 unsigned long rx_bytes; /* total bytes received */
@@ -179,8 +217,7 @@ struct neighbour;
179struct neigh_parms; 217struct neigh_parms;
180struct sk_buff; 218struct sk_buff;
181 219
182struct netif_rx_stats 220struct netif_rx_stats {
183{
184 unsigned total; 221 unsigned total;
185 unsigned dropped; 222 unsigned dropped;
186 unsigned time_squeeze; 223 unsigned time_squeeze;
@@ -189,8 +226,7 @@ struct netif_rx_stats
189 226
190DECLARE_PER_CPU(struct netif_rx_stats, netdev_rx_stat); 227DECLARE_PER_CPU(struct netif_rx_stats, netdev_rx_stat);
191 228
192struct dev_addr_list 229struct dev_addr_list {
193{
194 struct dev_addr_list *next; 230 struct dev_addr_list *next;
195 u8 da_addr[MAX_ADDR_LEN]; 231 u8 da_addr[MAX_ADDR_LEN];
196 u8 da_addrlen; 232 u8 da_addrlen;
@@ -227,8 +263,7 @@ struct netdev_hw_addr_list {
227 int count; 263 int count;
228}; 264};
229 265
230struct hh_cache 266struct hh_cache {
231{
232 struct hh_cache *hh_next; /* Next entry */ 267 struct hh_cache *hh_next; /* Next entry */
233 atomic_t hh_refcnt; /* number of users */ 268 atomic_t hh_refcnt; /* number of users */
234/* 269/*
@@ -291,8 +326,7 @@ struct header_ops {
291 * code. 326 * code.
292 */ 327 */
293 328
294enum netdev_state_t 329enum netdev_state_t {
295{
296 __LINK_STATE_START, 330 __LINK_STATE_START,
297 __LINK_STATE_PRESENT, 331 __LINK_STATE_PRESENT,
298 __LINK_STATE_NOCARRIER, 332 __LINK_STATE_NOCARRIER,
@@ -341,20 +375,20 @@ struct napi_struct {
341 struct sk_buff *skb; 375 struct sk_buff *skb;
342}; 376};
343 377
344enum 378enum {
345{
346 NAPI_STATE_SCHED, /* Poll is scheduled */ 379 NAPI_STATE_SCHED, /* Poll is scheduled */
347 NAPI_STATE_DISABLE, /* Disable pending */ 380 NAPI_STATE_DISABLE, /* Disable pending */
348 NAPI_STATE_NPSVC, /* Netpoll - don't dequeue from poll_list */ 381 NAPI_STATE_NPSVC, /* Netpoll - don't dequeue from poll_list */
349}; 382};
350 383
351enum { 384enum gro_result {
352 GRO_MERGED, 385 GRO_MERGED,
353 GRO_MERGED_FREE, 386 GRO_MERGED_FREE,
354 GRO_HELD, 387 GRO_HELD,
355 GRO_NORMAL, 388 GRO_NORMAL,
356 GRO_DROP, 389 GRO_DROP,
357}; 390};
391typedef enum gro_result gro_result_t;
358 392
359extern void __napi_schedule(struct napi_struct *n); 393extern void __napi_schedule(struct napi_struct *n);
360 394
@@ -457,8 +491,7 @@ static inline void napi_synchronize(const struct napi_struct *n)
457# define napi_synchronize(n) barrier() 491# define napi_synchronize(n) barrier()
458#endif 492#endif
459 493
460enum netdev_queue_state_t 494enum netdev_queue_state_t {
461{
462 __QUEUE_STATE_XOFF, 495 __QUEUE_STATE_XOFF,
463 __QUEUE_STATE_FROZEN, 496 __QUEUE_STATE_FROZEN,
464}; 497};
@@ -635,6 +668,10 @@ struct net_device_ops {
635 unsigned int sgc); 668 unsigned int sgc);
636 int (*ndo_fcoe_ddp_done)(struct net_device *dev, 669 int (*ndo_fcoe_ddp_done)(struct net_device *dev,
637 u16 xid); 670 u16 xid);
671#define NETDEV_FCOE_WWNN 0
672#define NETDEV_FCOE_WWPN 1
673 int (*ndo_fcoe_get_wwn)(struct net_device *dev,
674 u64 *wwn, int type);
638#endif 675#endif
639}; 676};
640 677
@@ -648,8 +685,7 @@ struct net_device_ops {
648 * moves out. 685 * moves out.
649 */ 686 */
650 687
651struct net_device 688struct net_device {
652{
653 689
654 /* 690 /*
655 * This is the first field of the "visible" part of this structure 691 * This is the first field of the "visible" part of this structure
@@ -683,6 +719,7 @@ struct net_device
683 719
684 struct list_head dev_list; 720 struct list_head dev_list;
685 struct list_head napi_list; 721 struct list_head napi_list;
722 struct list_head unreg_list;
686 723
687 /* Net device features */ 724 /* Net device features */
688 unsigned long features; 725 unsigned long features;
@@ -859,7 +896,7 @@ struct net_device
859 /* device index hash chain */ 896 /* device index hash chain */
860 struct hlist_node index_hlist; 897 struct hlist_node index_hlist;
861 898
862 struct net_device *link_watch_next; 899 struct list_head link_watch_list;
863 900
864 /* register/unregister state machine */ 901 /* register/unregister state machine */
865 enum { NETREG_UNINITIALIZED=0, 902 enum { NETREG_UNINITIALIZED=0,
@@ -894,8 +931,8 @@ struct net_device
894 931
895 /* class/net/name entry */ 932 /* class/net/name entry */
896 struct device dev; 933 struct device dev;
897 /* space for optional statistics and wireless sysfs groups */ 934 /* space for optional device, statistics, and wireless sysfs groups */
898 const struct attribute_group *sysfs_groups[3]; 935 const struct attribute_group *sysfs_groups[4];
899 936
900 /* rtnetlink link ops */ 937 /* rtnetlink link ops */
901 const struct rtnl_link_ops *rtnl_link_ops; 938 const struct rtnl_link_ops *rtnl_link_ops;
@@ -909,7 +946,7 @@ struct net_device
909 946
910#ifdef CONFIG_DCB 947#ifdef CONFIG_DCB
911 /* Data Center Bridging netlink ops */ 948 /* Data Center Bridging netlink ops */
912 struct dcbnl_rtnl_ops *dcbnl_ops; 949 const struct dcbnl_rtnl_ops *dcbnl_ops;
913#endif 950#endif
914 951
915#if defined(CONFIG_FCOE) || defined(CONFIG_FCOE_MODULE) 952#if defined(CONFIG_FCOE) || defined(CONFIG_FCOE_MODULE)
@@ -1075,10 +1112,16 @@ extern rwlock_t dev_base_lock; /* Device list lock */
1075 1112
1076#define for_each_netdev(net, d) \ 1113#define for_each_netdev(net, d) \
1077 list_for_each_entry(d, &(net)->dev_base_head, dev_list) 1114 list_for_each_entry(d, &(net)->dev_base_head, dev_list)
1115#define for_each_netdev_reverse(net, d) \
1116 list_for_each_entry_reverse(d, &(net)->dev_base_head, dev_list)
1117#define for_each_netdev_rcu(net, d) \
1118 list_for_each_entry_rcu(d, &(net)->dev_base_head, dev_list)
1078#define for_each_netdev_safe(net, d, n) \ 1119#define for_each_netdev_safe(net, d, n) \
1079 list_for_each_entry_safe(d, n, &(net)->dev_base_head, dev_list) 1120 list_for_each_entry_safe(d, n, &(net)->dev_base_head, dev_list)
1080#define for_each_netdev_continue(net, d) \ 1121#define for_each_netdev_continue(net, d) \
1081 list_for_each_entry_continue(d, &(net)->dev_base_head, dev_list) 1122 list_for_each_entry_continue(d, &(net)->dev_base_head, dev_list)
1123#define for_each_netdev_continue_rcu(net, d) \
1124 list_for_each_entry_continue_rcu(d, &(net)->dev_base_head, dev_list)
1082#define net_device_entry(lh) list_entry(lh, struct net_device, dev_list) 1125#define net_device_entry(lh) list_entry(lh, struct net_device, dev_list)
1083 1126
1084static inline struct net_device *next_net_device(struct net_device *dev) 1127static inline struct net_device *next_net_device(struct net_device *dev)
@@ -1091,6 +1134,16 @@ static inline struct net_device *next_net_device(struct net_device *dev)
1091 return lh == &net->dev_base_head ? NULL : net_device_entry(lh); 1134 return lh == &net->dev_base_head ? NULL : net_device_entry(lh);
1092} 1135}
1093 1136
1137static inline struct net_device *next_net_device_rcu(struct net_device *dev)
1138{
1139 struct list_head *lh;
1140 struct net *net;
1141
1142 net = dev_net(dev);
1143 lh = rcu_dereference(dev->dev_list.next);
1144 return lh == &net->dev_base_head ? NULL : net_device_entry(lh);
1145}
1146
1094static inline struct net_device *first_net_device(struct net *net) 1147static inline struct net_device *first_net_device(struct net *net)
1095{ 1148{
1096 return list_empty(&net->dev_base_head) ? NULL : 1149 return list_empty(&net->dev_base_head) ? NULL :
@@ -1109,6 +1162,7 @@ extern void __dev_remove_pack(struct packet_type *pt);
1109extern struct net_device *dev_get_by_flags(struct net *net, unsigned short flags, 1162extern struct net_device *dev_get_by_flags(struct net *net, unsigned short flags,
1110 unsigned short mask); 1163 unsigned short mask);
1111extern struct net_device *dev_get_by_name(struct net *net, const char *name); 1164extern struct net_device *dev_get_by_name(struct net *net, const char *name);
1165extern struct net_device *dev_get_by_name_rcu(struct net *net, const char *name);
1112extern struct net_device *__dev_get_by_name(struct net *net, const char *name); 1166extern struct net_device *__dev_get_by_name(struct net *net, const char *name);
1113extern int dev_alloc_name(struct net_device *dev, const char *name); 1167extern int dev_alloc_name(struct net_device *dev, const char *name);
1114extern int dev_open(struct net_device *dev); 1168extern int dev_open(struct net_device *dev);
@@ -1116,7 +1170,14 @@ extern int dev_close(struct net_device *dev);
1116extern void dev_disable_lro(struct net_device *dev); 1170extern void dev_disable_lro(struct net_device *dev);
1117extern int dev_queue_xmit(struct sk_buff *skb); 1171extern int dev_queue_xmit(struct sk_buff *skb);
1118extern int register_netdevice(struct net_device *dev); 1172extern int register_netdevice(struct net_device *dev);
1119extern void unregister_netdevice(struct net_device *dev); 1173extern void unregister_netdevice_queue(struct net_device *dev,
1174 struct list_head *head);
1175extern void unregister_netdevice_many(struct list_head *head);
1176static inline void unregister_netdevice(struct net_device *dev)
1177{
1178 unregister_netdevice_queue(dev, NULL);
1179}
1180
1120extern void free_netdev(struct net_device *dev); 1181extern void free_netdev(struct net_device *dev);
1121extern void synchronize_net(void); 1182extern void synchronize_net(void);
1122extern int register_netdevice_notifier(struct notifier_block *nb); 1183extern int register_netdevice_notifier(struct notifier_block *nb);
@@ -1127,6 +1188,7 @@ extern void netdev_resync_ops(struct net_device *dev);
1127extern int call_netdevice_notifiers(unsigned long val, struct net_device *dev); 1188extern int call_netdevice_notifiers(unsigned long val, struct net_device *dev);
1128extern struct net_device *dev_get_by_index(struct net *net, int ifindex); 1189extern struct net_device *dev_get_by_index(struct net *net, int ifindex);
1129extern struct net_device *__dev_get_by_index(struct net *net, int ifindex); 1190extern struct net_device *__dev_get_by_index(struct net *net, int ifindex);
1191extern struct net_device *dev_get_by_index_rcu(struct net *net, int ifindex);
1130extern int dev_restart(struct net_device *dev); 1192extern int dev_restart(struct net_device *dev);
1131#ifdef CONFIG_NETPOLL_TRAP 1193#ifdef CONFIG_NETPOLL_TRAP
1132extern int netpoll_trap(void); 1194extern int netpoll_trap(void);
@@ -1212,8 +1274,7 @@ static inline int unregister_gifconf(unsigned int family)
1212 * Incoming packets are placed on per-cpu queues so that 1274 * Incoming packets are placed on per-cpu queues so that
1213 * no locking is needed. 1275 * no locking is needed.
1214 */ 1276 */
1215struct softnet_data 1277struct softnet_data {
1216{
1217 struct Qdisc *output_queue; 1278 struct Qdisc *output_queue;
1218 struct sk_buff_head input_pkt_queue; 1279 struct sk_buff_head input_pkt_queue;
1219 struct list_head poll_list; 1280 struct list_head poll_list;
@@ -1467,18 +1528,19 @@ extern int netif_rx_ni(struct sk_buff *skb);
1467#define HAVE_NETIF_RECEIVE_SKB 1 1528#define HAVE_NETIF_RECEIVE_SKB 1
1468extern int netif_receive_skb(struct sk_buff *skb); 1529extern int netif_receive_skb(struct sk_buff *skb);
1469extern void napi_gro_flush(struct napi_struct *napi); 1530extern void napi_gro_flush(struct napi_struct *napi);
1470extern int dev_gro_receive(struct napi_struct *napi, 1531extern gro_result_t dev_gro_receive(struct napi_struct *napi,
1471 struct sk_buff *skb); 1532 struct sk_buff *skb);
1472extern int napi_skb_finish(int ret, struct sk_buff *skb); 1533extern gro_result_t napi_skb_finish(gro_result_t ret, struct sk_buff *skb);
1473extern int napi_gro_receive(struct napi_struct *napi, 1534extern gro_result_t napi_gro_receive(struct napi_struct *napi,
1474 struct sk_buff *skb); 1535 struct sk_buff *skb);
1475extern void napi_reuse_skb(struct napi_struct *napi, 1536extern void napi_reuse_skb(struct napi_struct *napi,
1476 struct sk_buff *skb); 1537 struct sk_buff *skb);
1477extern struct sk_buff * napi_get_frags(struct napi_struct *napi); 1538extern struct sk_buff * napi_get_frags(struct napi_struct *napi);
1478extern int napi_frags_finish(struct napi_struct *napi, 1539extern gro_result_t napi_frags_finish(struct napi_struct *napi,
1479 struct sk_buff *skb, int ret); 1540 struct sk_buff *skb,
1541 gro_result_t ret);
1480extern struct sk_buff * napi_frags_skb(struct napi_struct *napi); 1542extern struct sk_buff * napi_frags_skb(struct napi_struct *napi);
1481extern int napi_gro_frags(struct napi_struct *napi); 1543extern gro_result_t napi_gro_frags(struct napi_struct *napi);
1482 1544
1483static inline void napi_free_frags(struct napi_struct *napi) 1545static inline void napi_free_frags(struct napi_struct *napi)
1484{ 1546{
@@ -1502,6 +1564,8 @@ extern int dev_set_mac_address(struct net_device *,
1502extern int dev_hard_start_xmit(struct sk_buff *skb, 1564extern int dev_hard_start_xmit(struct sk_buff *skb,
1503 struct net_device *dev, 1565 struct net_device *dev,
1504 struct netdev_queue *txq); 1566 struct netdev_queue *txq);
1567extern int dev_forward_skb(struct net_device *dev,
1568 struct sk_buff *skb);
1505 1569
1506extern int netdev_budget; 1570extern int netdev_budget;
1507 1571
@@ -1540,6 +1604,7 @@ static inline void dev_hold(struct net_device *dev)
1540 */ 1604 */
1541 1605
1542extern void linkwatch_fire_event(struct net_device *dev); 1606extern void linkwatch_fire_event(struct net_device *dev);
1607extern void linkwatch_forget_dev(struct net_device *dev);
1543 1608
1544/** 1609/**
1545 * netif_carrier_ok - test if carrier present 1610 * netif_carrier_ok - test if carrier present
@@ -1609,7 +1674,8 @@ static inline int netif_dormant(const struct net_device *dev)
1609 * 1674 *
1610 * Check if carrier is operational 1675 * Check if carrier is operational
1611 */ 1676 */
1612static inline int netif_oper_up(const struct net_device *dev) { 1677static inline int netif_oper_up(const struct net_device *dev)
1678{
1613 return (dev->operstate == IF_OPER_UP || 1679 return (dev->operstate == IF_OPER_UP ||
1614 dev->operstate == IF_OPER_UNKNOWN /* backward compat */); 1680 dev->operstate == IF_OPER_UNKNOWN /* backward compat */);
1615} 1681}
@@ -1880,6 +1946,7 @@ extern void netdev_features_change(struct net_device *dev);
1880extern void dev_load(struct net *net, const char *name); 1946extern void dev_load(struct net *net, const char *name);
1881extern void dev_mcast_init(void); 1947extern void dev_mcast_init(void);
1882extern const struct net_device_stats *dev_get_stats(struct net_device *dev); 1948extern const struct net_device_stats *dev_get_stats(struct net_device *dev);
1949extern void dev_txq_stats_fold(const struct net_device *dev, struct net_device_stats *stats);
1883 1950
1884extern int netdev_max_backlog; 1951extern int netdev_max_backlog;
1885extern int weight_p; 1952extern int weight_p;
@@ -1914,6 +1981,9 @@ unsigned long netdev_increment_features(unsigned long all, unsigned long one,
1914 unsigned long mask); 1981 unsigned long mask);
1915unsigned long netdev_fix_features(unsigned long features, const char *name); 1982unsigned long netdev_fix_features(unsigned long features, const char *name);
1916 1983
1984void netif_stacked_transfer_operstate(const struct net_device *rootdev,
1985 struct net_device *dev);
1986
1917static inline int net_gso_ok(int features, int gso_type) 1987static inline int net_gso_ok(int features, int gso_type)
1918{ 1988{
1919 int feature = gso_type << NETIF_F_GSO_SHIFT; 1989 int feature = gso_type << NETIF_F_GSO_SHIFT;
diff --git a/include/linux/netfilter.h b/include/linux/netfilter.h
index 6132b5e6d9d3..48c54960773c 100644
--- a/include/linux/netfilter.h
+++ b/include/linux/netfilter.h
@@ -93,8 +93,7 @@ typedef unsigned int nf_hookfn(unsigned int hooknum,
93 const struct net_device *out, 93 const struct net_device *out,
94 int (*okfn)(struct sk_buff *)); 94 int (*okfn)(struct sk_buff *));
95 95
96struct nf_hook_ops 96struct nf_hook_ops {
97{
98 struct list_head list; 97 struct list_head list;
99 98
100 /* User fills in from here down. */ 99 /* User fills in from here down. */
@@ -106,8 +105,7 @@ struct nf_hook_ops
106 int priority; 105 int priority;
107}; 106};
108 107
109struct nf_sockopt_ops 108struct nf_sockopt_ops {
110{
111 struct list_head list; 109 struct list_head list;
112 110
113 u_int8_t pf; 111 u_int8_t pf;
diff --git a/include/linux/netfilter/nf_conntrack_common.h b/include/linux/netfilter/nf_conntrack_common.h
index a8248ee422b7..a374787ed9b0 100644
--- a/include/linux/netfilter/nf_conntrack_common.h
+++ b/include/linux/netfilter/nf_conntrack_common.h
@@ -3,8 +3,7 @@
3/* Connection state tracking for netfilter. This is separated from, 3/* Connection state tracking for netfilter. This is separated from,
4 but required by, the NAT layer; it can also be used by an iptables 4 but required by, the NAT layer; it can also be used by an iptables
5 extension. */ 5 extension. */
6enum ip_conntrack_info 6enum ip_conntrack_info {
7{
8 /* Part of an established connection (either direction). */ 7 /* Part of an established connection (either direction). */
9 IP_CT_ESTABLISHED, 8 IP_CT_ESTABLISHED,
10 9
@@ -76,8 +75,7 @@ enum ip_conntrack_status {
76}; 75};
77 76
78#ifdef __KERNEL__ 77#ifdef __KERNEL__
79struct ip_conntrack_stat 78struct ip_conntrack_stat {
80{
81 unsigned int searched; 79 unsigned int searched;
82 unsigned int found; 80 unsigned int found;
83 unsigned int new; 81 unsigned int new;
diff --git a/include/linux/netfilter/nf_conntrack_ftp.h b/include/linux/netfilter/nf_conntrack_ftp.h
index 47727d7546ea..3e3aa08980c3 100644
--- a/include/linux/netfilter/nf_conntrack_ftp.h
+++ b/include/linux/netfilter/nf_conntrack_ftp.h
@@ -3,8 +3,7 @@
3/* FTP tracking. */ 3/* FTP tracking. */
4 4
5/* This enum is exposed to userspace */ 5/* This enum is exposed to userspace */
6enum nf_ct_ftp_type 6enum nf_ct_ftp_type {
7{
8 /* PORT command from client */ 7 /* PORT command from client */
9 NF_CT_FTP_PORT, 8 NF_CT_FTP_PORT,
10 /* PASV response from server */ 9 /* PASV response from server */
diff --git a/include/linux/netfilter/nf_conntrack_sctp.h b/include/linux/netfilter/nf_conntrack_sctp.h
index 768f78c4ac53..ceeefe6681b5 100644
--- a/include/linux/netfilter/nf_conntrack_sctp.h
+++ b/include/linux/netfilter/nf_conntrack_sctp.h
@@ -16,8 +16,7 @@ enum sctp_conntrack {
16 SCTP_CONNTRACK_MAX 16 SCTP_CONNTRACK_MAX
17}; 17};
18 18
19struct ip_ct_sctp 19struct ip_ct_sctp {
20{
21 enum sctp_conntrack state; 20 enum sctp_conntrack state;
22 21
23 __be32 vtag[IP_CT_DIR_MAX]; 22 __be32 vtag[IP_CT_DIR_MAX];
diff --git a/include/linux/netfilter/nf_conntrack_tcp.h b/include/linux/netfilter/nf_conntrack_tcp.h
index 4352feed2377..6e135f97e59a 100644
--- a/include/linux/netfilter/nf_conntrack_tcp.h
+++ b/include/linux/netfilter/nf_conntrack_tcp.h
@@ -55,8 +55,7 @@ struct ip_ct_tcp_state {
55 u_int8_t flags; /* per direction options */ 55 u_int8_t flags; /* per direction options */
56}; 56};
57 57
58struct ip_ct_tcp 58struct ip_ct_tcp {
59{
60 struct ip_ct_tcp_state seen[2]; /* connection parameters per direction */ 59 struct ip_ct_tcp_state seen[2]; /* connection parameters per direction */
61 u_int8_t state; /* state of the connection (enum tcp_conntrack) */ 60 u_int8_t state; /* state of the connection (enum tcp_conntrack) */
62 /* For detecting stale connections */ 61 /* For detecting stale connections */
@@ -67,6 +66,9 @@ struct ip_ct_tcp
67 u_int32_t last_ack; /* Last sequence number seen in opposite dir */ 66 u_int32_t last_ack; /* Last sequence number seen in opposite dir */
68 u_int32_t last_end; /* Last seq + len */ 67 u_int32_t last_end; /* Last seq + len */
69 u_int16_t last_win; /* Last window advertisement seen in dir */ 68 u_int16_t last_win; /* Last window advertisement seen in dir */
69 /* For SYN packets while we may be out-of-sync */
70 u_int8_t last_wscale; /* Last window scaling factor seen */
71 u_int8_t last_flags; /* Last flags set */
70}; 72};
71 73
72#endif /* __KERNEL__ */ 74#endif /* __KERNEL__ */
diff --git a/include/linux/netfilter/nfnetlink.h b/include/linux/netfilter/nfnetlink.h
index 9f00da287f2c..49d321f3ccd2 100644
--- a/include/linux/netfilter/nfnetlink.h
+++ b/include/linux/netfilter/nfnetlink.h
@@ -55,8 +55,7 @@ struct nfgenmsg {
55#include <linux/capability.h> 55#include <linux/capability.h>
56#include <net/netlink.h> 56#include <net/netlink.h>
57 57
58struct nfnl_callback 58struct nfnl_callback {
59{
60 int (*call)(struct sock *nl, struct sk_buff *skb, 59 int (*call)(struct sock *nl, struct sk_buff *skb,
61 const struct nlmsghdr *nlh, 60 const struct nlmsghdr *nlh,
62 const struct nlattr * const cda[]); 61 const struct nlattr * const cda[]);
@@ -64,8 +63,7 @@ struct nfnl_callback
64 const u_int16_t attr_count; /* number of nlattr's */ 63 const u_int16_t attr_count; /* number of nlattr's */
65}; 64};
66 65
67struct nfnetlink_subsystem 66struct nfnetlink_subsystem {
68{
69 const char *name; 67 const char *name;
70 __u8 subsys_id; /* nfnetlink subsystem ID */ 68 __u8 subsys_id; /* nfnetlink subsystem ID */
71 __u8 cb_count; /* number of callbacks */ 69 __u8 cb_count; /* number of callbacks */
diff --git a/include/linux/netfilter/nfnetlink_compat.h b/include/linux/netfilter/nfnetlink_compat.h
index eda55cabceec..ffb95036bbd4 100644
--- a/include/linux/netfilter/nfnetlink_compat.h
+++ b/include/linux/netfilter/nfnetlink_compat.h
@@ -21,8 +21,7 @@
21 * ! nfnetlink use the same attributes methods. - J. Schulist. 21 * ! nfnetlink use the same attributes methods. - J. Schulist.
22 */ 22 */
23 23
24struct nfattr 24struct nfattr {
25{
26 __u16 nfa_len; 25 __u16 nfa_len;
27 __u16 nfa_type; /* we use 15 bits for the type, and the highest 26 __u16 nfa_type; /* we use 15 bits for the type, and the highest
28 * bit to indicate whether the payload is nested */ 27 * bit to indicate whether the payload is nested */
diff --git a/include/linux/netfilter/x_tables.h b/include/linux/netfilter/x_tables.h
index 812cb153cabb..378f27ae7772 100644
--- a/include/linux/netfilter/x_tables.h
+++ b/include/linux/netfilter/x_tables.h
@@ -6,8 +6,7 @@
6#define XT_FUNCTION_MAXNAMELEN 30 6#define XT_FUNCTION_MAXNAMELEN 30
7#define XT_TABLE_MAXNAMELEN 32 7#define XT_TABLE_MAXNAMELEN 32
8 8
9struct xt_entry_match 9struct xt_entry_match {
10{
11 union { 10 union {
12 struct { 11 struct {
13 __u16 match_size; 12 __u16 match_size;
@@ -31,8 +30,7 @@ struct xt_entry_match
31 unsigned char data[0]; 30 unsigned char data[0];
32}; 31};
33 32
34struct xt_entry_target 33struct xt_entry_target {
35{
36 union { 34 union {
37 struct { 35 struct {
38 __u16 target_size; 36 __u16 target_size;
@@ -64,16 +62,14 @@ struct xt_entry_target
64 }, \ 62 }, \
65} 63}
66 64
67struct xt_standard_target 65struct xt_standard_target {
68{
69 struct xt_entry_target target; 66 struct xt_entry_target target;
70 int verdict; 67 int verdict;
71}; 68};
72 69
73/* The argument to IPT_SO_GET_REVISION_*. Returns highest revision 70/* The argument to IPT_SO_GET_REVISION_*. Returns highest revision
74 * kernel supports, if >= revision. */ 71 * kernel supports, if >= revision. */
75struct xt_get_revision 72struct xt_get_revision {
76{
77 char name[XT_FUNCTION_MAXNAMELEN-1]; 73 char name[XT_FUNCTION_MAXNAMELEN-1];
78 74
79 __u8 revision; 75 __u8 revision;
@@ -90,8 +86,7 @@ struct xt_get_revision
90 * ip6t_entry and arpt_entry. This sucks, and it is a hack. It will be my 86 * ip6t_entry and arpt_entry. This sucks, and it is a hack. It will be my
91 * personal pleasure to remove it -HW 87 * personal pleasure to remove it -HW
92 */ 88 */
93struct _xt_align 89struct _xt_align {
94{
95 __u8 u8; 90 __u8 u8;
96 __u16 u16; 91 __u16 u16;
97 __u32 u32; 92 __u32 u32;
@@ -109,14 +104,12 @@ struct _xt_align
109#define SET_COUNTER(c,b,p) do { (c).bcnt = (b); (c).pcnt = (p); } while(0) 104#define SET_COUNTER(c,b,p) do { (c).bcnt = (b); (c).pcnt = (p); } while(0)
110#define ADD_COUNTER(c,b,p) do { (c).bcnt += (b); (c).pcnt += (p); } while(0) 105#define ADD_COUNTER(c,b,p) do { (c).bcnt += (b); (c).pcnt += (p); } while(0)
111 106
112struct xt_counters 107struct xt_counters {
113{
114 __u64 pcnt, bcnt; /* Packet and byte counters */ 108 __u64 pcnt, bcnt; /* Packet and byte counters */
115}; 109};
116 110
117/* The argument to IPT_SO_ADD_COUNTERS. */ 111/* The argument to IPT_SO_ADD_COUNTERS. */
118struct xt_counters_info 112struct xt_counters_info {
119{
120 /* Which table. */ 113 /* Which table. */
121 char name[XT_TABLE_MAXNAMELEN]; 114 char name[XT_TABLE_MAXNAMELEN];
122 115
@@ -269,8 +262,7 @@ struct xt_tgdtor_param {
269 u_int8_t family; 262 u_int8_t family;
270}; 263};
271 264
272struct xt_match 265struct xt_match {
273{
274 struct list_head list; 266 struct list_head list;
275 267
276 const char name[XT_FUNCTION_MAXNAMELEN-1]; 268 const char name[XT_FUNCTION_MAXNAMELEN-1];
@@ -310,8 +302,7 @@ struct xt_match
310}; 302};
311 303
312/* Registration hooks for targets. */ 304/* Registration hooks for targets. */
313struct xt_target 305struct xt_target {
314{
315 struct list_head list; 306 struct list_head list;
316 307
317 const char name[XT_FUNCTION_MAXNAMELEN-1]; 308 const char name[XT_FUNCTION_MAXNAMELEN-1];
@@ -349,8 +340,7 @@ struct xt_target
349}; 340};
350 341
351/* Furniture shopping... */ 342/* Furniture shopping... */
352struct xt_table 343struct xt_table {
353{
354 struct list_head list; 344 struct list_head list;
355 345
356 /* What hooks you will enter on */ 346 /* What hooks you will enter on */
@@ -371,8 +361,7 @@ struct xt_table
371#include <linux/netfilter_ipv4.h> 361#include <linux/netfilter_ipv4.h>
372 362
373/* The table itself */ 363/* The table itself */
374struct xt_table_info 364struct xt_table_info {
375{
376 /* Size per table */ 365 /* Size per table */
377 unsigned int size; 366 unsigned int size;
378 /* Number of entries: FIXME. --RR */ 367 /* Number of entries: FIXME. --RR */
@@ -528,8 +517,7 @@ static inline unsigned long ifname_compare_aligned(const char *_a,
528#ifdef CONFIG_COMPAT 517#ifdef CONFIG_COMPAT
529#include <net/compat.h> 518#include <net/compat.h>
530 519
531struct compat_xt_entry_match 520struct compat_xt_entry_match {
532{
533 union { 521 union {
534 struct { 522 struct {
535 u_int16_t match_size; 523 u_int16_t match_size;
@@ -545,8 +533,7 @@ struct compat_xt_entry_match
545 unsigned char data[0]; 533 unsigned char data[0];
546}; 534};
547 535
548struct compat_xt_entry_target 536struct compat_xt_entry_target {
549{
550 union { 537 union {
551 struct { 538 struct {
552 u_int16_t target_size; 539 u_int16_t target_size;
@@ -566,8 +553,7 @@ struct compat_xt_entry_target
566 * need to change whole approach in order to calculate align as function of 553 * need to change whole approach in order to calculate align as function of
567 * current task alignment */ 554 * current task alignment */
568 555
569struct compat_xt_counters 556struct compat_xt_counters {
570{
571#if defined(CONFIG_X86_64) || defined(CONFIG_IA64) 557#if defined(CONFIG_X86_64) || defined(CONFIG_IA64)
572 u_int32_t cnt[4]; 558 u_int32_t cnt[4];
573#else 559#else
@@ -575,8 +561,7 @@ struct compat_xt_counters
575#endif 561#endif
576}; 562};
577 563
578struct compat_xt_counters_info 564struct compat_xt_counters_info {
579{
580 char name[XT_TABLE_MAXNAMELEN]; 565 char name[XT_TABLE_MAXNAMELEN];
581 compat_uint_t num_counters; 566 compat_uint_t num_counters;
582 struct compat_xt_counters counters[0]; 567 struct compat_xt_counters counters[0];
diff --git a/include/linux/netfilter/xt_connbytes.h b/include/linux/netfilter/xt_connbytes.h
index 52bd6153b996..92fcbb0d193e 100644
--- a/include/linux/netfilter/xt_connbytes.h
+++ b/include/linux/netfilter/xt_connbytes.h
@@ -15,8 +15,7 @@ enum xt_connbytes_direction {
15 XT_CONNBYTES_DIR_BOTH, 15 XT_CONNBYTES_DIR_BOTH,
16}; 16};
17 17
18struct xt_connbytes_info 18struct xt_connbytes_info {
19{
20 struct { 19 struct {
21 aligned_u64 from; /* count to be matched */ 20 aligned_u64 from; /* count to be matched */
22 aligned_u64 to; /* count to be matched */ 21 aligned_u64 to; /* count to be matched */
diff --git a/include/linux/netfilter/xt_esp.h b/include/linux/netfilter/xt_esp.h
index ef6fa4747d0a..ee6882408000 100644
--- a/include/linux/netfilter/xt_esp.h
+++ b/include/linux/netfilter/xt_esp.h
@@ -3,8 +3,7 @@
3 3
4#include <linux/types.h> 4#include <linux/types.h>
5 5
6struct xt_esp 6struct xt_esp {
7{
8 __u32 spis[2]; /* Security Parameter Index */ 7 __u32 spis[2]; /* Security Parameter Index */
9 __u8 invflags; /* Inverse flags */ 8 __u8 invflags; /* Inverse flags */
10}; 9};
diff --git a/include/linux/netfilter/xt_multiport.h b/include/linux/netfilter/xt_multiport.h
index 185db499fcbc..5b7e72dfffc5 100644
--- a/include/linux/netfilter/xt_multiport.h
+++ b/include/linux/netfilter/xt_multiport.h
@@ -3,8 +3,7 @@
3 3
4#include <linux/types.h> 4#include <linux/types.h>
5 5
6enum xt_multiport_flags 6enum xt_multiport_flags {
7{
8 XT_MULTIPORT_SOURCE, 7 XT_MULTIPORT_SOURCE,
9 XT_MULTIPORT_DESTINATION, 8 XT_MULTIPORT_DESTINATION,
10 XT_MULTIPORT_EITHER 9 XT_MULTIPORT_EITHER
@@ -13,15 +12,13 @@ enum xt_multiport_flags
13#define XT_MULTI_PORTS 15 12#define XT_MULTI_PORTS 15
14 13
15/* Must fit inside union xt_matchinfo: 16 bytes */ 14/* Must fit inside union xt_matchinfo: 16 bytes */
16struct xt_multiport 15struct xt_multiport {
17{
18 __u8 flags; /* Type of comparison */ 16 __u8 flags; /* Type of comparison */
19 __u8 count; /* Number of ports */ 17 __u8 count; /* Number of ports */
20 __u16 ports[XT_MULTI_PORTS]; /* Ports */ 18 __u16 ports[XT_MULTI_PORTS]; /* Ports */
21}; 19};
22 20
23struct xt_multiport_v1 21struct xt_multiport_v1 {
24{
25 __u8 flags; /* Type of comparison */ 22 __u8 flags; /* Type of comparison */
26 __u8 count; /* Number of ports */ 23 __u8 count; /* Number of ports */
27 __u16 ports[XT_MULTI_PORTS]; /* Ports */ 24 __u16 ports[XT_MULTI_PORTS]; /* Ports */
diff --git a/include/linux/netfilter/xt_policy.h b/include/linux/netfilter/xt_policy.h
index 7bb64e7c853d..be8ead05c316 100644
--- a/include/linux/netfilter/xt_policy.h
+++ b/include/linux/netfilter/xt_policy.h
@@ -5,22 +5,19 @@
5 5
6#define XT_POLICY_MAX_ELEM 4 6#define XT_POLICY_MAX_ELEM 4
7 7
8enum xt_policy_flags 8enum xt_policy_flags {
9{
10 XT_POLICY_MATCH_IN = 0x1, 9 XT_POLICY_MATCH_IN = 0x1,
11 XT_POLICY_MATCH_OUT = 0x2, 10 XT_POLICY_MATCH_OUT = 0x2,
12 XT_POLICY_MATCH_NONE = 0x4, 11 XT_POLICY_MATCH_NONE = 0x4,
13 XT_POLICY_MATCH_STRICT = 0x8, 12 XT_POLICY_MATCH_STRICT = 0x8,
14}; 13};
15 14
16enum xt_policy_modes 15enum xt_policy_modes {
17{
18 XT_POLICY_MODE_TRANSPORT, 16 XT_POLICY_MODE_TRANSPORT,
19 XT_POLICY_MODE_TUNNEL 17 XT_POLICY_MODE_TUNNEL
20}; 18};
21 19
22struct xt_policy_spec 20struct xt_policy_spec {
23{
24 __u8 saddr:1, 21 __u8 saddr:1,
25 daddr:1, 22 daddr:1,
26 proto:1, 23 proto:1,
@@ -30,15 +27,13 @@ struct xt_policy_spec
30}; 27};
31 28
32#ifndef __KERNEL__ 29#ifndef __KERNEL__
33union xt_policy_addr 30union xt_policy_addr {
34{
35 struct in_addr a4; 31 struct in_addr a4;
36 struct in6_addr a6; 32 struct in6_addr a6;
37}; 33};
38#endif 34#endif
39 35
40struct xt_policy_elem 36struct xt_policy_elem {
41{
42 union { 37 union {
43#ifdef __KERNEL__ 38#ifdef __KERNEL__
44 struct { 39 struct {
@@ -65,8 +60,7 @@ struct xt_policy_elem
65 struct xt_policy_spec invert; 60 struct xt_policy_spec invert;
66}; 61};
67 62
68struct xt_policy_info 63struct xt_policy_info {
69{
70 struct xt_policy_elem pol[XT_POLICY_MAX_ELEM]; 64 struct xt_policy_elem pol[XT_POLICY_MAX_ELEM];
71 __u16 flags; 65 __u16 flags;
72 __u16 len; 66 __u16 len;
diff --git a/include/linux/netfilter/xt_state.h b/include/linux/netfilter/xt_state.h
index c06f32edee07..7b32de886613 100644
--- a/include/linux/netfilter/xt_state.h
+++ b/include/linux/netfilter/xt_state.h
@@ -6,8 +6,7 @@
6 6
7#define XT_STATE_UNTRACKED (1 << (IP_CT_NUMBER + 1)) 7#define XT_STATE_UNTRACKED (1 << (IP_CT_NUMBER + 1))
8 8
9struct xt_state_info 9struct xt_state_info {
10{
11 unsigned int statemask; 10 unsigned int statemask;
12}; 11};
13#endif /*_XT_STATE_H*/ 12#endif /*_XT_STATE_H*/
diff --git a/include/linux/netfilter/xt_string.h b/include/linux/netfilter/xt_string.h
index ecbb95fc89ed..235347c02eab 100644
--- a/include/linux/netfilter/xt_string.h
+++ b/include/linux/netfilter/xt_string.h
@@ -11,8 +11,7 @@ enum {
11 XT_STRING_FLAG_IGNORECASE = 0x02 11 XT_STRING_FLAG_IGNORECASE = 0x02
12}; 12};
13 13
14struct xt_string_info 14struct xt_string_info {
15{
16 __u16 from_offset; 15 __u16 from_offset;
17 __u16 to_offset; 16 __u16 to_offset;
18 char algo[XT_STRING_MAX_ALGO_NAME_SIZE]; 17 char algo[XT_STRING_MAX_ALGO_NAME_SIZE];
diff --git a/include/linux/netfilter/xt_tcpudp.h b/include/linux/netfilter/xt_tcpudp.h
index a490a0bc1d29..38aa7b399021 100644
--- a/include/linux/netfilter/xt_tcpudp.h
+++ b/include/linux/netfilter/xt_tcpudp.h
@@ -4,8 +4,7 @@
4#include <linux/types.h> 4#include <linux/types.h>
5 5
6/* TCP matching stuff */ 6/* TCP matching stuff */
7struct xt_tcp 7struct xt_tcp {
8{
9 __u16 spts[2]; /* Source port range. */ 8 __u16 spts[2]; /* Source port range. */
10 __u16 dpts[2]; /* Destination port range. */ 9 __u16 dpts[2]; /* Destination port range. */
11 __u8 option; /* TCP Option iff non-zero*/ 10 __u8 option; /* TCP Option iff non-zero*/
@@ -22,8 +21,7 @@ struct xt_tcp
22#define XT_TCP_INV_MASK 0x0F /* All possible flags. */ 21#define XT_TCP_INV_MASK 0x0F /* All possible flags. */
23 22
24/* UDP matching stuff */ 23/* UDP matching stuff */
25struct xt_udp 24struct xt_udp {
26{
27 __u16 spts[2]; /* Source port range. */ 25 __u16 spts[2]; /* Source port range. */
28 __u16 dpts[2]; /* Destination port range. */ 26 __u16 dpts[2]; /* Destination port range. */
29 __u8 invflags; /* Inverse flags */ 27 __u8 invflags; /* Inverse flags */
diff --git a/include/linux/netfilter_arp/arp_tables.h b/include/linux/netfilter_arp/arp_tables.h
index 6fe3e6aa10db..f2336523a9df 100644
--- a/include/linux/netfilter_arp/arp_tables.h
+++ b/include/linux/netfilter_arp/arp_tables.h
@@ -132,8 +132,7 @@ struct arpt_entry
132#define ARPT_RETURN XT_RETURN 132#define ARPT_RETURN XT_RETURN
133 133
134/* The argument to ARPT_SO_GET_INFO */ 134/* The argument to ARPT_SO_GET_INFO */
135struct arpt_getinfo 135struct arpt_getinfo {
136{
137 /* Which table: caller fills this in. */ 136 /* Which table: caller fills this in. */
138 char name[ARPT_TABLE_MAXNAMELEN]; 137 char name[ARPT_TABLE_MAXNAMELEN];
139 138
@@ -155,8 +154,7 @@ struct arpt_getinfo
155}; 154};
156 155
157/* The argument to ARPT_SO_SET_REPLACE. */ 156/* The argument to ARPT_SO_SET_REPLACE. */
158struct arpt_replace 157struct arpt_replace {
159{
160 /* Which table. */ 158 /* Which table. */
161 char name[ARPT_TABLE_MAXNAMELEN]; 159 char name[ARPT_TABLE_MAXNAMELEN];
162 160
@@ -191,8 +189,7 @@ struct arpt_replace
191#define arpt_counters xt_counters 189#define arpt_counters xt_counters
192 190
193/* The argument to ARPT_SO_GET_ENTRIES. */ 191/* The argument to ARPT_SO_GET_ENTRIES. */
194struct arpt_get_entries 192struct arpt_get_entries {
195{
196 /* Which table: user fills this in. */ 193 /* Which table: user fills this in. */
197 char name[ARPT_TABLE_MAXNAMELEN]; 194 char name[ARPT_TABLE_MAXNAMELEN];
198 195
@@ -224,20 +221,17 @@ static __inline__ struct arpt_entry_target *arpt_get_target(struct arpt_entry *e
224#ifdef __KERNEL__ 221#ifdef __KERNEL__
225 222
226/* Standard entry. */ 223/* Standard entry. */
227struct arpt_standard 224struct arpt_standard {
228{
229 struct arpt_entry entry; 225 struct arpt_entry entry;
230 struct arpt_standard_target target; 226 struct arpt_standard_target target;
231}; 227};
232 228
233struct arpt_error_target 229struct arpt_error_target {
234{
235 struct arpt_entry_target target; 230 struct arpt_entry_target target;
236 char errorname[ARPT_FUNCTION_MAXNAMELEN]; 231 char errorname[ARPT_FUNCTION_MAXNAMELEN];
237}; 232};
238 233
239struct arpt_error 234struct arpt_error {
240{
241 struct arpt_entry entry; 235 struct arpt_entry entry;
242 struct arpt_error_target target; 236 struct arpt_error_target target;
243}; 237};
@@ -279,8 +273,7 @@ extern unsigned int arpt_do_table(struct sk_buff *skb,
279#ifdef CONFIG_COMPAT 273#ifdef CONFIG_COMPAT
280#include <net/compat.h> 274#include <net/compat.h>
281 275
282struct compat_arpt_entry 276struct compat_arpt_entry {
283{
284 struct arpt_arp arp; 277 struct arpt_arp arp;
285 u_int16_t target_offset; 278 u_int16_t target_offset;
286 u_int16_t next_offset; 279 u_int16_t next_offset;
diff --git a/include/linux/netfilter_bridge/ebt_802_3.h b/include/linux/netfilter_bridge/ebt_802_3.h
index a11b0c2017fd..c73ef0b18bdc 100644
--- a/include/linux/netfilter_bridge/ebt_802_3.h
+++ b/include/linux/netfilter_bridge/ebt_802_3.h
@@ -58,8 +58,7 @@ static inline struct ebt_802_3_hdr *ebt_802_3_hdr(const struct sk_buff *skb)
58} 58}
59#endif 59#endif
60 60
61struct ebt_802_3_info 61struct ebt_802_3_info {
62{
63 uint8_t sap; 62 uint8_t sap;
64 __be16 type; 63 __be16 type;
65 uint8_t bitmask; 64 uint8_t bitmask;
diff --git a/include/linux/netfilter_bridge/ebt_among.h b/include/linux/netfilter_bridge/ebt_among.h
index 7654069233ca..0009558609a7 100644
--- a/include/linux/netfilter_bridge/ebt_among.h
+++ b/include/linux/netfilter_bridge/ebt_among.h
@@ -29,14 +29,12 @@
29 * Yes, it is a memory overhead, but in 2003 AD, who cares? 29 * Yes, it is a memory overhead, but in 2003 AD, who cares?
30 */ 30 */
31 31
32struct ebt_mac_wormhash_tuple 32struct ebt_mac_wormhash_tuple {
33{
34 uint32_t cmp[2]; 33 uint32_t cmp[2];
35 __be32 ip; 34 __be32 ip;
36}; 35};
37 36
38struct ebt_mac_wormhash 37struct ebt_mac_wormhash {
39{
40 int table[257]; 38 int table[257];
41 int poolsize; 39 int poolsize;
42 struct ebt_mac_wormhash_tuple pool[0]; 40 struct ebt_mac_wormhash_tuple pool[0];
@@ -45,8 +43,7 @@ struct ebt_mac_wormhash
45#define ebt_mac_wormhash_size(x) ((x) ? sizeof(struct ebt_mac_wormhash) \ 43#define ebt_mac_wormhash_size(x) ((x) ? sizeof(struct ebt_mac_wormhash) \
46 + (x)->poolsize * sizeof(struct ebt_mac_wormhash_tuple) : 0) 44 + (x)->poolsize * sizeof(struct ebt_mac_wormhash_tuple) : 0)
47 45
48struct ebt_among_info 46struct ebt_among_info {
49{
50 int wh_dst_ofs; 47 int wh_dst_ofs;
51 int wh_src_ofs; 48 int wh_src_ofs;
52 int bitmask; 49 int bitmask;
diff --git a/include/linux/netfilter_bridge/ebt_arpreply.h b/include/linux/netfilter_bridge/ebt_arpreply.h
index 96a8339960e0..7e77896e1fbf 100644
--- a/include/linux/netfilter_bridge/ebt_arpreply.h
+++ b/include/linux/netfilter_bridge/ebt_arpreply.h
@@ -1,8 +1,7 @@
1#ifndef __LINUX_BRIDGE_EBT_ARPREPLY_H 1#ifndef __LINUX_BRIDGE_EBT_ARPREPLY_H
2#define __LINUX_BRIDGE_EBT_ARPREPLY_H 2#define __LINUX_BRIDGE_EBT_ARPREPLY_H
3 3
4struct ebt_arpreply_info 4struct ebt_arpreply_info {
5{
6 unsigned char mac[ETH_ALEN]; 5 unsigned char mac[ETH_ALEN];
7 int target; 6 int target;
8}; 7};
diff --git a/include/linux/netfilter_bridge/ebt_ip.h b/include/linux/netfilter_bridge/ebt_ip.h
index d6847475bf2e..6a708fb92241 100644
--- a/include/linux/netfilter_bridge/ebt_ip.h
+++ b/include/linux/netfilter_bridge/ebt_ip.h
@@ -26,8 +26,7 @@
26#define EBT_IP_MATCH "ip" 26#define EBT_IP_MATCH "ip"
27 27
28/* the same values are used for the invflags */ 28/* the same values are used for the invflags */
29struct ebt_ip_info 29struct ebt_ip_info {
30{
31 __be32 saddr; 30 __be32 saddr;
32 __be32 daddr; 31 __be32 daddr;
33 __be32 smsk; 32 __be32 smsk;
diff --git a/include/linux/netfilter_bridge/ebt_ip6.h b/include/linux/netfilter_bridge/ebt_ip6.h
index 2273c3ae33ca..e5de98701519 100644
--- a/include/linux/netfilter_bridge/ebt_ip6.h
+++ b/include/linux/netfilter_bridge/ebt_ip6.h
@@ -23,8 +23,7 @@
23#define EBT_IP6_MATCH "ip6" 23#define EBT_IP6_MATCH "ip6"
24 24
25/* the same values are used for the invflags */ 25/* the same values are used for the invflags */
26struct ebt_ip6_info 26struct ebt_ip6_info {
27{
28 struct in6_addr saddr; 27 struct in6_addr saddr;
29 struct in6_addr daddr; 28 struct in6_addr daddr;
30 struct in6_addr smsk; 29 struct in6_addr smsk;
diff --git a/include/linux/netfilter_bridge/ebt_limit.h b/include/linux/netfilter_bridge/ebt_limit.h
index d8b65000afe4..4bf76b751676 100644
--- a/include/linux/netfilter_bridge/ebt_limit.h
+++ b/include/linux/netfilter_bridge/ebt_limit.h
@@ -9,8 +9,7 @@
9/* 1/10,000 sec period => max of 10,000/sec. Min rate is then 429490 9/* 1/10,000 sec period => max of 10,000/sec. Min rate is then 429490
10 seconds, or one every 59 hours. */ 10 seconds, or one every 59 hours. */
11 11
12struct ebt_limit_info 12struct ebt_limit_info {
13{
14 u_int32_t avg; /* Average secs between packets * scale */ 13 u_int32_t avg; /* Average secs between packets * scale */
15 u_int32_t burst; /* Period multiplier for upper limit. */ 14 u_int32_t burst; /* Period multiplier for upper limit. */
16 15
diff --git a/include/linux/netfilter_bridge/ebt_log.h b/include/linux/netfilter_bridge/ebt_log.h
index b76e653157e5..cc2cdfb764bc 100644
--- a/include/linux/netfilter_bridge/ebt_log.h
+++ b/include/linux/netfilter_bridge/ebt_log.h
@@ -9,8 +9,7 @@
9#define EBT_LOG_PREFIX_SIZE 30 9#define EBT_LOG_PREFIX_SIZE 30
10#define EBT_LOG_WATCHER "log" 10#define EBT_LOG_WATCHER "log"
11 11
12struct ebt_log_info 12struct ebt_log_info {
13{
14 uint8_t loglevel; 13 uint8_t loglevel;
15 uint8_t prefix[EBT_LOG_PREFIX_SIZE]; 14 uint8_t prefix[EBT_LOG_PREFIX_SIZE];
16 uint32_t bitmask; 15 uint32_t bitmask;
diff --git a/include/linux/netfilter_bridge/ebt_mark_m.h b/include/linux/netfilter_bridge/ebt_mark_m.h
index 301524ff1065..9ceb10ec0ed6 100644
--- a/include/linux/netfilter_bridge/ebt_mark_m.h
+++ b/include/linux/netfilter_bridge/ebt_mark_m.h
@@ -4,8 +4,7 @@
4#define EBT_MARK_AND 0x01 4#define EBT_MARK_AND 0x01
5#define EBT_MARK_OR 0x02 5#define EBT_MARK_OR 0x02
6#define EBT_MARK_MASK (EBT_MARK_AND | EBT_MARK_OR) 6#define EBT_MARK_MASK (EBT_MARK_AND | EBT_MARK_OR)
7struct ebt_mark_m_info 7struct ebt_mark_m_info {
8{
9 unsigned long mark, mask; 8 unsigned long mark, mask;
10 uint8_t invert; 9 uint8_t invert;
11 uint8_t bitmask; 10 uint8_t bitmask;
diff --git a/include/linux/netfilter_bridge/ebt_mark_t.h b/include/linux/netfilter_bridge/ebt_mark_t.h
index 6270f6f33693..7d5a268a4311 100644
--- a/include/linux/netfilter_bridge/ebt_mark_t.h
+++ b/include/linux/netfilter_bridge/ebt_mark_t.h
@@ -13,8 +13,7 @@
13#define MARK_AND_VALUE (0xffffffd0) 13#define MARK_AND_VALUE (0xffffffd0)
14#define MARK_XOR_VALUE (0xffffffc0) 14#define MARK_XOR_VALUE (0xffffffc0)
15 15
16struct ebt_mark_t_info 16struct ebt_mark_t_info {
17{
18 unsigned long mark; 17 unsigned long mark;
19 /* EBT_ACCEPT, EBT_DROP, EBT_CONTINUE or EBT_RETURN */ 18 /* EBT_ACCEPT, EBT_DROP, EBT_CONTINUE or EBT_RETURN */
20 int target; 19 int target;
diff --git a/include/linux/netfilter_bridge/ebt_nat.h b/include/linux/netfilter_bridge/ebt_nat.h
index 435b886a51aa..5e74e3b03bd6 100644
--- a/include/linux/netfilter_bridge/ebt_nat.h
+++ b/include/linux/netfilter_bridge/ebt_nat.h
@@ -2,8 +2,7 @@
2#define __LINUX_BRIDGE_EBT_NAT_H 2#define __LINUX_BRIDGE_EBT_NAT_H
3 3
4#define NAT_ARP_BIT (0x00000010) 4#define NAT_ARP_BIT (0x00000010)
5struct ebt_nat_info 5struct ebt_nat_info {
6{
7 unsigned char mac[ETH_ALEN]; 6 unsigned char mac[ETH_ALEN];
8 /* EBT_ACCEPT, EBT_DROP, EBT_CONTINUE or EBT_RETURN */ 7 /* EBT_ACCEPT, EBT_DROP, EBT_CONTINUE or EBT_RETURN */
9 int target; 8 int target;
diff --git a/include/linux/netfilter_bridge/ebt_pkttype.h b/include/linux/netfilter_bridge/ebt_pkttype.h
index 0d64bbb29c66..51a799840931 100644
--- a/include/linux/netfilter_bridge/ebt_pkttype.h
+++ b/include/linux/netfilter_bridge/ebt_pkttype.h
@@ -1,8 +1,7 @@
1#ifndef __LINUX_BRIDGE_EBT_PKTTYPE_H 1#ifndef __LINUX_BRIDGE_EBT_PKTTYPE_H
2#define __LINUX_BRIDGE_EBT_PKTTYPE_H 2#define __LINUX_BRIDGE_EBT_PKTTYPE_H
3 3
4struct ebt_pkttype_info 4struct ebt_pkttype_info {
5{
6 uint8_t pkt_type; 5 uint8_t pkt_type;
7 uint8_t invert; 6 uint8_t invert;
8}; 7};
diff --git a/include/linux/netfilter_bridge/ebt_redirect.h b/include/linux/netfilter_bridge/ebt_redirect.h
index 5c67990fce39..dd9622ce8488 100644
--- a/include/linux/netfilter_bridge/ebt_redirect.h
+++ b/include/linux/netfilter_bridge/ebt_redirect.h
@@ -1,8 +1,7 @@
1#ifndef __LINUX_BRIDGE_EBT_REDIRECT_H 1#ifndef __LINUX_BRIDGE_EBT_REDIRECT_H
2#define __LINUX_BRIDGE_EBT_REDIRECT_H 2#define __LINUX_BRIDGE_EBT_REDIRECT_H
3 3
4struct ebt_redirect_info 4struct ebt_redirect_info {
5{
6 /* EBT_ACCEPT, EBT_DROP, EBT_CONTINUE or EBT_RETURN */ 5 /* EBT_ACCEPT, EBT_DROP, EBT_CONTINUE or EBT_RETURN */
7 int target; 6 int target;
8}; 7};
diff --git a/include/linux/netfilter_bridge/ebt_stp.h b/include/linux/netfilter_bridge/ebt_stp.h
index e5fd67850f4d..e503a0aa2728 100644
--- a/include/linux/netfilter_bridge/ebt_stp.h
+++ b/include/linux/netfilter_bridge/ebt_stp.h
@@ -20,8 +20,7 @@
20 20
21#define EBT_STP_MATCH "stp" 21#define EBT_STP_MATCH "stp"
22 22
23struct ebt_stp_config_info 23struct ebt_stp_config_info {
24{
25 uint8_t flags; 24 uint8_t flags;
26 uint16_t root_priol, root_priou; 25 uint16_t root_priol, root_priou;
27 char root_addr[6], root_addrmsk[6]; 26 char root_addr[6], root_addrmsk[6];
@@ -35,8 +34,7 @@ struct ebt_stp_config_info
35 uint16_t forward_delayl, forward_delayu; 34 uint16_t forward_delayl, forward_delayu;
36}; 35};
37 36
38struct ebt_stp_info 37struct ebt_stp_info {
39{
40 uint8_t type; 38 uint8_t type;
41 struct ebt_stp_config_info config; 39 struct ebt_stp_config_info config;
42 uint16_t bitmask; 40 uint16_t bitmask;
diff --git a/include/linux/netfilter_bridge/ebtables.h b/include/linux/netfilter_bridge/ebtables.h
index ea281e6a2048..3cc40c131cc3 100644
--- a/include/linux/netfilter_bridge/ebtables.h
+++ b/include/linux/netfilter_bridge/ebtables.h
@@ -34,14 +34,12 @@
34struct xt_match; 34struct xt_match;
35struct xt_target; 35struct xt_target;
36 36
37struct ebt_counter 37struct ebt_counter {
38{
39 uint64_t pcnt; 38 uint64_t pcnt;
40 uint64_t bcnt; 39 uint64_t bcnt;
41}; 40};
42 41
43struct ebt_replace 42struct ebt_replace {
44{
45 char name[EBT_TABLE_MAXNAMELEN]; 43 char name[EBT_TABLE_MAXNAMELEN];
46 unsigned int valid_hooks; 44 unsigned int valid_hooks;
47 /* nr of rules in the table */ 45 /* nr of rules in the table */
@@ -57,8 +55,7 @@ struct ebt_replace
57 char __user *entries; 55 char __user *entries;
58}; 56};
59 57
60struct ebt_replace_kernel 58struct ebt_replace_kernel {
61{
62 char name[EBT_TABLE_MAXNAMELEN]; 59 char name[EBT_TABLE_MAXNAMELEN];
63 unsigned int valid_hooks; 60 unsigned int valid_hooks;
64 /* nr of rules in the table */ 61 /* nr of rules in the table */
@@ -120,8 +117,7 @@ struct ebt_entries {
120#define EBT_INV_MASK (EBT_IPROTO | EBT_IIN | EBT_IOUT | EBT_ILOGICALIN \ 117#define EBT_INV_MASK (EBT_IPROTO | EBT_IIN | EBT_IOUT | EBT_ILOGICALIN \
121 | EBT_ILOGICALOUT | EBT_ISOURCE | EBT_IDEST) 118 | EBT_ILOGICALOUT | EBT_ISOURCE | EBT_IDEST)
122 119
123struct ebt_entry_match 120struct ebt_entry_match {
124{
125 union { 121 union {
126 char name[EBT_FUNCTION_MAXNAMELEN]; 122 char name[EBT_FUNCTION_MAXNAMELEN];
127 struct xt_match *match; 123 struct xt_match *match;
@@ -131,8 +127,7 @@ struct ebt_entry_match
131 unsigned char data[0] __attribute__ ((aligned (__alignof__(struct ebt_replace)))); 127 unsigned char data[0] __attribute__ ((aligned (__alignof__(struct ebt_replace))));
132}; 128};
133 129
134struct ebt_entry_watcher 130struct ebt_entry_watcher {
135{
136 union { 131 union {
137 char name[EBT_FUNCTION_MAXNAMELEN]; 132 char name[EBT_FUNCTION_MAXNAMELEN];
138 struct xt_target *watcher; 133 struct xt_target *watcher;
@@ -142,8 +137,7 @@ struct ebt_entry_watcher
142 unsigned char data[0] __attribute__ ((aligned (__alignof__(struct ebt_replace)))); 137 unsigned char data[0] __attribute__ ((aligned (__alignof__(struct ebt_replace))));
143}; 138};
144 139
145struct ebt_entry_target 140struct ebt_entry_target {
146{
147 union { 141 union {
148 char name[EBT_FUNCTION_MAXNAMELEN]; 142 char name[EBT_FUNCTION_MAXNAMELEN];
149 struct xt_target *target; 143 struct xt_target *target;
@@ -154,8 +148,7 @@ struct ebt_entry_target
154}; 148};
155 149
156#define EBT_STANDARD_TARGET "standard" 150#define EBT_STANDARD_TARGET "standard"
157struct ebt_standard_target 151struct ebt_standard_target {
158{
159 struct ebt_entry_target target; 152 struct ebt_entry_target target;
160 int verdict; 153 int verdict;
161}; 154};
@@ -206,8 +199,7 @@ struct ebt_entry {
206#define EBT_MATCH 0 199#define EBT_MATCH 0
207#define EBT_NOMATCH 1 200#define EBT_NOMATCH 1
208 201
209struct ebt_match 202struct ebt_match {
210{
211 struct list_head list; 203 struct list_head list;
212 const char name[EBT_FUNCTION_MAXNAMELEN]; 204 const char name[EBT_FUNCTION_MAXNAMELEN];
213 bool (*match)(const struct sk_buff *skb, const struct net_device *in, 205 bool (*match)(const struct sk_buff *skb, const struct net_device *in,
@@ -224,8 +216,7 @@ struct ebt_match
224 struct module *me; 216 struct module *me;
225}; 217};
226 218
227struct ebt_watcher 219struct ebt_watcher {
228{
229 struct list_head list; 220 struct list_head list;
230 const char name[EBT_FUNCTION_MAXNAMELEN]; 221 const char name[EBT_FUNCTION_MAXNAMELEN];
231 unsigned int (*target)(struct sk_buff *skb, 222 unsigned int (*target)(struct sk_buff *skb,
@@ -242,8 +233,7 @@ struct ebt_watcher
242 struct module *me; 233 struct module *me;
243}; 234};
244 235
245struct ebt_target 236struct ebt_target {
246{
247 struct list_head list; 237 struct list_head list;
248 const char name[EBT_FUNCTION_MAXNAMELEN]; 238 const char name[EBT_FUNCTION_MAXNAMELEN];
249 /* returns one of the standard EBT_* verdicts */ 239 /* returns one of the standard EBT_* verdicts */
@@ -262,15 +252,13 @@ struct ebt_target
262}; 252};
263 253
264/* used for jumping from and into user defined chains (udc) */ 254/* used for jumping from and into user defined chains (udc) */
265struct ebt_chainstack 255struct ebt_chainstack {
266{
267 struct ebt_entries *chaininfo; /* pointer to chain data */ 256 struct ebt_entries *chaininfo; /* pointer to chain data */
268 struct ebt_entry *e; /* pointer to entry data */ 257 struct ebt_entry *e; /* pointer to entry data */
269 unsigned int n; /* n'th entry */ 258 unsigned int n; /* n'th entry */
270}; 259};
271 260
272struct ebt_table_info 261struct ebt_table_info {
273{
274 /* total size of the entries */ 262 /* total size of the entries */
275 unsigned int entries_size; 263 unsigned int entries_size;
276 unsigned int nentries; 264 unsigned int nentries;
@@ -282,8 +270,7 @@ struct ebt_table_info
282 struct ebt_counter counters[0] ____cacheline_aligned; 270 struct ebt_counter counters[0] ____cacheline_aligned;
283}; 271};
284 272
285struct ebt_table 273struct ebt_table {
286{
287 struct list_head list; 274 struct list_head list;
288 char name[EBT_TABLE_MAXNAMELEN]; 275 char name[EBT_TABLE_MAXNAMELEN];
289 struct ebt_replace_kernel *table; 276 struct ebt_replace_kernel *table;
diff --git a/include/linux/netfilter_ipv4/ip_tables.h b/include/linux/netfilter_ipv4/ip_tables.h
index 61fafc868a7b..27b3f5807305 100644
--- a/include/linux/netfilter_ipv4/ip_tables.h
+++ b/include/linux/netfilter_ipv4/ip_tables.h
@@ -76,8 +76,7 @@ struct ipt_ip {
76/* This structure defines each of the firewall rules. Consists of 3 76/* This structure defines each of the firewall rules. Consists of 3
77 parts which are 1) general IP header stuff 2) match specific 77 parts which are 1) general IP header stuff 2) match specific
78 stuff 3) the target to perform if the rule matches */ 78 stuff 3) the target to perform if the rule matches */
79struct ipt_entry 79struct ipt_entry {
80{
81 struct ipt_ip ip; 80 struct ipt_ip ip;
82 81
83 /* Mark with fields that we care about. */ 82 /* Mark with fields that we care about. */
@@ -135,8 +134,7 @@ struct ipt_entry
135#define IPT_UDP_INV_MASK XT_UDP_INV_MASK 134#define IPT_UDP_INV_MASK XT_UDP_INV_MASK
136 135
137/* ICMP matching stuff */ 136/* ICMP matching stuff */
138struct ipt_icmp 137struct ipt_icmp {
139{
140 u_int8_t type; /* type to match */ 138 u_int8_t type; /* type to match */
141 u_int8_t code[2]; /* range of code */ 139 u_int8_t code[2]; /* range of code */
142 u_int8_t invflags; /* Inverse flags */ 140 u_int8_t invflags; /* Inverse flags */
@@ -146,8 +144,7 @@ struct ipt_icmp
146#define IPT_ICMP_INV 0x01 /* Invert the sense of type/code test */ 144#define IPT_ICMP_INV 0x01 /* Invert the sense of type/code test */
147 145
148/* The argument to IPT_SO_GET_INFO */ 146/* The argument to IPT_SO_GET_INFO */
149struct ipt_getinfo 147struct ipt_getinfo {
150{
151 /* Which table: caller fills this in. */ 148 /* Which table: caller fills this in. */
152 char name[IPT_TABLE_MAXNAMELEN]; 149 char name[IPT_TABLE_MAXNAMELEN];
153 150
@@ -169,8 +166,7 @@ struct ipt_getinfo
169}; 166};
170 167
171/* The argument to IPT_SO_SET_REPLACE. */ 168/* The argument to IPT_SO_SET_REPLACE. */
172struct ipt_replace 169struct ipt_replace {
173{
174 /* Which table. */ 170 /* Which table. */
175 char name[IPT_TABLE_MAXNAMELEN]; 171 char name[IPT_TABLE_MAXNAMELEN];
176 172
@@ -204,8 +200,7 @@ struct ipt_replace
204#define ipt_counters_info xt_counters_info 200#define ipt_counters_info xt_counters_info
205 201
206/* The argument to IPT_SO_GET_ENTRIES. */ 202/* The argument to IPT_SO_GET_ENTRIES. */
207struct ipt_get_entries 203struct ipt_get_entries {
208{
209 /* Which table: user fills this in. */ 204 /* Which table: user fills this in. */
210 char name[IPT_TABLE_MAXNAMELEN]; 205 char name[IPT_TABLE_MAXNAMELEN];
211 206
@@ -250,20 +245,17 @@ extern struct xt_table *ipt_register_table(struct net *net,
250extern void ipt_unregister_table(struct xt_table *table); 245extern void ipt_unregister_table(struct xt_table *table);
251 246
252/* Standard entry. */ 247/* Standard entry. */
253struct ipt_standard 248struct ipt_standard {
254{
255 struct ipt_entry entry; 249 struct ipt_entry entry;
256 struct ipt_standard_target target; 250 struct ipt_standard_target target;
257}; 251};
258 252
259struct ipt_error_target 253struct ipt_error_target {
260{
261 struct ipt_entry_target target; 254 struct ipt_entry_target target;
262 char errorname[IPT_FUNCTION_MAXNAMELEN]; 255 char errorname[IPT_FUNCTION_MAXNAMELEN];
263}; 256};
264 257
265struct ipt_error 258struct ipt_error {
266{
267 struct ipt_entry entry; 259 struct ipt_entry entry;
268 struct ipt_error_target target; 260 struct ipt_error_target target;
269}; 261};
@@ -301,8 +293,7 @@ extern unsigned int ipt_do_table(struct sk_buff *skb,
301#ifdef CONFIG_COMPAT 293#ifdef CONFIG_COMPAT
302#include <net/compat.h> 294#include <net/compat.h>
303 295
304struct compat_ipt_entry 296struct compat_ipt_entry {
305{
306 struct ipt_ip ip; 297 struct ipt_ip ip;
307 compat_uint_t nfcache; 298 compat_uint_t nfcache;
308 u_int16_t target_offset; 299 u_int16_t target_offset;
diff --git a/include/linux/netfilter_ipv4/ipt_SAME.h b/include/linux/netfilter_ipv4/ipt_SAME.h
index be6e682a85ec..2529660c5b38 100644
--- a/include/linux/netfilter_ipv4/ipt_SAME.h
+++ b/include/linux/netfilter_ipv4/ipt_SAME.h
@@ -5,8 +5,7 @@
5 5
6#define IPT_SAME_NODST 0x01 6#define IPT_SAME_NODST 0x01
7 7
8struct ipt_same_info 8struct ipt_same_info {
9{
10 unsigned char info; 9 unsigned char info;
11 u_int32_t rangesize; 10 u_int32_t rangesize;
12 u_int32_t ipnum; 11 u_int32_t ipnum;
diff --git a/include/linux/netfilter_ipv4/ipt_ah.h b/include/linux/netfilter_ipv4/ipt_ah.h
index 7b9a2ac7adb9..2e555b4d05e3 100644
--- a/include/linux/netfilter_ipv4/ipt_ah.h
+++ b/include/linux/netfilter_ipv4/ipt_ah.h
@@ -1,8 +1,7 @@
1#ifndef _IPT_AH_H 1#ifndef _IPT_AH_H
2#define _IPT_AH_H 2#define _IPT_AH_H
3 3
4struct ipt_ah 4struct ipt_ah {
5{
6 u_int32_t spis[2]; /* Security Parameter Index */ 5 u_int32_t spis[2]; /* Security Parameter Index */
7 u_int8_t invflags; /* Inverse flags */ 6 u_int8_t invflags; /* Inverse flags */
8}; 7};
diff --git a/include/linux/netfilter_ipv6/ip6_tables.h b/include/linux/netfilter_ipv6/ip6_tables.h
index a64e1451ac38..b31050d20ae4 100644
--- a/include/linux/netfilter_ipv6/ip6_tables.h
+++ b/include/linux/netfilter_ipv6/ip6_tables.h
@@ -88,8 +88,7 @@ struct ip6t_ip6 {
88/* This structure defines each of the firewall rules. Consists of 3 88/* This structure defines each of the firewall rules. Consists of 3
89 parts which are 1) general IP header stuff 2) match specific 89 parts which are 1) general IP header stuff 2) match specific
90 stuff 3) the target to perform if the rule matches */ 90 stuff 3) the target to perform if the rule matches */
91struct ip6t_entry 91struct ip6t_entry {
92{
93 struct ip6t_ip6 ipv6; 92 struct ip6t_ip6 ipv6;
94 93
95 /* Mark with fields that we care about. */ 94 /* Mark with fields that we care about. */
@@ -111,20 +110,17 @@ struct ip6t_entry
111}; 110};
112 111
113/* Standard entry */ 112/* Standard entry */
114struct ip6t_standard 113struct ip6t_standard {
115{
116 struct ip6t_entry entry; 114 struct ip6t_entry entry;
117 struct ip6t_standard_target target; 115 struct ip6t_standard_target target;
118}; 116};
119 117
120struct ip6t_error_target 118struct ip6t_error_target {
121{
122 struct ip6t_entry_target target; 119 struct ip6t_entry_target target;
123 char errorname[IP6T_FUNCTION_MAXNAMELEN]; 120 char errorname[IP6T_FUNCTION_MAXNAMELEN];
124}; 121};
125 122
126struct ip6t_error 123struct ip6t_error {
127{
128 struct ip6t_entry entry; 124 struct ip6t_entry entry;
129 struct ip6t_error_target target; 125 struct ip6t_error_target target;
130}; 126};
@@ -195,8 +191,7 @@ struct ip6t_error
195#define IP6T_UDP_INV_MASK XT_UDP_INV_MASK 191#define IP6T_UDP_INV_MASK XT_UDP_INV_MASK
196 192
197/* ICMP matching stuff */ 193/* ICMP matching stuff */
198struct ip6t_icmp 194struct ip6t_icmp {
199{
200 u_int8_t type; /* type to match */ 195 u_int8_t type; /* type to match */
201 u_int8_t code[2]; /* range of code */ 196 u_int8_t code[2]; /* range of code */
202 u_int8_t invflags; /* Inverse flags */ 197 u_int8_t invflags; /* Inverse flags */
@@ -206,8 +201,7 @@ struct ip6t_icmp
206#define IP6T_ICMP_INV 0x01 /* Invert the sense of type/code test */ 201#define IP6T_ICMP_INV 0x01 /* Invert the sense of type/code test */
207 202
208/* The argument to IP6T_SO_GET_INFO */ 203/* The argument to IP6T_SO_GET_INFO */
209struct ip6t_getinfo 204struct ip6t_getinfo {
210{
211 /* Which table: caller fills this in. */ 205 /* Which table: caller fills this in. */
212 char name[IP6T_TABLE_MAXNAMELEN]; 206 char name[IP6T_TABLE_MAXNAMELEN];
213 207
@@ -229,8 +223,7 @@ struct ip6t_getinfo
229}; 223};
230 224
231/* The argument to IP6T_SO_SET_REPLACE. */ 225/* The argument to IP6T_SO_SET_REPLACE. */
232struct ip6t_replace 226struct ip6t_replace {
233{
234 /* Which table. */ 227 /* Which table. */
235 char name[IP6T_TABLE_MAXNAMELEN]; 228 char name[IP6T_TABLE_MAXNAMELEN];
236 229
@@ -264,8 +257,7 @@ struct ip6t_replace
264#define ip6t_counters_info xt_counters_info 257#define ip6t_counters_info xt_counters_info
265 258
266/* The argument to IP6T_SO_GET_ENTRIES. */ 259/* The argument to IP6T_SO_GET_ENTRIES. */
267struct ip6t_get_entries 260struct ip6t_get_entries {
268{
269 /* Which table: user fills this in. */ 261 /* Which table: user fills this in. */
270 char name[IP6T_TABLE_MAXNAMELEN]; 262 char name[IP6T_TABLE_MAXNAMELEN];
271 263
@@ -330,8 +322,7 @@ extern int ip6_masked_addrcmp(const struct in6_addr *addr1,
330#ifdef CONFIG_COMPAT 322#ifdef CONFIG_COMPAT
331#include <net/compat.h> 323#include <net/compat.h>
332 324
333struct compat_ip6t_entry 325struct compat_ip6t_entry {
334{
335 struct ip6t_ip6 ipv6; 326 struct ip6t_ip6 ipv6;
336 compat_uint_t nfcache; 327 compat_uint_t nfcache;
337 u_int16_t target_offset; 328 u_int16_t target_offset;
diff --git a/include/linux/netfilter_ipv6/ip6t_ah.h b/include/linux/netfilter_ipv6/ip6t_ah.h
index 8531879eb464..17a745cfb2c7 100644
--- a/include/linux/netfilter_ipv6/ip6t_ah.h
+++ b/include/linux/netfilter_ipv6/ip6t_ah.h
@@ -1,8 +1,7 @@
1#ifndef _IP6T_AH_H 1#ifndef _IP6T_AH_H
2#define _IP6T_AH_H 2#define _IP6T_AH_H
3 3
4struct ip6t_ah 4struct ip6t_ah {
5{
6 u_int32_t spis[2]; /* Security Parameter Index */ 5 u_int32_t spis[2]; /* Security Parameter Index */
7 u_int32_t hdrlen; /* Header Length */ 6 u_int32_t hdrlen; /* Header Length */
8 u_int8_t hdrres; /* Test of the Reserved Filed */ 7 u_int8_t hdrres; /* Test of the Reserved Filed */
diff --git a/include/linux/netfilter_ipv6/ip6t_frag.h b/include/linux/netfilter_ipv6/ip6t_frag.h
index 66070a0d6dfc..3724d0850920 100644
--- a/include/linux/netfilter_ipv6/ip6t_frag.h
+++ b/include/linux/netfilter_ipv6/ip6t_frag.h
@@ -1,8 +1,7 @@
1#ifndef _IP6T_FRAG_H 1#ifndef _IP6T_FRAG_H
2#define _IP6T_FRAG_H 2#define _IP6T_FRAG_H
3 3
4struct ip6t_frag 4struct ip6t_frag {
5{
6 u_int32_t ids[2]; /* Security Parameter Index */ 5 u_int32_t ids[2]; /* Security Parameter Index */
7 u_int32_t hdrlen; /* Header Length */ 6 u_int32_t hdrlen; /* Header Length */
8 u_int8_t flags; /* */ 7 u_int8_t flags; /* */
diff --git a/include/linux/netfilter_ipv6/ip6t_ipv6header.h b/include/linux/netfilter_ipv6/ip6t_ipv6header.h
index 51c53fc9c44a..01dfd445596a 100644
--- a/include/linux/netfilter_ipv6/ip6t_ipv6header.h
+++ b/include/linux/netfilter_ipv6/ip6t_ipv6header.h
@@ -8,8 +8,7 @@ on whether they contain certain headers */
8#ifndef __IPV6HEADER_H 8#ifndef __IPV6HEADER_H
9#define __IPV6HEADER_H 9#define __IPV6HEADER_H
10 10
11struct ip6t_ipv6header_info 11struct ip6t_ipv6header_info {
12{
13 u_int8_t matchflags; 12 u_int8_t matchflags;
14 u_int8_t invflags; 13 u_int8_t invflags;
15 u_int8_t modeflag; 14 u_int8_t modeflag;
diff --git a/include/linux/netfilter_ipv6/ip6t_mh.h b/include/linux/netfilter_ipv6/ip6t_mh.h
index b9ca9a5f74d0..18549bca2d1f 100644
--- a/include/linux/netfilter_ipv6/ip6t_mh.h
+++ b/include/linux/netfilter_ipv6/ip6t_mh.h
@@ -2,8 +2,7 @@
2#define _IP6T_MH_H 2#define _IP6T_MH_H
3 3
4/* MH matching stuff */ 4/* MH matching stuff */
5struct ip6t_mh 5struct ip6t_mh {
6{
7 u_int8_t types[2]; /* MH type range */ 6 u_int8_t types[2]; /* MH type range */
8 u_int8_t invflags; /* Inverse flags */ 7 u_int8_t invflags; /* Inverse flags */
9}; 8};
diff --git a/include/linux/netfilter_ipv6/ip6t_opts.h b/include/linux/netfilter_ipv6/ip6t_opts.h
index a07e36380ae8..62d89bcd9f9c 100644
--- a/include/linux/netfilter_ipv6/ip6t_opts.h
+++ b/include/linux/netfilter_ipv6/ip6t_opts.h
@@ -3,8 +3,7 @@
3 3
4#define IP6T_OPTS_OPTSNR 16 4#define IP6T_OPTS_OPTSNR 16
5 5
6struct ip6t_opts 6struct ip6t_opts {
7{
8 u_int32_t hdrlen; /* Header Length */ 7 u_int32_t hdrlen; /* Header Length */
9 u_int8_t flags; /* */ 8 u_int8_t flags; /* */
10 u_int8_t invflags; /* Inverse flags */ 9 u_int8_t invflags; /* Inverse flags */
diff --git a/include/linux/netfilter_ipv6/ip6t_rt.h b/include/linux/netfilter_ipv6/ip6t_rt.h
index 52156023e8db..ab91bfd2cd00 100644
--- a/include/linux/netfilter_ipv6/ip6t_rt.h
+++ b/include/linux/netfilter_ipv6/ip6t_rt.h
@@ -5,8 +5,7 @@
5 5
6#define IP6T_RT_HOPS 16 6#define IP6T_RT_HOPS 16
7 7
8struct ip6t_rt 8struct ip6t_rt {
9{
10 u_int32_t rt_type; /* Routing Type */ 9 u_int32_t rt_type; /* Routing Type */
11 u_int32_t segsleft[2]; /* Segments Left */ 10 u_int32_t segsleft[2]; /* Segments Left */
12 u_int32_t hdrlen; /* Header Length */ 11 u_int32_t hdrlen; /* Header Length */
diff --git a/include/linux/netlink.h b/include/linux/netlink.h
index ab5d3126831f..fde27c017326 100644
--- a/include/linux/netlink.h
+++ b/include/linux/netlink.h
@@ -29,16 +29,14 @@
29 29
30struct net; 30struct net;
31 31
32struct sockaddr_nl 32struct sockaddr_nl {
33{
34 sa_family_t nl_family; /* AF_NETLINK */ 33 sa_family_t nl_family; /* AF_NETLINK */
35 unsigned short nl_pad; /* zero */ 34 unsigned short nl_pad; /* zero */
36 __u32 nl_pid; /* port ID */ 35 __u32 nl_pid; /* port ID */
37 __u32 nl_groups; /* multicast groups mask */ 36 __u32 nl_groups; /* multicast groups mask */
38}; 37};
39 38
40struct nlmsghdr 39struct nlmsghdr {
41{
42 __u32 nlmsg_len; /* Length of message including header */ 40 __u32 nlmsg_len; /* Length of message including header */
43 __u16 nlmsg_type; /* Message content */ 41 __u16 nlmsg_type; /* Message content */
44 __u16 nlmsg_flags; /* Additional flags */ 42 __u16 nlmsg_flags; /* Additional flags */
@@ -94,8 +92,7 @@ struct nlmsghdr
94 92
95#define NLMSG_MIN_TYPE 0x10 /* < 0x10: reserved control messages */ 93#define NLMSG_MIN_TYPE 0x10 /* < 0x10: reserved control messages */
96 94
97struct nlmsgerr 95struct nlmsgerr {
98{
99 int error; 96 int error;
100 struct nlmsghdr msg; 97 struct nlmsghdr msg;
101}; 98};
@@ -106,8 +103,7 @@ struct nlmsgerr
106#define NETLINK_BROADCAST_ERROR 4 103#define NETLINK_BROADCAST_ERROR 4
107#define NETLINK_NO_ENOBUFS 5 104#define NETLINK_NO_ENOBUFS 5
108 105
109struct nl_pktinfo 106struct nl_pktinfo {
110{
111 __u32 group; 107 __u32 group;
112}; 108};
113 109
@@ -127,8 +123,7 @@ enum {
127 * <-------------- nlattr->nla_len --------------> 123 * <-------------- nlattr->nla_len -------------->
128 */ 124 */
129 125
130struct nlattr 126struct nlattr {
131{
132 __u16 nla_len; 127 __u16 nla_len;
133 __u16 nla_type; 128 __u16 nla_type;
134}; 129};
@@ -161,8 +156,7 @@ static inline struct nlmsghdr *nlmsg_hdr(const struct sk_buff *skb)
161 return (struct nlmsghdr *)skb->data; 156 return (struct nlmsghdr *)skb->data;
162} 157}
163 158
164struct netlink_skb_parms 159struct netlink_skb_parms {
165{
166 struct ucred creds; /* Skb credentials */ 160 struct ucred creds; /* Skb credentials */
167 __u32 pid; 161 __u32 pid;
168 __u32 dst_group; 162 __u32 dst_group;
@@ -220,8 +214,7 @@ int netlink_sendskb(struct sock *sk, struct sk_buff *skb);
220#define NLMSG_DEFAULT_SIZE (NLMSG_GOODSIZE - NLMSG_HDRLEN) 214#define NLMSG_DEFAULT_SIZE (NLMSG_GOODSIZE - NLMSG_HDRLEN)
221 215
222 216
223struct netlink_callback 217struct netlink_callback {
224{
225 struct sk_buff *skb; 218 struct sk_buff *skb;
226 const struct nlmsghdr *nlh; 219 const struct nlmsghdr *nlh;
227 int (*dump)(struct sk_buff * skb, 220 int (*dump)(struct sk_buff * skb,
@@ -231,8 +224,7 @@ struct netlink_callback
231 long args[6]; 224 long args[6];
232}; 225};
233 226
234struct netlink_notify 227struct netlink_notify {
235{
236 struct net *net; 228 struct net *net;
237 int pid; 229 int pid;
238 int protocol; 230 int protocol;
diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h
index a8d71ed43a0e..da8ea2e19273 100644
--- a/include/linux/nl80211.h
+++ b/include/linux/nl80211.h
@@ -160,6 +160,11 @@
160 * @NL80211_CMD_SCAN_ABORTED: scan was aborted, for unspecified reasons, 160 * @NL80211_CMD_SCAN_ABORTED: scan was aborted, for unspecified reasons,
161 * partial scan results may be available 161 * partial scan results may be available
162 * 162 *
163 * @NL80211_CMD_GET_SURVEY: get survey resuls, e.g. channel occupation
164 * or noise level
165 * @NL80211_CMD_NEW_SURVEY_RESULTS: survey data notification (as a reply to
166 * NL80211_CMD_GET_SURVEY and on the "scan" multicast group)
167 *
163 * @NL80211_CMD_REG_CHANGE: indicates to userspace the regulatory domain 168 * @NL80211_CMD_REG_CHANGE: indicates to userspace the regulatory domain
164 * has been changed and provides details of the request information 169 * has been changed and provides details of the request information
165 * that caused the change such as who initiated the regulatory request 170 * that caused the change such as who initiated the regulatory request
@@ -341,6 +346,13 @@ enum nl80211_commands {
341 346
342 NL80211_CMD_SET_WIPHY_NETNS, 347 NL80211_CMD_SET_WIPHY_NETNS,
343 348
349 NL80211_CMD_GET_SURVEY,
350 NL80211_CMD_NEW_SURVEY_RESULTS,
351
352 NL80211_CMD_SET_PMKSA,
353 NL80211_CMD_DEL_PMKSA,
354 NL80211_CMD_FLUSH_PMKSA,
355
344 /* add new commands above here */ 356 /* add new commands above here */
345 357
346 /* used to define NL80211_CMD_MAX below */ 358 /* used to define NL80211_CMD_MAX below */
@@ -584,6 +596,16 @@ enum nl80211_commands {
584 * changed then the list changed and the dump should be repeated 596 * changed then the list changed and the dump should be repeated
585 * completely from scratch. 597 * completely from scratch.
586 * 598 *
599 * @NL80211_ATTR_4ADDR: Use 4-address frames on a virtual interface
600 *
601 * @NL80211_ATTR_SURVEY_INFO: survey information about a channel, part of
602 * the survey response for %NL80211_CMD_GET_SURVEY, nested attribute
603 * containing info as possible, see &enum survey_info.
604 *
605 * @NL80211_ATTR_PMKID: PMK material for PMKSA caching.
606 * @NL80211_ATTR_MAX_NUM_PMKIDS: maximum number of PMKIDs a firmware can
607 * cache, a wiphy attribute.
608 *
587 * @NL80211_ATTR_MAX: highest attribute number currently defined 609 * @NL80211_ATTR_MAX: highest attribute number currently defined
588 * @__NL80211_ATTR_AFTER_LAST: internal use 610 * @__NL80211_ATTR_AFTER_LAST: internal use
589 */ 611 */
@@ -714,6 +736,13 @@ enum nl80211_attrs {
714 736
715 NL80211_ATTR_PID, 737 NL80211_ATTR_PID,
716 738
739 NL80211_ATTR_4ADDR,
740
741 NL80211_ATTR_SURVEY_INFO,
742
743 NL80211_ATTR_PMKID,
744 NL80211_ATTR_MAX_NUM_PMKIDS,
745
717 /* add attributes here, update the policy in nl80211.c */ 746 /* add attributes here, update the policy in nl80211.c */
718 747
719 __NL80211_ATTR_AFTER_LAST, 748 __NL80211_ATTR_AFTER_LAST,
@@ -895,14 +924,14 @@ enum nl80211_sta_info {
895 * 924 *
896 * @NL80211_MPATH_FLAG_ACTIVE: the mesh path is active 925 * @NL80211_MPATH_FLAG_ACTIVE: the mesh path is active
897 * @NL80211_MPATH_FLAG_RESOLVING: the mesh path discovery process is running 926 * @NL80211_MPATH_FLAG_RESOLVING: the mesh path discovery process is running
898 * @NL80211_MPATH_FLAG_DSN_VALID: the mesh path contains a valid DSN 927 * @NL80211_MPATH_FLAG_SN_VALID: the mesh path contains a valid SN
899 * @NL80211_MPATH_FLAG_FIXED: the mesh path has been manually set 928 * @NL80211_MPATH_FLAG_FIXED: the mesh path has been manually set
900 * @NL80211_MPATH_FLAG_RESOLVED: the mesh path discovery process succeeded 929 * @NL80211_MPATH_FLAG_RESOLVED: the mesh path discovery process succeeded
901 */ 930 */
902enum nl80211_mpath_flags { 931enum nl80211_mpath_flags {
903 NL80211_MPATH_FLAG_ACTIVE = 1<<0, 932 NL80211_MPATH_FLAG_ACTIVE = 1<<0,
904 NL80211_MPATH_FLAG_RESOLVING = 1<<1, 933 NL80211_MPATH_FLAG_RESOLVING = 1<<1,
905 NL80211_MPATH_FLAG_DSN_VALID = 1<<2, 934 NL80211_MPATH_FLAG_SN_VALID = 1<<2,
906 NL80211_MPATH_FLAG_FIXED = 1<<3, 935 NL80211_MPATH_FLAG_FIXED = 1<<3,
907 NL80211_MPATH_FLAG_RESOLVED = 1<<4, 936 NL80211_MPATH_FLAG_RESOLVED = 1<<4,
908}; 937};
@@ -915,7 +944,7 @@ enum nl80211_mpath_flags {
915 * 944 *
916 * @__NL80211_MPATH_INFO_INVALID: attribute number 0 is reserved 945 * @__NL80211_MPATH_INFO_INVALID: attribute number 0 is reserved
917 * @NL80211_ATTR_MPATH_FRAME_QLEN: number of queued frames for this destination 946 * @NL80211_ATTR_MPATH_FRAME_QLEN: number of queued frames for this destination
918 * @NL80211_ATTR_MPATH_DSN: destination sequence number 947 * @NL80211_ATTR_MPATH_SN: destination sequence number
919 * @NL80211_ATTR_MPATH_METRIC: metric (cost) of this mesh path 948 * @NL80211_ATTR_MPATH_METRIC: metric (cost) of this mesh path
920 * @NL80211_ATTR_MPATH_EXPTIME: expiration time for the path, in msec from now 949 * @NL80211_ATTR_MPATH_EXPTIME: expiration time for the path, in msec from now
921 * @NL80211_ATTR_MPATH_FLAGS: mesh path flags, enumerated in 950 * @NL80211_ATTR_MPATH_FLAGS: mesh path flags, enumerated in
@@ -926,7 +955,7 @@ enum nl80211_mpath_flags {
926enum nl80211_mpath_info { 955enum nl80211_mpath_info {
927 __NL80211_MPATH_INFO_INVALID, 956 __NL80211_MPATH_INFO_INVALID,
928 NL80211_MPATH_INFO_FRAME_QLEN, 957 NL80211_MPATH_INFO_FRAME_QLEN,
929 NL80211_MPATH_INFO_DSN, 958 NL80211_MPATH_INFO_SN,
930 NL80211_MPATH_INFO_METRIC, 959 NL80211_MPATH_INFO_METRIC,
931 NL80211_MPATH_INFO_EXPTIME, 960 NL80211_MPATH_INFO_EXPTIME,
932 NL80211_MPATH_INFO_FLAGS, 961 NL80211_MPATH_INFO_FLAGS,
@@ -1117,6 +1146,26 @@ enum nl80211_reg_rule_flags {
1117}; 1146};
1118 1147
1119/** 1148/**
1149 * enum nl80211_survey_info - survey information
1150 *
1151 * These attribute types are used with %NL80211_ATTR_SURVEY_INFO
1152 * when getting information about a survey.
1153 *
1154 * @__NL80211_SURVEY_INFO_INVALID: attribute number 0 is reserved
1155 * @NL80211_SURVEY_INFO_FREQUENCY: center frequency of channel
1156 * @NL80211_SURVEY_INFO_NOISE: noise level of channel (u8, dBm)
1157 */
1158enum nl80211_survey_info {
1159 __NL80211_SURVEY_INFO_INVALID,
1160 NL80211_SURVEY_INFO_FREQUENCY,
1161 NL80211_SURVEY_INFO_NOISE,
1162
1163 /* keep last */
1164 __NL80211_SURVEY_INFO_AFTER_LAST,
1165 NL80211_SURVEY_INFO_MAX = __NL80211_SURVEY_INFO_AFTER_LAST - 1
1166};
1167
1168/**
1120 * enum nl80211_mntr_flags - monitor configuration flags 1169 * enum nl80211_mntr_flags - monitor configuration flags
1121 * 1170 *
1122 * Monitor configuration flags. 1171 * Monitor configuration flags.
@@ -1196,6 +1245,8 @@ enum nl80211_mntr_flags {
1196 * @NL80211_MESHCONF_HWMP_NET_DIAM_TRVS_TIME: The interval of time (in TUs) 1245 * @NL80211_MESHCONF_HWMP_NET_DIAM_TRVS_TIME: The interval of time (in TUs)
1197 * that it takes for an HWMP information element to propagate across the mesh 1246 * that it takes for an HWMP information element to propagate across the mesh
1198 * 1247 *
1248 * @NL80211_MESHCONF_ROOTMODE: whether root mode is enabled or not
1249 *
1199 * @NL80211_MESHCONF_ATTR_MAX: highest possible mesh configuration attribute 1250 * @NL80211_MESHCONF_ATTR_MAX: highest possible mesh configuration attribute
1200 * 1251 *
1201 * @__NL80211_MESHCONF_ATTR_AFTER_LAST: internal use 1252 * @__NL80211_MESHCONF_ATTR_AFTER_LAST: internal use
@@ -1215,6 +1266,7 @@ enum nl80211_meshconf_params {
1215 NL80211_MESHCONF_HWMP_ACTIVE_PATH_TIMEOUT, 1266 NL80211_MESHCONF_HWMP_ACTIVE_PATH_TIMEOUT,
1216 NL80211_MESHCONF_HWMP_PREQ_MIN_INTERVAL, 1267 NL80211_MESHCONF_HWMP_PREQ_MIN_INTERVAL,
1217 NL80211_MESHCONF_HWMP_NET_DIAM_TRVS_TIME, 1268 NL80211_MESHCONF_HWMP_NET_DIAM_TRVS_TIME,
1269 NL80211_MESHCONF_HWMP_ROOTMODE,
1218 1270
1219 /* keep last */ 1271 /* keep last */
1220 __NL80211_MESHCONF_ATTR_AFTER_LAST, 1272 __NL80211_MESHCONF_ATTR_AFTER_LAST,
@@ -1277,6 +1329,7 @@ enum nl80211_channel_type {
1277 * @NL80211_BSS_SIGNAL_UNSPEC: signal strength of the probe response/beacon 1329 * @NL80211_BSS_SIGNAL_UNSPEC: signal strength of the probe response/beacon
1278 * in unspecified units, scaled to 0..100 (u8) 1330 * in unspecified units, scaled to 0..100 (u8)
1279 * @NL80211_BSS_STATUS: status, if this BSS is "used" 1331 * @NL80211_BSS_STATUS: status, if this BSS is "used"
1332 * @NL80211_BSS_SEEN_MS_AGO: age of this BSS entry in ms
1280 * @__NL80211_BSS_AFTER_LAST: internal 1333 * @__NL80211_BSS_AFTER_LAST: internal
1281 * @NL80211_BSS_MAX: highest BSS attribute 1334 * @NL80211_BSS_MAX: highest BSS attribute
1282 */ 1335 */
@@ -1291,6 +1344,7 @@ enum nl80211_bss {
1291 NL80211_BSS_SIGNAL_MBM, 1344 NL80211_BSS_SIGNAL_MBM,
1292 NL80211_BSS_SIGNAL_UNSPEC, 1345 NL80211_BSS_SIGNAL_UNSPEC,
1293 NL80211_BSS_STATUS, 1346 NL80211_BSS_STATUS,
1347 NL80211_BSS_SEEN_MS_AGO,
1294 1348
1295 /* keep last */ 1349 /* keep last */
1296 __NL80211_BSS_AFTER_LAST, 1350 __NL80211_BSS_AFTER_LAST,
diff --git a/include/linux/nl802154.h b/include/linux/nl802154.h
index b7d9435d5a9f..33d9f5175109 100644
--- a/include/linux/nl802154.h
+++ b/include/linux/nl802154.h
@@ -65,6 +65,9 @@ enum {
65 IEEE802154_ATTR_SEC, 65 IEEE802154_ATTR_SEC,
66 66
67 IEEE802154_ATTR_PAGE, 67 IEEE802154_ATTR_PAGE,
68 IEEE802154_ATTR_CHANNEL_PAGE_LIST,
69
70 IEEE802154_ATTR_PHY_NAME,
68 71
69 __IEEE802154_ATTR_MAX, 72 __IEEE802154_ATTR_MAX,
70}; 73};
@@ -114,6 +117,9 @@ enum {
114 IEEE802154_RX_ENABLE_CONF, /* Not supported yet */ 117 IEEE802154_RX_ENABLE_CONF, /* Not supported yet */
115 118
116 IEEE802154_LIST_IFACE, 119 IEEE802154_LIST_IFACE,
120 IEEE802154_LIST_PHY,
121 IEEE802154_ADD_IFACE,
122 IEEE802154_DEL_IFACE,
117 123
118 __IEEE802154_CMD_MAX, 124 __IEEE802154_CMD_MAX,
119}; 125};
diff --git a/include/linux/notifier.h b/include/linux/notifier.h
index 44428d247dbe..fee6c2f68075 100644
--- a/include/linux/notifier.h
+++ b/include/linux/notifier.h
@@ -201,6 +201,8 @@ static inline int notifier_to_errno(int ret)
201#define NETDEV_PRE_UP 0x000D 201#define NETDEV_PRE_UP 0x000D
202#define NETDEV_BONDING_OLDTYPE 0x000E 202#define NETDEV_BONDING_OLDTYPE 0x000E
203#define NETDEV_BONDING_NEWTYPE 0x000F 203#define NETDEV_BONDING_NEWTYPE 0x000F
204#define NETDEV_POST_INIT 0x0010
205#define NETDEV_UNREGISTER_BATCH 0x0011
204 206
205#define SYS_DOWN 0x0001 /* Notify of system down */ 207#define SYS_DOWN 0x0001 /* Notify of system down */
206#define SYS_RESTART SYS_DOWN 208#define SYS_RESTART SYS_DOWN
diff --git a/include/linux/of.h b/include/linux/of.h
index 7be2d1043c16..e7facd8fbce8 100644
--- a/include/linux/of.h
+++ b/include/linux/of.h
@@ -17,14 +17,117 @@
17 */ 17 */
18#include <linux/types.h> 18#include <linux/types.h>
19#include <linux/bitops.h> 19#include <linux/bitops.h>
20#include <linux/kref.h>
20#include <linux/mod_devicetable.h> 21#include <linux/mod_devicetable.h>
21 22
23typedef u32 phandle;
24typedef u32 ihandle;
25
26struct property {
27 char *name;
28 int length;
29 void *value;
30 struct property *next;
31 unsigned long _flags;
32 unsigned int unique_id;
33};
34
35#if defined(CONFIG_SPARC)
36struct of_irq_controller;
37#endif
38
39struct device_node {
40 const char *name;
41 const char *type;
42 phandle node;
43#if !defined(CONFIG_SPARC)
44 phandle linux_phandle;
45#endif
46 char *full_name;
47
48 struct property *properties;
49 struct property *deadprops; /* removed properties */
50 struct device_node *parent;
51 struct device_node *child;
52 struct device_node *sibling;
53 struct device_node *next; /* next device of same type */
54 struct device_node *allnext; /* next in list of all nodes */
55 struct proc_dir_entry *pde; /* this node's proc directory */
56 struct kref kref;
57 unsigned long _flags;
58 void *data;
59#if defined(CONFIG_SPARC)
60 char *path_component_name;
61 unsigned int unique_id;
62 struct of_irq_controller *irq_trans;
63#endif
64};
65
66static inline int of_node_check_flag(struct device_node *n, unsigned long flag)
67{
68 return test_bit(flag, &n->_flags);
69}
70
71static inline void of_node_set_flag(struct device_node *n, unsigned long flag)
72{
73 set_bit(flag, &n->_flags);
74}
75
76static inline void
77set_node_proc_entry(struct device_node *dn, struct proc_dir_entry *de)
78{
79 dn->pde = de;
80}
81
82extern struct device_node *of_find_all_nodes(struct device_node *prev);
83
84#if defined(CONFIG_SPARC)
85/* Dummy ref counting routines - to be implemented later */
86static inline struct device_node *of_node_get(struct device_node *node)
87{
88 return node;
89}
90static inline void of_node_put(struct device_node *node)
91{
92}
93
94#else
95extern struct device_node *of_node_get(struct device_node *node);
96extern void of_node_put(struct device_node *node);
97#endif
98
99/*
100 * OF address retreival & translation
101 */
102
103/* Helper to read a big number; size is in cells (not bytes) */
104static inline u64 of_read_number(const u32 *cell, int size)
105{
106 u64 r = 0;
107 while (size--)
108 r = (r << 32) | *(cell++);
109 return r;
110}
111
112/* Like of_read_number, but we want an unsigned long result */
113#ifdef CONFIG_PPC32
114static inline unsigned long of_read_ulong(const u32 *cell, int size)
115{
116 return cell[size-1];
117}
118#else
119#define of_read_ulong(cell, size) of_read_number(cell, size)
120#endif
121
22#include <asm/prom.h> 122#include <asm/prom.h>
23 123
24/* flag descriptions */ 124/* flag descriptions */
25#define OF_DYNAMIC 1 /* node and properties were allocated via kmalloc */ 125#define OF_DYNAMIC 1 /* node and properties were allocated via kmalloc */
26#define OF_DETACHED 2 /* node has been detached from the device tree */ 126#define OF_DETACHED 2 /* node has been detached from the device tree */
27 127
128#define OF_IS_DYNAMIC(x) test_bit(OF_DYNAMIC, &x->_flags)
129#define OF_MARK_DYNAMIC(x) set_bit(OF_DYNAMIC, &x->_flags)
130
28#define OF_BAD_ADDR ((u64)-1) 131#define OF_BAD_ADDR ((u64)-1)
29 132
30extern struct device_node *of_find_node_by_name(struct device_node *from, 133extern struct device_node *of_find_node_by_name(struct device_node *from,
diff --git a/include/linux/of_fdt.h b/include/linux/of_fdt.h
new file mode 100644
index 000000000000..41d432b13553
--- /dev/null
+++ b/include/linux/of_fdt.h
@@ -0,0 +1,86 @@
1/*
2 * Definitions for working with the Flattened Device Tree data format
3 *
4 * Copyright 2009 Benjamin Herrenschmidt, IBM Corp
5 * benh@kernel.crashing.org
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * version 2 as published by the Free Software Foundation.
10 */
11
12#ifndef _LINUX_OF_FDT_H
13#define _LINUX_OF_FDT_H
14
15#include <linux/types.h>
16#include <linux/init.h>
17
18/* Definitions used by the flattened device tree */
19#define OF_DT_HEADER 0xd00dfeed /* marker */
20#define OF_DT_BEGIN_NODE 0x1 /* Start of node, full name */
21#define OF_DT_END_NODE 0x2 /* End node */
22#define OF_DT_PROP 0x3 /* Property: name off, size,
23 * content */
24#define OF_DT_NOP 0x4 /* nop */
25#define OF_DT_END 0x9
26
27#define OF_DT_VERSION 0x10
28
29#ifndef __ASSEMBLY__
30/*
31 * This is what gets passed to the kernel by prom_init or kexec
32 *
33 * The dt struct contains the device tree structure, full pathes and
34 * property contents. The dt strings contain a separate block with just
35 * the strings for the property names, and is fully page aligned and
36 * self contained in a page, so that it can be kept around by the kernel,
37 * each property name appears only once in this page (cheap compression)
38 *
39 * the mem_rsvmap contains a map of reserved ranges of physical memory,
40 * passing it here instead of in the device-tree itself greatly simplifies
41 * the job of everybody. It's just a list of u64 pairs (base/size) that
42 * ends when size is 0
43 */
44struct boot_param_header {
45 u32 magic; /* magic word OF_DT_HEADER */
46 u32 totalsize; /* total size of DT block */
47 u32 off_dt_struct; /* offset to structure */
48 u32 off_dt_strings; /* offset to strings */
49 u32 off_mem_rsvmap; /* offset to memory reserve map */
50 u32 version; /* format version */
51 u32 last_comp_version; /* last compatible version */
52 /* version 2 fields below */
53 u32 boot_cpuid_phys; /* Physical CPU id we're booting on */
54 /* version 3 fields below */
55 u32 dt_strings_size; /* size of the DT strings block */
56 /* version 17 fields below */
57 u32 dt_struct_size; /* size of the DT structure block */
58};
59
60/* For scanning the flat device-tree at boot time */
61extern int __init of_scan_flat_dt(int (*it)(unsigned long node,
62 const char *uname, int depth,
63 void *data),
64 void *data);
65extern void __init *of_get_flat_dt_prop(unsigned long node, const char *name,
66 unsigned long *size);
67extern int __init of_flat_dt_is_compatible(unsigned long node,
68 const char *name);
69extern unsigned long __init of_get_flat_dt_root(void);
70
71/* Other Prototypes */
72extern void finish_device_tree(void);
73extern void unflatten_device_tree(void);
74extern void early_init_devtree(void *);
75extern int machine_is_compatible(const char *compat);
76extern void print_properties(struct device_node *node);
77extern int prom_n_intr_cells(struct device_node* np);
78extern void prom_get_irq_senses(unsigned char *senses, int off, int max);
79extern int prom_add_property(struct device_node* np, struct property* prop);
80extern int prom_remove_property(struct device_node *np, struct property *prop);
81extern int prom_update_property(struct device_node *np,
82 struct property *newprop,
83 struct property *oldprop);
84
85#endif /* __ASSEMBLY__ */
86#endif /* _LINUX_OF_FDT_H */
diff --git a/include/linux/pkt_cls.h b/include/linux/pkt_cls.h
index 3c842edff388..7f6ba8658abe 100644
--- a/include/linux/pkt_cls.h
+++ b/include/linux/pkt_cls.h
@@ -75,8 +75,7 @@ bits 9,10,11: redirect counter - redirect TTL. Loop avoidance
75#define SET_TC_AT(v,n) ((V_TC_AT(n)) | (v & ~M_TC_AT)) 75#define SET_TC_AT(v,n) ((V_TC_AT(n)) | (v & ~M_TC_AT))
76 76
77/* Action attributes */ 77/* Action attributes */
78enum 78enum {
79{
80 TCA_ACT_UNSPEC, 79 TCA_ACT_UNSPEC,
81 TCA_ACT_KIND, 80 TCA_ACT_KIND,
82 TCA_ACT_OPTIONS, 81 TCA_ACT_OPTIONS,
@@ -108,8 +107,7 @@ enum
108#define TC_ACT_JUMP 0x10000000 107#define TC_ACT_JUMP 0x10000000
109 108
110/* Action type identifiers*/ 109/* Action type identifiers*/
111enum 110enum {
112{
113 TCA_ID_UNSPEC=0, 111 TCA_ID_UNSPEC=0,
114 TCA_ID_POLICE=1, 112 TCA_ID_POLICE=1,
115 /* other actions go here */ 113 /* other actions go here */
@@ -118,8 +116,7 @@ enum
118 116
119#define TCA_ID_MAX __TCA_ID_MAX 117#define TCA_ID_MAX __TCA_ID_MAX
120 118
121struct tc_police 119struct tc_police {
122{
123 __u32 index; 120 __u32 index;
124 int action; 121 int action;
125#define TC_POLICE_UNSPEC TC_ACT_UNSPEC 122#define TC_POLICE_UNSPEC TC_ACT_UNSPEC
@@ -138,15 +135,13 @@ struct tc_police
138 __u32 capab; 135 __u32 capab;
139}; 136};
140 137
141struct tcf_t 138struct tcf_t {
142{
143 __u64 install; 139 __u64 install;
144 __u64 lastuse; 140 __u64 lastuse;
145 __u64 expires; 141 __u64 expires;
146}; 142};
147 143
148struct tc_cnt 144struct tc_cnt {
149{
150 int refcnt; 145 int refcnt;
151 int bindcnt; 146 int bindcnt;
152}; 147};
@@ -158,8 +153,7 @@ struct tc_cnt
158 int refcnt; \ 153 int refcnt; \
159 int bindcnt 154 int bindcnt
160 155
161enum 156enum {
162{
163 TCA_POLICE_UNSPEC, 157 TCA_POLICE_UNSPEC,
164 TCA_POLICE_TBF, 158 TCA_POLICE_TBF,
165 TCA_POLICE_RATE, 159 TCA_POLICE_RATE,
@@ -182,8 +176,7 @@ enum
182#define TC_U32_UNSPEC 0 176#define TC_U32_UNSPEC 0
183#define TC_U32_ROOT (0xFFF00000) 177#define TC_U32_ROOT (0xFFF00000)
184 178
185enum 179enum {
186{
187 TCA_U32_UNSPEC, 180 TCA_U32_UNSPEC,
188 TCA_U32_CLASSID, 181 TCA_U32_CLASSID,
189 TCA_U32_HASH, 182 TCA_U32_HASH,
@@ -200,16 +193,14 @@ enum
200 193
201#define TCA_U32_MAX (__TCA_U32_MAX - 1) 194#define TCA_U32_MAX (__TCA_U32_MAX - 1)
202 195
203struct tc_u32_key 196struct tc_u32_key {
204{
205 __be32 mask; 197 __be32 mask;
206 __be32 val; 198 __be32 val;
207 int off; 199 int off;
208 int offmask; 200 int offmask;
209}; 201};
210 202
211struct tc_u32_sel 203struct tc_u32_sel {
212{
213 unsigned char flags; 204 unsigned char flags;
214 unsigned char offshift; 205 unsigned char offshift;
215 unsigned char nkeys; 206 unsigned char nkeys;
@@ -223,15 +214,13 @@ struct tc_u32_sel
223 struct tc_u32_key keys[0]; 214 struct tc_u32_key keys[0];
224}; 215};
225 216
226struct tc_u32_mark 217struct tc_u32_mark {
227{
228 __u32 val; 218 __u32 val;
229 __u32 mask; 219 __u32 mask;
230 __u32 success; 220 __u32 success;
231}; 221};
232 222
233struct tc_u32_pcnt 223struct tc_u32_pcnt {
234{
235 __u64 rcnt; 224 __u64 rcnt;
236 __u64 rhit; 225 __u64 rhit;
237 __u64 kcnts[0]; 226 __u64 kcnts[0];
@@ -249,8 +238,7 @@ struct tc_u32_pcnt
249 238
250/* RSVP filter */ 239/* RSVP filter */
251 240
252enum 241enum {
253{
254 TCA_RSVP_UNSPEC, 242 TCA_RSVP_UNSPEC,
255 TCA_RSVP_CLASSID, 243 TCA_RSVP_CLASSID,
256 TCA_RSVP_DST, 244 TCA_RSVP_DST,
@@ -263,15 +251,13 @@ enum
263 251
264#define TCA_RSVP_MAX (__TCA_RSVP_MAX - 1 ) 252#define TCA_RSVP_MAX (__TCA_RSVP_MAX - 1 )
265 253
266struct tc_rsvp_gpi 254struct tc_rsvp_gpi {
267{
268 __u32 key; 255 __u32 key;
269 __u32 mask; 256 __u32 mask;
270 int offset; 257 int offset;
271}; 258};
272 259
273struct tc_rsvp_pinfo 260struct tc_rsvp_pinfo {
274{
275 struct tc_rsvp_gpi dpi; 261 struct tc_rsvp_gpi dpi;
276 struct tc_rsvp_gpi spi; 262 struct tc_rsvp_gpi spi;
277 __u8 protocol; 263 __u8 protocol;
@@ -282,8 +268,7 @@ struct tc_rsvp_pinfo
282 268
283/* ROUTE filter */ 269/* ROUTE filter */
284 270
285enum 271enum {
286{
287 TCA_ROUTE4_UNSPEC, 272 TCA_ROUTE4_UNSPEC,
288 TCA_ROUTE4_CLASSID, 273 TCA_ROUTE4_CLASSID,
289 TCA_ROUTE4_TO, 274 TCA_ROUTE4_TO,
@@ -299,8 +284,7 @@ enum
299 284
300/* FW filter */ 285/* FW filter */
301 286
302enum 287enum {
303{
304 TCA_FW_UNSPEC, 288 TCA_FW_UNSPEC,
305 TCA_FW_CLASSID, 289 TCA_FW_CLASSID,
306 TCA_FW_POLICE, 290 TCA_FW_POLICE,
@@ -314,8 +298,7 @@ enum
314 298
315/* TC index filter */ 299/* TC index filter */
316 300
317enum 301enum {
318{
319 TCA_TCINDEX_UNSPEC, 302 TCA_TCINDEX_UNSPEC,
320 TCA_TCINDEX_HASH, 303 TCA_TCINDEX_HASH,
321 TCA_TCINDEX_MASK, 304 TCA_TCINDEX_MASK,
@@ -331,8 +314,7 @@ enum
331 314
332/* Flow filter */ 315/* Flow filter */
333 316
334enum 317enum {
335{
336 FLOW_KEY_SRC, 318 FLOW_KEY_SRC,
337 FLOW_KEY_DST, 319 FLOW_KEY_DST,
338 FLOW_KEY_PROTO, 320 FLOW_KEY_PROTO,
@@ -355,14 +337,12 @@ enum
355 337
356#define FLOW_KEY_MAX (__FLOW_KEY_MAX - 1) 338#define FLOW_KEY_MAX (__FLOW_KEY_MAX - 1)
357 339
358enum 340enum {
359{
360 FLOW_MODE_MAP, 341 FLOW_MODE_MAP,
361 FLOW_MODE_HASH, 342 FLOW_MODE_HASH,
362}; 343};
363 344
364enum 345enum {
365{
366 TCA_FLOW_UNSPEC, 346 TCA_FLOW_UNSPEC,
367 TCA_FLOW_KEYS, 347 TCA_FLOW_KEYS,
368 TCA_FLOW_MODE, 348 TCA_FLOW_MODE,
@@ -383,8 +363,7 @@ enum
383 363
384/* Basic filter */ 364/* Basic filter */
385 365
386enum 366enum {
387{
388 TCA_BASIC_UNSPEC, 367 TCA_BASIC_UNSPEC,
389 TCA_BASIC_CLASSID, 368 TCA_BASIC_CLASSID,
390 TCA_BASIC_EMATCHES, 369 TCA_BASIC_EMATCHES,
@@ -398,8 +377,7 @@ enum
398 377
399/* Cgroup classifier */ 378/* Cgroup classifier */
400 379
401enum 380enum {
402{
403 TCA_CGROUP_UNSPEC, 381 TCA_CGROUP_UNSPEC,
404 TCA_CGROUP_ACT, 382 TCA_CGROUP_ACT,
405 TCA_CGROUP_POLICE, 383 TCA_CGROUP_POLICE,
@@ -411,14 +389,12 @@ enum
411 389
412/* Extended Matches */ 390/* Extended Matches */
413 391
414struct tcf_ematch_tree_hdr 392struct tcf_ematch_tree_hdr {
415{
416 __u16 nmatches; 393 __u16 nmatches;
417 __u16 progid; 394 __u16 progid;
418}; 395};
419 396
420enum 397enum {
421{
422 TCA_EMATCH_TREE_UNSPEC, 398 TCA_EMATCH_TREE_UNSPEC,
423 TCA_EMATCH_TREE_HDR, 399 TCA_EMATCH_TREE_HDR,
424 TCA_EMATCH_TREE_LIST, 400 TCA_EMATCH_TREE_LIST,
@@ -426,8 +402,7 @@ enum
426}; 402};
427#define TCA_EMATCH_TREE_MAX (__TCA_EMATCH_TREE_MAX - 1) 403#define TCA_EMATCH_TREE_MAX (__TCA_EMATCH_TREE_MAX - 1)
428 404
429struct tcf_ematch_hdr 405struct tcf_ematch_hdr {
430{
431 __u16 matchid; 406 __u16 matchid;
432 __u16 kind; 407 __u16 kind;
433 __u16 flags; 408 __u16 flags;
@@ -457,8 +432,7 @@ struct tcf_ematch_hdr
457#define TCF_EM_REL_MASK 3 432#define TCF_EM_REL_MASK 3
458#define TCF_EM_REL_VALID(v) (((v) & TCF_EM_REL_MASK) != TCF_EM_REL_MASK) 433#define TCF_EM_REL_VALID(v) (((v) & TCF_EM_REL_MASK) != TCF_EM_REL_MASK)
459 434
460enum 435enum {
461{
462 TCF_LAYER_LINK, 436 TCF_LAYER_LINK,
463 TCF_LAYER_NETWORK, 437 TCF_LAYER_NETWORK,
464 TCF_LAYER_TRANSPORT, 438 TCF_LAYER_TRANSPORT,
@@ -479,13 +453,11 @@ enum
479#define TCF_EM_VLAN 6 453#define TCF_EM_VLAN 6
480#define TCF_EM_MAX 6 454#define TCF_EM_MAX 6
481 455
482enum 456enum {
483{
484 TCF_EM_PROG_TC 457 TCF_EM_PROG_TC
485}; 458};
486 459
487enum 460enum {
488{
489 TCF_EM_OPND_EQ, 461 TCF_EM_OPND_EQ,
490 TCF_EM_OPND_GT, 462 TCF_EM_OPND_GT,
491 TCF_EM_OPND_LT 463 TCF_EM_OPND_LT
diff --git a/include/linux/pkt_sched.h b/include/linux/pkt_sched.h
index d51a2b3e221e..2cfa4bc8dea6 100644
--- a/include/linux/pkt_sched.h
+++ b/include/linux/pkt_sched.h
@@ -29,8 +29,7 @@
29 Particular schedulers may have also their private records. 29 Particular schedulers may have also their private records.
30 */ 30 */
31 31
32struct tc_stats 32struct tc_stats {
33{
34 __u64 bytes; /* NUmber of enqueues bytes */ 33 __u64 bytes; /* NUmber of enqueues bytes */
35 __u32 packets; /* Number of enqueued packets */ 34 __u32 packets; /* Number of enqueued packets */
36 __u32 drops; /* Packets dropped because of lack of resources */ 35 __u32 drops; /* Packets dropped because of lack of resources */
@@ -42,8 +41,7 @@ struct tc_stats
42 __u32 backlog; 41 __u32 backlog;
43}; 42};
44 43
45struct tc_estimator 44struct tc_estimator {
46{
47 signed char interval; 45 signed char interval;
48 unsigned char ewma_log; 46 unsigned char ewma_log;
49}; 47};
@@ -75,8 +73,7 @@ struct tc_estimator
75#define TC_H_ROOT (0xFFFFFFFFU) 73#define TC_H_ROOT (0xFFFFFFFFU)
76#define TC_H_INGRESS (0xFFFFFFF1U) 74#define TC_H_INGRESS (0xFFFFFFF1U)
77 75
78struct tc_ratespec 76struct tc_ratespec {
79{
80 unsigned char cell_log; 77 unsigned char cell_log;
81 unsigned char __reserved; 78 unsigned char __reserved;
82 unsigned short overhead; 79 unsigned short overhead;
@@ -109,8 +106,7 @@ enum {
109 106
110/* FIFO section */ 107/* FIFO section */
111 108
112struct tc_fifo_qopt 109struct tc_fifo_qopt {
113{
114 __u32 limit; /* Queue length: bytes for bfifo, packets for pfifo */ 110 __u32 limit; /* Queue length: bytes for bfifo, packets for pfifo */
115}; 111};
116 112
@@ -119,8 +115,7 @@ struct tc_fifo_qopt
119#define TCQ_PRIO_BANDS 16 115#define TCQ_PRIO_BANDS 16
120#define TCQ_MIN_PRIO_BANDS 2 116#define TCQ_MIN_PRIO_BANDS 2
121 117
122struct tc_prio_qopt 118struct tc_prio_qopt {
123{
124 int bands; /* Number of bands */ 119 int bands; /* Number of bands */
125 __u8 priomap[TC_PRIO_MAX+1]; /* Map: logical priority -> PRIO band */ 120 __u8 priomap[TC_PRIO_MAX+1]; /* Map: logical priority -> PRIO band */
126}; 121};
@@ -134,8 +129,7 @@ struct tc_multiq_qopt {
134 129
135/* TBF section */ 130/* TBF section */
136 131
137struct tc_tbf_qopt 132struct tc_tbf_qopt {
138{
139 struct tc_ratespec rate; 133 struct tc_ratespec rate;
140 struct tc_ratespec peakrate; 134 struct tc_ratespec peakrate;
141 __u32 limit; 135 __u32 limit;
@@ -143,8 +137,7 @@ struct tc_tbf_qopt
143 __u32 mtu; 137 __u32 mtu;
144}; 138};
145 139
146enum 140enum {
147{
148 TCA_TBF_UNSPEC, 141 TCA_TBF_UNSPEC,
149 TCA_TBF_PARMS, 142 TCA_TBF_PARMS,
150 TCA_TBF_RTAB, 143 TCA_TBF_RTAB,
@@ -161,8 +154,7 @@ enum
161 154
162/* SFQ section */ 155/* SFQ section */
163 156
164struct tc_sfq_qopt 157struct tc_sfq_qopt {
165{
166 unsigned quantum; /* Bytes per round allocated to flow */ 158 unsigned quantum; /* Bytes per round allocated to flow */
167 int perturb_period; /* Period of hash perturbation */ 159 int perturb_period; /* Period of hash perturbation */
168 __u32 limit; /* Maximal packets in queue */ 160 __u32 limit; /* Maximal packets in queue */
@@ -170,8 +162,7 @@ struct tc_sfq_qopt
170 unsigned flows; /* Maximal number of flows */ 162 unsigned flows; /* Maximal number of flows */
171}; 163};
172 164
173struct tc_sfq_xstats 165struct tc_sfq_xstats {
174{
175 __s32 allot; 166 __s32 allot;
176}; 167};
177 168
@@ -186,8 +177,7 @@ struct tc_sfq_xstats
186 177
187/* RED section */ 178/* RED section */
188 179
189enum 180enum {
190{
191 TCA_RED_UNSPEC, 181 TCA_RED_UNSPEC,
192 TCA_RED_PARMS, 182 TCA_RED_PARMS,
193 TCA_RED_STAB, 183 TCA_RED_STAB,
@@ -196,8 +186,7 @@ enum
196 186
197#define TCA_RED_MAX (__TCA_RED_MAX - 1) 187#define TCA_RED_MAX (__TCA_RED_MAX - 1)
198 188
199struct tc_red_qopt 189struct tc_red_qopt {
200{
201 __u32 limit; /* HARD maximal queue length (bytes) */ 190 __u32 limit; /* HARD maximal queue length (bytes) */
202 __u32 qth_min; /* Min average length threshold (bytes) */ 191 __u32 qth_min; /* Min average length threshold (bytes) */
203 __u32 qth_max; /* Max average length threshold (bytes) */ 192 __u32 qth_max; /* Max average length threshold (bytes) */
@@ -209,8 +198,7 @@ struct tc_red_qopt
209#define TC_RED_HARDDROP 2 198#define TC_RED_HARDDROP 2
210}; 199};
211 200
212struct tc_red_xstats 201struct tc_red_xstats {
213{
214 __u32 early; /* Early drops */ 202 __u32 early; /* Early drops */
215 __u32 pdrop; /* Drops due to queue limits */ 203 __u32 pdrop; /* Drops due to queue limits */
216 __u32 other; /* Drops due to drop() calls */ 204 __u32 other; /* Drops due to drop() calls */
@@ -221,8 +209,7 @@ struct tc_red_xstats
221 209
222#define MAX_DPs 16 210#define MAX_DPs 16
223 211
224enum 212enum {
225{
226 TCA_GRED_UNSPEC, 213 TCA_GRED_UNSPEC,
227 TCA_GRED_PARMS, 214 TCA_GRED_PARMS,
228 TCA_GRED_STAB, 215 TCA_GRED_STAB,
@@ -232,8 +219,7 @@ enum
232 219
233#define TCA_GRED_MAX (__TCA_GRED_MAX - 1) 220#define TCA_GRED_MAX (__TCA_GRED_MAX - 1)
234 221
235struct tc_gred_qopt 222struct tc_gred_qopt {
236{
237 __u32 limit; /* HARD maximal queue length (bytes) */ 223 __u32 limit; /* HARD maximal queue length (bytes) */
238 __u32 qth_min; /* Min average length threshold (bytes) */ 224 __u32 qth_min; /* Min average length threshold (bytes) */
239 __u32 qth_max; /* Max average length threshold (bytes) */ 225 __u32 qth_max; /* Max average length threshold (bytes) */
@@ -253,8 +239,7 @@ struct tc_gred_qopt
253}; 239};
254 240
255/* gred setup */ 241/* gred setup */
256struct tc_gred_sopt 242struct tc_gred_sopt {
257{
258 __u32 DPs; 243 __u32 DPs;
259 __u32 def_DP; 244 __u32 def_DP;
260 __u8 grio; 245 __u8 grio;
@@ -267,8 +252,7 @@ struct tc_gred_sopt
267#define TC_HTB_MAXDEPTH 8 252#define TC_HTB_MAXDEPTH 8
268#define TC_HTB_PROTOVER 3 /* the same as HTB and TC's major */ 253#define TC_HTB_PROTOVER 3 /* the same as HTB and TC's major */
269 254
270struct tc_htb_opt 255struct tc_htb_opt {
271{
272 struct tc_ratespec rate; 256 struct tc_ratespec rate;
273 struct tc_ratespec ceil; 257 struct tc_ratespec ceil;
274 __u32 buffer; 258 __u32 buffer;
@@ -277,8 +261,7 @@ struct tc_htb_opt
277 __u32 level; /* out only */ 261 __u32 level; /* out only */
278 __u32 prio; 262 __u32 prio;
279}; 263};
280struct tc_htb_glob 264struct tc_htb_glob {
281{
282 __u32 version; /* to match HTB/TC */ 265 __u32 version; /* to match HTB/TC */
283 __u32 rate2quantum; /* bps->quantum divisor */ 266 __u32 rate2quantum; /* bps->quantum divisor */
284 __u32 defcls; /* default class number */ 267 __u32 defcls; /* default class number */
@@ -287,8 +270,7 @@ struct tc_htb_glob
287 /* stats */ 270 /* stats */
288 __u32 direct_pkts; /* count of non shapped packets */ 271 __u32 direct_pkts; /* count of non shapped packets */
289}; 272};
290enum 273enum {
291{
292 TCA_HTB_UNSPEC, 274 TCA_HTB_UNSPEC,
293 TCA_HTB_PARMS, 275 TCA_HTB_PARMS,
294 TCA_HTB_INIT, 276 TCA_HTB_INIT,
@@ -299,8 +281,7 @@ enum
299 281
300#define TCA_HTB_MAX (__TCA_HTB_MAX - 1) 282#define TCA_HTB_MAX (__TCA_HTB_MAX - 1)
301 283
302struct tc_htb_xstats 284struct tc_htb_xstats {
303{
304 __u32 lends; 285 __u32 lends;
305 __u32 borrows; 286 __u32 borrows;
306 __u32 giants; /* too big packets (rate will not be accurate) */ 287 __u32 giants; /* too big packets (rate will not be accurate) */
@@ -310,28 +291,24 @@ struct tc_htb_xstats
310 291
311/* HFSC section */ 292/* HFSC section */
312 293
313struct tc_hfsc_qopt 294struct tc_hfsc_qopt {
314{
315 __u16 defcls; /* default class */ 295 __u16 defcls; /* default class */
316}; 296};
317 297
318struct tc_service_curve 298struct tc_service_curve {
319{
320 __u32 m1; /* slope of the first segment in bps */ 299 __u32 m1; /* slope of the first segment in bps */
321 __u32 d; /* x-projection of the first segment in us */ 300 __u32 d; /* x-projection of the first segment in us */
322 __u32 m2; /* slope of the second segment in bps */ 301 __u32 m2; /* slope of the second segment in bps */
323}; 302};
324 303
325struct tc_hfsc_stats 304struct tc_hfsc_stats {
326{
327 __u64 work; /* total work done */ 305 __u64 work; /* total work done */
328 __u64 rtwork; /* work done by real-time criteria */ 306 __u64 rtwork; /* work done by real-time criteria */
329 __u32 period; /* current period */ 307 __u32 period; /* current period */
330 __u32 level; /* class level in hierarchy */ 308 __u32 level; /* class level in hierarchy */
331}; 309};
332 310
333enum 311enum {
334{
335 TCA_HFSC_UNSPEC, 312 TCA_HFSC_UNSPEC,
336 TCA_HFSC_RSC, 313 TCA_HFSC_RSC,
337 TCA_HFSC_FSC, 314 TCA_HFSC_FSC,
@@ -348,8 +325,7 @@ enum
348#define TC_CBQ_MAXLEVEL 8 325#define TC_CBQ_MAXLEVEL 8
349#define TC_CBQ_DEF_EWMA 5 326#define TC_CBQ_DEF_EWMA 5
350 327
351struct tc_cbq_lssopt 328struct tc_cbq_lssopt {
352{
353 unsigned char change; 329 unsigned char change;
354 unsigned char flags; 330 unsigned char flags;
355#define TCF_CBQ_LSS_BOUNDED 1 331#define TCF_CBQ_LSS_BOUNDED 1
@@ -368,8 +344,7 @@ struct tc_cbq_lssopt
368 __u32 avpkt; 344 __u32 avpkt;
369}; 345};
370 346
371struct tc_cbq_wrropt 347struct tc_cbq_wrropt {
372{
373 unsigned char flags; 348 unsigned char flags;
374 unsigned char priority; 349 unsigned char priority;
375 unsigned char cpriority; 350 unsigned char cpriority;
@@ -378,8 +353,7 @@ struct tc_cbq_wrropt
378 __u32 weight; 353 __u32 weight;
379}; 354};
380 355
381struct tc_cbq_ovl 356struct tc_cbq_ovl {
382{
383 unsigned char strategy; 357 unsigned char strategy;
384#define TC_CBQ_OVL_CLASSIC 0 358#define TC_CBQ_OVL_CLASSIC 0
385#define TC_CBQ_OVL_DELAY 1 359#define TC_CBQ_OVL_DELAY 1
@@ -391,30 +365,26 @@ struct tc_cbq_ovl
391 __u32 penalty; 365 __u32 penalty;
392}; 366};
393 367
394struct tc_cbq_police 368struct tc_cbq_police {
395{
396 unsigned char police; 369 unsigned char police;
397 unsigned char __res1; 370 unsigned char __res1;
398 unsigned short __res2; 371 unsigned short __res2;
399}; 372};
400 373
401struct tc_cbq_fopt 374struct tc_cbq_fopt {
402{
403 __u32 split; 375 __u32 split;
404 __u32 defmap; 376 __u32 defmap;
405 __u32 defchange; 377 __u32 defchange;
406}; 378};
407 379
408struct tc_cbq_xstats 380struct tc_cbq_xstats {
409{
410 __u32 borrows; 381 __u32 borrows;
411 __u32 overactions; 382 __u32 overactions;
412 __s32 avgidle; 383 __s32 avgidle;
413 __s32 undertime; 384 __s32 undertime;
414}; 385};
415 386
416enum 387enum {
417{
418 TCA_CBQ_UNSPEC, 388 TCA_CBQ_UNSPEC,
419 TCA_CBQ_LSSOPT, 389 TCA_CBQ_LSSOPT,
420 TCA_CBQ_WRROPT, 390 TCA_CBQ_WRROPT,
@@ -459,8 +429,7 @@ enum {
459 429
460/* Network emulator */ 430/* Network emulator */
461 431
462enum 432enum {
463{
464 TCA_NETEM_UNSPEC, 433 TCA_NETEM_UNSPEC,
465 TCA_NETEM_CORR, 434 TCA_NETEM_CORR,
466 TCA_NETEM_DELAY_DIST, 435 TCA_NETEM_DELAY_DIST,
@@ -471,8 +440,7 @@ enum
471 440
472#define TCA_NETEM_MAX (__TCA_NETEM_MAX - 1) 441#define TCA_NETEM_MAX (__TCA_NETEM_MAX - 1)
473 442
474struct tc_netem_qopt 443struct tc_netem_qopt {
475{
476 __u32 latency; /* added delay (us) */ 444 __u32 latency; /* added delay (us) */
477 __u32 limit; /* fifo limit (packets) */ 445 __u32 limit; /* fifo limit (packets) */
478 __u32 loss; /* random packet loss (0=none ~0=100%) */ 446 __u32 loss; /* random packet loss (0=none ~0=100%) */
@@ -481,21 +449,18 @@ struct tc_netem_qopt
481 __u32 jitter; /* random jitter in latency (us) */ 449 __u32 jitter; /* random jitter in latency (us) */
482}; 450};
483 451
484struct tc_netem_corr 452struct tc_netem_corr {
485{
486 __u32 delay_corr; /* delay correlation */ 453 __u32 delay_corr; /* delay correlation */
487 __u32 loss_corr; /* packet loss correlation */ 454 __u32 loss_corr; /* packet loss correlation */
488 __u32 dup_corr; /* duplicate correlation */ 455 __u32 dup_corr; /* duplicate correlation */
489}; 456};
490 457
491struct tc_netem_reorder 458struct tc_netem_reorder {
492{
493 __u32 probability; 459 __u32 probability;
494 __u32 correlation; 460 __u32 correlation;
495}; 461};
496 462
497struct tc_netem_corrupt 463struct tc_netem_corrupt {
498{
499 __u32 probability; 464 __u32 probability;
500 __u32 correlation; 465 __u32 correlation;
501}; 466};
@@ -504,8 +469,7 @@ struct tc_netem_corrupt
504 469
505/* DRR */ 470/* DRR */
506 471
507enum 472enum {
508{
509 TCA_DRR_UNSPEC, 473 TCA_DRR_UNSPEC,
510 TCA_DRR_QUANTUM, 474 TCA_DRR_QUANTUM,
511 __TCA_DRR_MAX 475 __TCA_DRR_MAX
@@ -513,8 +477,7 @@ enum
513 477
514#define TCA_DRR_MAX (__TCA_DRR_MAX - 1) 478#define TCA_DRR_MAX (__TCA_DRR_MAX - 1)
515 479
516struct tc_drr_stats 480struct tc_drr_stats {
517{
518 __u32 deficit; 481 __u32 deficit;
519}; 482};
520 483
diff --git a/include/linux/pm.h b/include/linux/pm.h
index 3b7e04b95bd2..0d65934246af 100644
--- a/include/linux/pm.h
+++ b/include/linux/pm.h
@@ -178,9 +178,10 @@ typedef struct pm_message {
178 * This need not mean that the device should be put into a low power state. 178 * This need not mean that the device should be put into a low power state.
179 * For example, if the device is behind a link which is about to be turned 179 * For example, if the device is behind a link which is about to be turned
180 * off, the device may remain at full power. If the device does go to low 180 * off, the device may remain at full power. If the device does go to low
181 * power and if device_may_wakeup(dev) is true, remote wake-up (i.e., a 181 * power and is capable of generating run-time wake-up events, remote
182 * hardware mechanism allowing the device to request a change of its power 182 * wake-up (i.e., a hardware mechanism allowing the device to request a
183 * state, such as PCI PME) should be enabled for it. 183 * change of its power state via a wake-up event, such as PCI PME) should
184 * be enabled for it.
184 * 185 *
185 * @runtime_resume: Put the device into the fully active state in response to a 186 * @runtime_resume: Put the device into the fully active state in response to a
186 * wake-up event generated by hardware or at the request of software. If 187 * wake-up event generated by hardware or at the request of software. If
@@ -428,6 +429,7 @@ struct dev_pm_info {
428 unsigned int idle_notification:1; 429 unsigned int idle_notification:1;
429 unsigned int request_pending:1; 430 unsigned int request_pending:1;
430 unsigned int deferred_resume:1; 431 unsigned int deferred_resume:1;
432 unsigned int run_wake:1;
431 enum rpm_request request; 433 enum rpm_request request;
432 enum rpm_status runtime_status; 434 enum rpm_status runtime_status;
433 int runtime_error; 435 int runtime_error;
diff --git a/include/linux/pm_runtime.h b/include/linux/pm_runtime.h
index 44087044910f..370ce0a6fe4a 100644
--- a/include/linux/pm_runtime.h
+++ b/include/linux/pm_runtime.h
@@ -50,6 +50,16 @@ static inline void pm_runtime_put_noidle(struct device *dev)
50 atomic_add_unless(&dev->power.usage_count, -1, 0); 50 atomic_add_unless(&dev->power.usage_count, -1, 0);
51} 51}
52 52
53static inline bool device_run_wake(struct device *dev)
54{
55 return dev->power.run_wake;
56}
57
58static inline void device_set_run_wake(struct device *dev, bool enable)
59{
60 dev->power.run_wake = enable;
61}
62
53#else /* !CONFIG_PM_RUNTIME */ 63#else /* !CONFIG_PM_RUNTIME */
54 64
55static inline int pm_runtime_idle(struct device *dev) { return -ENOSYS; } 65static inline int pm_runtime_idle(struct device *dev) { return -ENOSYS; }
@@ -73,6 +83,8 @@ static inline bool pm_children_suspended(struct device *dev) { return false; }
73static inline void pm_suspend_ignore_children(struct device *dev, bool en) {} 83static inline void pm_suspend_ignore_children(struct device *dev, bool en) {}
74static inline void pm_runtime_get_noresume(struct device *dev) {} 84static inline void pm_runtime_get_noresume(struct device *dev) {}
75static inline void pm_runtime_put_noidle(struct device *dev) {} 85static inline void pm_runtime_put_noidle(struct device *dev) {}
86static inline bool device_run_wake(struct device *dev) { return false; }
87static inline void device_set_run_wake(struct device *dev, bool enable) {}
76 88
77#endif /* !CONFIG_PM_RUNTIME */ 89#endif /* !CONFIG_PM_RUNTIME */
78 90
diff --git a/include/linux/rculist.h b/include/linux/rculist.h
index 5710f43bbc9e..1bf0f708c4fc 100644
--- a/include/linux/rculist.h
+++ b/include/linux/rculist.h
@@ -262,6 +262,20 @@ static inline void list_splice_init_rcu(struct list_head *list,
262 (pos) = rcu_dereference((pos)->next)) 262 (pos) = rcu_dereference((pos)->next))
263 263
264/** 264/**
265 * list_for_each_entry_continue_rcu - continue iteration over list of given type
266 * @pos: the type * to use as a loop cursor.
267 * @head: the head for your list.
268 * @member: the name of the list_struct within the struct.
269 *
270 * Continue to iterate over list of given type, continuing after
271 * the current position.
272 */
273#define list_for_each_entry_continue_rcu(pos, head, member) \
274 for (pos = list_entry_rcu(pos->member.next, typeof(*pos), member); \
275 prefetch(pos->member.next), &pos->member != (head); \
276 pos = list_entry_rcu(pos->member.next, typeof(*pos), member))
277
278/**
265 * hlist_del_rcu - deletes entry from hash list without re-initialization 279 * hlist_del_rcu - deletes entry from hash list without re-initialization
266 * @n: the element to delete from the hash list. 280 * @n: the element to delete from the hash list.
267 * 281 *
diff --git a/include/linux/rds.h b/include/linux/rds.h
index 89d46e1afbb1..cab4994c2f63 100644
--- a/include/linux/rds.h
+++ b/include/linux/rds.h
@@ -56,6 +56,7 @@
56/* deprecated: RDS_BARRIER 4 */ 56/* deprecated: RDS_BARRIER 4 */
57#define RDS_RECVERR 5 57#define RDS_RECVERR 5
58#define RDS_CONG_MONITOR 6 58#define RDS_CONG_MONITOR 6
59#define RDS_GET_MR_FOR_DEST 7
59 60
60/* 61/*
61 * Control message types for SOL_RDS. 62 * Control message types for SOL_RDS.
@@ -224,6 +225,13 @@ struct rds_get_mr_args {
224 uint64_t flags; 225 uint64_t flags;
225}; 226};
226 227
228struct rds_get_mr_for_dest_args {
229 struct sockaddr_storage dest_addr;
230 struct rds_iovec vec;
231 u_int64_t cookie_addr;
232 uint64_t flags;
233};
234
227struct rds_free_mr_args { 235struct rds_free_mr_args {
228 rds_rdma_cookie_t cookie; 236 rds_rdma_cookie_t cookie;
229 u_int64_t flags; 237 u_int64_t flags;
diff --git a/include/linux/rfkill.h b/include/linux/rfkill.h
index 3392c59d2706..97059d08a626 100644
--- a/include/linux/rfkill.h
+++ b/include/linux/rfkill.h
@@ -35,6 +35,8 @@
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 * @RFKILL_TYPE_WWAN: switch is on a wireless WAN device.
38 * @RFKILL_TYPE_GPS: switch is on a GPS device.
39 * @RFKILL_TYPE_FM: switch is on a FM radio device.
38 * @NUM_RFKILL_TYPES: number of defined rfkill types 40 * @NUM_RFKILL_TYPES: number of defined rfkill types
39 */ 41 */
40enum rfkill_type { 42enum rfkill_type {
@@ -45,6 +47,7 @@ enum rfkill_type {
45 RFKILL_TYPE_WIMAX, 47 RFKILL_TYPE_WIMAX,
46 RFKILL_TYPE_WWAN, 48 RFKILL_TYPE_WWAN,
47 RFKILL_TYPE_GPS, 49 RFKILL_TYPE_GPS,
50 RFKILL_TYPE_FM,
48 NUM_RFKILL_TYPES, 51 NUM_RFKILL_TYPES,
49}; 52};
50 53
diff --git a/include/linux/route.h b/include/linux/route.h
index f7ed35d5e653..6600708311c8 100644
--- a/include/linux/route.h
+++ b/include/linux/route.h
@@ -27,8 +27,7 @@
27#include <linux/compiler.h> 27#include <linux/compiler.h>
28 28
29/* This structure gets passed by the SIOCADDRT and SIOCDELRT calls. */ 29/* This structure gets passed by the SIOCADDRT and SIOCDELRT calls. */
30struct rtentry 30struct rtentry {
31{
32 unsigned long rt_pad1; 31 unsigned long rt_pad1;
33 struct sockaddr rt_dst; /* target address */ 32 struct sockaddr rt_dst; /* target address */
34 struct sockaddr rt_gateway; /* gateway addr (RTF_GATEWAY) */ 33 struct sockaddr rt_gateway; /* gateway addr (RTF_GATEWAY) */
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h
index adf2068d12b5..14fc906ed602 100644
--- a/include/linux/rtnetlink.h
+++ b/include/linux/rtnetlink.h
@@ -127,8 +127,7 @@ enum {
127 with attribute type. 127 with attribute type.
128 */ 128 */
129 129
130struct rtattr 130struct rtattr {
131{
132 unsigned short rta_len; 131 unsigned short rta_len;
133 unsigned short rta_type; 132 unsigned short rta_type;
134}; 133};
@@ -154,8 +153,7 @@ struct rtattr
154 * Definitions used in routing table administration. 153 * Definitions used in routing table administration.
155 ****/ 154 ****/
156 155
157struct rtmsg 156struct rtmsg {
158{
159 unsigned char rtm_family; 157 unsigned char rtm_family;
160 unsigned char rtm_dst_len; 158 unsigned char rtm_dst_len;
161 unsigned char rtm_src_len; 159 unsigned char rtm_src_len;
@@ -171,8 +169,7 @@ struct rtmsg
171 169
172/* rtm_type */ 170/* rtm_type */
173 171
174enum 172enum {
175{
176 RTN_UNSPEC, 173 RTN_UNSPEC,
177 RTN_UNICAST, /* Gateway or direct route */ 174 RTN_UNICAST, /* Gateway or direct route */
178 RTN_LOCAL, /* Accept locally */ 175 RTN_LOCAL, /* Accept locally */
@@ -230,8 +227,7 @@ enum
230 could be assigned a value between UNIVERSE and LINK. 227 could be assigned a value between UNIVERSE and LINK.
231*/ 228*/
232 229
233enum rt_scope_t 230enum rt_scope_t {
234{
235 RT_SCOPE_UNIVERSE=0, 231 RT_SCOPE_UNIVERSE=0,
236/* User defined values */ 232/* User defined values */
237 RT_SCOPE_SITE=200, 233 RT_SCOPE_SITE=200,
@@ -249,8 +245,7 @@ enum rt_scope_t
249 245
250/* Reserved table identifiers */ 246/* Reserved table identifiers */
251 247
252enum rt_class_t 248enum rt_class_t {
253{
254 RT_TABLE_UNSPEC=0, 249 RT_TABLE_UNSPEC=0,
255/* User defined values */ 250/* User defined values */
256 RT_TABLE_COMPAT=252, 251 RT_TABLE_COMPAT=252,
@@ -263,8 +258,7 @@ enum rt_class_t
263 258
264/* Routing message attributes */ 259/* Routing message attributes */
265 260
266enum rtattr_type_t 261enum rtattr_type_t {
267{
268 RTA_UNSPEC, 262 RTA_UNSPEC,
269 RTA_DST, 263 RTA_DST,
270 RTA_SRC, 264 RTA_SRC,
@@ -298,8 +292,7 @@ enum rtattr_type_t
298 * and rtt for different paths from multipath. 292 * and rtt for different paths from multipath.
299 */ 293 */
300 294
301struct rtnexthop 295struct rtnexthop {
302{
303 unsigned short rtnh_len; 296 unsigned short rtnh_len;
304 unsigned char rtnh_flags; 297 unsigned char rtnh_flags;
305 unsigned char rtnh_hops; 298 unsigned char rtnh_hops;
@@ -325,8 +318,7 @@ struct rtnexthop
325 318
326/* RTM_CACHEINFO */ 319/* RTM_CACHEINFO */
327 320
328struct rta_cacheinfo 321struct rta_cacheinfo {
329{
330 __u32 rta_clntref; 322 __u32 rta_clntref;
331 __u32 rta_lastuse; 323 __u32 rta_lastuse;
332 __s32 rta_expires; 324 __s32 rta_expires;
@@ -341,8 +333,7 @@ struct rta_cacheinfo
341 333
342/* RTM_METRICS --- array of struct rtattr with types of RTAX_* */ 334/* RTM_METRICS --- array of struct rtattr with types of RTAX_* */
343 335
344enum 336enum {
345{
346 RTAX_UNSPEC, 337 RTAX_UNSPEC,
347#define RTAX_UNSPEC RTAX_UNSPEC 338#define RTAX_UNSPEC RTAX_UNSPEC
348 RTAX_LOCK, 339 RTAX_LOCK,
@@ -377,12 +368,13 @@ enum
377#define RTAX_MAX (__RTAX_MAX - 1) 368#define RTAX_MAX (__RTAX_MAX - 1)
378 369
379#define RTAX_FEATURE_ECN 0x00000001 370#define RTAX_FEATURE_ECN 0x00000001
380#define RTAX_FEATURE_SACK 0x00000002 371#define RTAX_FEATURE_NO_SACK 0x00000002
381#define RTAX_FEATURE_TIMESTAMP 0x00000004 372#define RTAX_FEATURE_NO_TSTAMP 0x00000004
382#define RTAX_FEATURE_ALLFRAG 0x00000008 373#define RTAX_FEATURE_ALLFRAG 0x00000008
374#define RTAX_FEATURE_NO_WSCALE 0x00000010
375#define RTAX_FEATURE_NO_DSACK 0x00000020
383 376
384struct rta_session 377struct rta_session {
385{
386 __u8 proto; 378 __u8 proto;
387 __u8 pad1; 379 __u8 pad1;
388 __u16 pad2; 380 __u16 pad2;
@@ -407,8 +399,7 @@ struct rta_session
407 * General form of address family dependent message. 399 * General form of address family dependent message.
408 ****/ 400 ****/
409 401
410struct rtgenmsg 402struct rtgenmsg {
411{
412 unsigned char rtgen_family; 403 unsigned char rtgen_family;
413}; 404};
414 405
@@ -421,8 +412,7 @@ struct rtgenmsg
421 * on network protocol. 412 * on network protocol.
422 */ 413 */
423 414
424struct ifinfomsg 415struct ifinfomsg {
425{
426 unsigned char ifi_family; 416 unsigned char ifi_family;
427 unsigned char __ifi_pad; 417 unsigned char __ifi_pad;
428 unsigned short ifi_type; /* ARPHRD_* */ 418 unsigned short ifi_type; /* ARPHRD_* */
@@ -435,8 +425,7 @@ struct ifinfomsg
435 * prefix information 425 * prefix information
436 ****/ 426 ****/
437 427
438struct prefixmsg 428struct prefixmsg {
439{
440 unsigned char prefix_family; 429 unsigned char prefix_family;
441 unsigned char prefix_pad1; 430 unsigned char prefix_pad1;
442 unsigned short prefix_pad2; 431 unsigned short prefix_pad2;
@@ -457,8 +446,7 @@ enum
457 446
458#define PREFIX_MAX (__PREFIX_MAX - 1) 447#define PREFIX_MAX (__PREFIX_MAX - 1)
459 448
460struct prefix_cacheinfo 449struct prefix_cacheinfo {
461{
462 __u32 preferred_time; 450 __u32 preferred_time;
463 __u32 valid_time; 451 __u32 valid_time;
464}; 452};
@@ -468,8 +456,7 @@ struct prefix_cacheinfo
468 * Traffic control messages. 456 * Traffic control messages.
469 ****/ 457 ****/
470 458
471struct tcmsg 459struct tcmsg {
472{
473 unsigned char tcm_family; 460 unsigned char tcm_family;
474 unsigned char tcm__pad1; 461 unsigned char tcm__pad1;
475 unsigned short tcm__pad2; 462 unsigned short tcm__pad2;
@@ -479,8 +466,7 @@ struct tcmsg
479 __u32 tcm_info; 466 __u32 tcm_info;
480}; 467};
481 468
482enum 469enum {
483{
484 TCA_UNSPEC, 470 TCA_UNSPEC,
485 TCA_KIND, 471 TCA_KIND,
486 TCA_OPTIONS, 472 TCA_OPTIONS,
@@ -502,8 +488,7 @@ enum
502 * Neighbor Discovery userland options 488 * Neighbor Discovery userland options
503 ****/ 489 ****/
504 490
505struct nduseroptmsg 491struct nduseroptmsg {
506{
507 unsigned char nduseropt_family; 492 unsigned char nduseropt_family;
508 unsigned char nduseropt_pad1; 493 unsigned char nduseropt_pad1;
509 unsigned short nduseropt_opts_len; /* Total length of options */ 494 unsigned short nduseropt_opts_len; /* Total length of options */
@@ -515,8 +500,7 @@ struct nduseroptmsg
515 /* Followed by one or more ND options */ 500 /* Followed by one or more ND options */
516}; 501};
517 502
518enum 503enum {
519{
520 NDUSEROPT_UNSPEC, 504 NDUSEROPT_UNSPEC,
521 NDUSEROPT_SRCADDR, 505 NDUSEROPT_SRCADDR,
522 __NDUSEROPT_MAX 506 __NDUSEROPT_MAX
@@ -598,8 +582,7 @@ enum rtnetlink_groups {
598#define RTNLGRP_MAX (__RTNLGRP_MAX - 1) 582#define RTNLGRP_MAX (__RTNLGRP_MAX - 1)
599 583
600/* TC action piece */ 584/* TC action piece */
601struct tcamsg 585struct tcamsg {
602{
603 unsigned char tca_family; 586 unsigned char tca_family;
604 unsigned char tca__pad1; 587 unsigned char tca__pad1;
605 unsigned short tca__pad2; 588 unsigned short tca__pad2;
diff --git a/include/linux/sctp.h b/include/linux/sctp.h
index b464b9d3d242..c20d3ce673c0 100644
--- a/include/linux/sctp.h
+++ b/include/linux/sctp.h
@@ -242,6 +242,7 @@ enum {
242 SCTP_DATA_FIRST_FRAG = 0x02, 242 SCTP_DATA_FIRST_FRAG = 0x02,
243 SCTP_DATA_NOT_FRAG = 0x03, 243 SCTP_DATA_NOT_FRAG = 0x03,
244 SCTP_DATA_UNORDERED = 0x04, 244 SCTP_DATA_UNORDERED = 0x04,
245 SCTP_DATA_SACK_IMM = 0x08,
245}; 246};
246enum { SCTP_DATA_FRAG_MASK = 0x03, }; 247enum { SCTP_DATA_FRAG_MASK = 0x03, };
247 248
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
index db532ce288be..8c3dd36fe91a 100644
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
@@ -179,6 +179,9 @@
179/* BCM63xx family SoCs */ 179/* BCM63xx family SoCs */
180#define PORT_BCM63XX 89 180#define PORT_BCM63XX 89
181 181
182/* Aeroflex Gaisler GRLIB APBUART */
183#define PORT_APBUART 90
184
182#ifdef __KERNEL__ 185#ifdef __KERNEL__
183 186
184#include <linux/compiler.h> 187#include <linux/compiler.h>
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index bcdd6606f468..ae836fded530 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -299,7 +299,7 @@ typedef unsigned char *sk_buff_data_t;
299 * @nfctinfo: Relationship of this skb to the connection 299 * @nfctinfo: Relationship of this skb to the connection
300 * @nfct_reasm: netfilter conntrack re-assembly pointer 300 * @nfct_reasm: netfilter conntrack re-assembly pointer
301 * @nf_bridge: Saved data about a bridged frame - see br_netfilter.c 301 * @nf_bridge: Saved data about a bridged frame - see br_netfilter.c
302 * @iif: ifindex of device we arrived on 302 * @skb_iif: ifindex of device we arrived on
303 * @queue_mapping: Queue mapping for multiqueue devices 303 * @queue_mapping: Queue mapping for multiqueue devices
304 * @tc_index: Traffic control index 304 * @tc_index: Traffic control index
305 * @tc_verd: traffic control verdict 305 * @tc_verd: traffic control verdict
@@ -366,7 +366,7 @@ struct sk_buff {
366 struct nf_bridge_info *nf_bridge; 366 struct nf_bridge_info *nf_bridge;
367#endif 367#endif
368 368
369 int iif; 369 int skb_iif;
370#ifdef CONFIG_NET_SCHED 370#ifdef CONFIG_NET_SCHED
371 __u16 tc_index; /* traffic control index */ 371 __u16 tc_index; /* traffic control index */
372#ifdef CONFIG_NET_CLS_ACT 372#ifdef CONFIG_NET_CLS_ACT
@@ -389,8 +389,10 @@ struct sk_buff {
389#ifdef CONFIG_NETWORK_SECMARK 389#ifdef CONFIG_NETWORK_SECMARK
390 __u32 secmark; 390 __u32 secmark;
391#endif 391#endif
392 392 union {
393 __u32 mark; 393 __u32 mark;
394 __u32 dropcount;
395 };
394 396
395 __u16 vlan_tci; 397 __u16 vlan_tci;
396 398
@@ -414,14 +416,6 @@ struct sk_buff {
414 416
415#include <asm/system.h> 417#include <asm/system.h>
416 418
417#ifdef CONFIG_HAS_DMA
418#include <linux/dma-mapping.h>
419extern int skb_dma_map(struct device *dev, struct sk_buff *skb,
420 enum dma_data_direction dir);
421extern void skb_dma_unmap(struct device *dev, struct sk_buff *skb,
422 enum dma_data_direction dir);
423#endif
424
425static inline struct dst_entry *skb_dst(const struct sk_buff *skb) 419static inline struct dst_entry *skb_dst(const struct sk_buff *skb)
426{ 420{
427 return (struct dst_entry *)skb->_skb_dst; 421 return (struct dst_entry *)skb->_skb_dst;
@@ -489,8 +483,7 @@ extern int skb_append_datato_frags(struct sock *sk, struct sk_buff *skb,
489 int len,int odd, struct sk_buff *skb), 483 int len,int odd, struct sk_buff *skb),
490 void *from, int length); 484 void *from, int length);
491 485
492struct skb_seq_state 486struct skb_seq_state {
493{
494 __u32 lower_offset; 487 __u32 lower_offset;
495 __u32 upper_offset; 488 __u32 upper_offset;
496 __u32 frag_idx; 489 __u32 frag_idx;
@@ -1489,6 +1482,16 @@ static inline struct sk_buff *netdev_alloc_skb(struct net_device *dev,
1489 return __netdev_alloc_skb(dev, length, GFP_ATOMIC); 1482 return __netdev_alloc_skb(dev, length, GFP_ATOMIC);
1490} 1483}
1491 1484
1485static inline struct sk_buff *netdev_alloc_skb_ip_align(struct net_device *dev,
1486 unsigned int length)
1487{
1488 struct sk_buff *skb = netdev_alloc_skb(dev, length + NET_IP_ALIGN);
1489
1490 if (NET_IP_ALIGN && skb)
1491 skb_reserve(skb, NET_IP_ALIGN);
1492 return skb;
1493}
1494
1492extern struct page *__netdev_alloc_page(struct net_device *dev, gfp_t gfp_mask); 1495extern struct page *__netdev_alloc_page(struct net_device *dev, gfp_t gfp_mask);
1493 1496
1494/** 1497/**
diff --git a/include/linux/smsc911x.h b/include/linux/smsc911x.h
index 5241e4fb4eca..7144e8aa1e41 100644
--- a/include/linux/smsc911x.h
+++ b/include/linux/smsc911x.h
@@ -30,6 +30,7 @@ struct smsc911x_platform_config {
30 unsigned int irq_type; 30 unsigned int irq_type;
31 unsigned int flags; 31 unsigned int flags;
32 phy_interface_t phy_interface; 32 phy_interface_t phy_interface;
33 unsigned char mac[6];
33}; 34};
34 35
35/* Constants for platform_device irq polarity configuration */ 36/* Constants for platform_device irq polarity configuration */
diff --git a/include/linux/socket.h b/include/linux/socket.h
index 3273a0c5043b..7b3aae2052a6 100644
--- a/include/linux/socket.h
+++ b/include/linux/socket.h
@@ -24,6 +24,9 @@ struct __kernel_sockaddr_storage {
24#include <linux/types.h> /* pid_t */ 24#include <linux/types.h> /* pid_t */
25#include <linux/compiler.h> /* __user */ 25#include <linux/compiler.h> /* __user */
26 26
27#define __sockaddr_check_size(size) \
28 BUILD_BUG_ON(((size) > sizeof(struct __kernel_sockaddr_storage)))
29
27#ifdef __KERNEL__ 30#ifdef __KERNEL__
28# ifdef CONFIG_PROC_FS 31# ifdef CONFIG_PROC_FS
29struct seq_file; 32struct seq_file;
@@ -65,6 +68,12 @@ struct msghdr {
65 unsigned msg_flags; 68 unsigned msg_flags;
66}; 69};
67 70
71/* For recvmmsg/sendmmsg */
72struct mmsghdr {
73 struct msghdr msg_hdr;
74 unsigned msg_len;
75};
76
68/* 77/*
69 * POSIX 1003.1g - ancillary data object information 78 * POSIX 1003.1g - ancillary data object information
70 * Ancillary data consits of a sequence of pairs of 79 * Ancillary data consits of a sequence of pairs of
@@ -312,6 +321,10 @@ extern int move_addr_to_user(struct sockaddr *kaddr, int klen, void __user *uadd
312extern int move_addr_to_kernel(void __user *uaddr, int ulen, struct sockaddr *kaddr); 321extern 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); 322extern int put_cmsg(struct msghdr*, int level, int type, int len, void *data);
314 323
324struct timespec;
325
326extern int __sys_recvmmsg(int fd, struct mmsghdr __user *mmsg, unsigned int vlen,
327 unsigned int flags, struct timespec *timeout);
315#endif 328#endif
316#endif /* not kernel and not glibc */ 329#endif /* not kernel and not glibc */
317#endif /* _LINUX_SOCKET_H */ 330#endif /* _LINUX_SOCKET_H */
diff --git a/include/linux/spi/wl12xx.h b/include/linux/spi/wl12xx.h
index 11430cab2aad..aed64ed3dc8a 100644
--- a/include/linux/spi/wl12xx.h
+++ b/include/linux/spi/wl12xx.h
@@ -26,6 +26,7 @@
26 26
27struct wl12xx_platform_data { 27struct wl12xx_platform_data {
28 void (*set_power)(bool enable); 28 void (*set_power)(bool enable);
29 bool use_eeprom;
29}; 30};
30 31
31#endif 32#endif
diff --git a/include/linux/ssb/ssb.h b/include/linux/ssb/ssb.h
index 3d0a9ff24f01..24f988547361 100644
--- a/include/linux/ssb/ssb.h
+++ b/include/linux/ssb/ssb.h
@@ -269,7 +269,8 @@ struct ssb_bus {
269 269
270 const struct ssb_bus_ops *ops; 270 const struct ssb_bus_ops *ops;
271 271
272 /* The core in the basic address register window. (PCI bus only) */ 272 /* The core currently mapped into the MMIO window.
273 * Not valid on all host-buses. So don't use outside of SSB. */
273 struct ssb_device *mapped_device; 274 struct ssb_device *mapped_device;
274 union { 275 union {
275 /* Currently mapped PCMCIA segment. (bustype == SSB_BUSTYPE_PCMCIA only) */ 276 /* Currently mapped PCMCIA segment. (bustype == SSB_BUSTYPE_PCMCIA only) */
@@ -281,14 +282,17 @@ struct ssb_bus {
281 * On PCMCIA-host busses this is used to protect the whole MMIO access. */ 282 * On PCMCIA-host busses this is used to protect the whole MMIO access. */
282 spinlock_t bar_lock; 283 spinlock_t bar_lock;
283 284
284 /* The bus this backplane is running on. */ 285 /* The host-bus this backplane is running on. */
285 enum ssb_bustype bustype; 286 enum ssb_bustype bustype;
286 /* Pointer to the PCI bus (only valid if bustype == SSB_BUSTYPE_PCI). */ 287 /* Pointers to the host-bus. Check bustype before using any of these pointers. */
287 struct pci_dev *host_pci; 288 union {
288 /* Pointer to the PCMCIA device (only if bustype == SSB_BUSTYPE_PCMCIA). */ 289 /* Pointer to the PCI bus (only valid if bustype == SSB_BUSTYPE_PCI). */
289 struct pcmcia_device *host_pcmcia; 290 struct pci_dev *host_pci;
290 /* Pointer to the SDIO device (only if bustype == SSB_BUSTYPE_SDIO). */ 291 /* Pointer to the PCMCIA device (only if bustype == SSB_BUSTYPE_PCMCIA). */
291 struct sdio_func *host_sdio; 292 struct pcmcia_device *host_pcmcia;
293 /* Pointer to the SDIO device (only if bustype == SSB_BUSTYPE_SDIO). */
294 struct sdio_func *host_sdio;
295 };
292 296
293 /* See enum ssb_quirks */ 297 /* See enum ssb_quirks */
294 unsigned int quirks; 298 unsigned int quirks;
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h
index e79e2f3ccc51..bc70c5810fec 100644
--- a/include/linux/syscalls.h
+++ b/include/linux/syscalls.h
@@ -25,6 +25,7 @@ struct linux_dirent64;
25struct list_head; 25struct list_head;
26struct msgbuf; 26struct msgbuf;
27struct msghdr; 27struct msghdr;
28struct mmsghdr;
28struct msqid_ds; 29struct msqid_ds;
29struct new_utsname; 30struct new_utsname;
30struct nfsctl_arg; 31struct nfsctl_arg;
@@ -628,6 +629,9 @@ asmlinkage long sys_recv(int, void __user *, size_t, unsigned);
628asmlinkage long sys_recvfrom(int, void __user *, size_t, unsigned, 629asmlinkage long sys_recvfrom(int, void __user *, size_t, unsigned,
629 struct sockaddr __user *, int __user *); 630 struct sockaddr __user *, int __user *);
630asmlinkage long sys_recvmsg(int fd, struct msghdr __user *msg, unsigned flags); 631asmlinkage long sys_recvmsg(int fd, struct msghdr __user *msg, unsigned flags);
632asmlinkage long sys_recvmmsg(int fd, struct mmsghdr __user *msg,
633 unsigned int vlen, unsigned flags,
634 struct timespec __user *timeout);
631asmlinkage long sys_socket(int, int, int); 635asmlinkage long sys_socket(int, int, int);
632asmlinkage long sys_socketpair(int, int, int, int __user *); 636asmlinkage long sys_socketpair(int, int, int, int __user *);
633asmlinkage long sys_socketcall(int call, unsigned long __user *args); 637asmlinkage long sys_socketcall(int call, unsigned long __user *args);
diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h
index 1e4743ee6831..56af3ca75e24 100644
--- a/include/linux/sysctl.h
+++ b/include/linux/sysctl.h
@@ -15,9 +15,6 @@
15 ** The kernel will then return -ENOTDIR to any application using 15 ** The kernel will then return -ENOTDIR to any application using
16 ** the old binary interface. 16 ** the old binary interface.
17 ** 17 **
18 ** For new interfaces unless you really need a binary number
19 ** please use CTL_UNNUMBERED.
20 **
21 **************************************************************** 18 ****************************************************************
22 **************************************************************** 19 ****************************************************************
23 */ 20 */
@@ -50,12 +47,6 @@ struct __sysctl_args {
50 47
51/* Top-level names: */ 48/* Top-level names: */
52 49
53/* For internal pattern-matching use only: */
54#ifdef __KERNEL__
55#define CTL_NONE 0
56#define CTL_UNNUMBERED CTL_NONE /* sysctl without a binary number */
57#endif
58
59enum 50enum
60{ 51{
61 CTL_KERN=1, /* General kernel info and control */ 52 CTL_KERN=1, /* General kernel info and control */
@@ -490,6 +481,7 @@ enum
490 NET_IPV4_CONF_PROMOTE_SECONDARIES=20, 481 NET_IPV4_CONF_PROMOTE_SECONDARIES=20,
491 NET_IPV4_CONF_ARP_ACCEPT=21, 482 NET_IPV4_CONF_ARP_ACCEPT=21,
492 NET_IPV4_CONF_ARP_NOTIFY=22, 483 NET_IPV4_CONF_ARP_NOTIFY=22,
484 NET_IPV4_CONF_ACCEPT_LOCAL=23,
493 __NET_IPV4_CONF_MAX 485 __NET_IPV4_CONF_MAX
494}; 486};
495 487
@@ -972,10 +964,6 @@ extern int sysctl_perm(struct ctl_table_root *root,
972 964
973typedef struct ctl_table ctl_table; 965typedef struct ctl_table ctl_table;
974 966
975typedef int ctl_handler (struct ctl_table *table,
976 void __user *oldval, size_t __user *oldlenp,
977 void __user *newval, size_t newlen);
978
979typedef int proc_handler (struct ctl_table *ctl, int write, 967typedef int proc_handler (struct ctl_table *ctl, int write,
980 void __user *buffer, size_t *lenp, loff_t *ppos); 968 void __user *buffer, size_t *lenp, loff_t *ppos);
981 969
@@ -996,21 +984,10 @@ extern int proc_doulongvec_minmax(struct ctl_table *, int,
996extern int proc_doulongvec_ms_jiffies_minmax(struct ctl_table *table, int, 984extern int proc_doulongvec_ms_jiffies_minmax(struct ctl_table *table, int,
997 void __user *, size_t *, loff_t *); 985 void __user *, size_t *, loff_t *);
998 986
999extern int do_sysctl (int __user *name, int nlen,
1000 void __user *oldval, size_t __user *oldlenp,
1001 void __user *newval, size_t newlen);
1002
1003extern ctl_handler sysctl_data;
1004extern ctl_handler sysctl_string;
1005extern ctl_handler sysctl_intvec;
1006extern ctl_handler sysctl_jiffies;
1007extern ctl_handler sysctl_ms_jiffies;
1008
1009
1010/* 987/*
1011 * Register a set of sysctl names by calling register_sysctl_table 988 * Register a set of sysctl names by calling register_sysctl_table
1012 * with an initialised array of struct ctl_table's. An entry with zero 989 * with an initialised array of struct ctl_table's. An entry with
1013 * ctl_name and NULL procname terminates the table. table->de will be 990 * NULL procname terminates the table. table->de will be
1014 * set up by the registration and need not be initialised in advance. 991 * set up by the registration and need not be initialised in advance.
1015 * 992 *
1016 * sysctl names can be mirrored automatically under /proc/sys. The 993 * sysctl names can be mirrored automatically under /proc/sys. The
@@ -1023,24 +1000,11 @@ extern ctl_handler sysctl_ms_jiffies;
1023 * under /proc; non-leaf nodes will be represented by directories. A 1000 * under /proc; non-leaf nodes will be represented by directories. A
1024 * null procname disables /proc mirroring at this node. 1001 * null procname disables /proc mirroring at this node.
1025 * 1002 *
1026 * sysctl entries with a zero ctl_name will not be available through
1027 * the binary sysctl interface.
1028 *
1029 * sysctl(2) can automatically manage read and write requests through 1003 * sysctl(2) can automatically manage read and write requests through
1030 * the sysctl table. The data and maxlen fields of the ctl_table 1004 * the sysctl table. The data and maxlen fields of the ctl_table
1031 * struct enable minimal validation of the values being written to be 1005 * struct enable minimal validation of the values being written to be
1032 * performed, and the mode field allows minimal authentication. 1006 * performed, and the mode field allows minimal authentication.
1033 * 1007 *
1034 * More sophisticated management can be enabled by the provision of a
1035 * strategy routine with the table entry. This will be called before
1036 * any automatic read or write of the data is performed.
1037 *
1038 * The strategy routine may return:
1039 * <0: Error occurred (error is passed to user process)
1040 * 0: OK - proceed with automatic read or write.
1041 * >0: OK - read or write has been done by the strategy routine, so
1042 * return immediately.
1043 *
1044 * There must be a proc_handler routine for any terminal nodes 1008 * There must be a proc_handler routine for any terminal nodes
1045 * mirrored under /proc/sys (non-terminals are handled by a built-in 1009 * mirrored under /proc/sys (non-terminals are handled by a built-in
1046 * directory handler). Several default handlers are available to 1010 * directory handler). Several default handlers are available to
@@ -1050,7 +1014,6 @@ extern ctl_handler sysctl_ms_jiffies;
1050/* A sysctl table is an array of struct ctl_table: */ 1014/* A sysctl table is an array of struct ctl_table: */
1051struct ctl_table 1015struct ctl_table
1052{ 1016{
1053 int ctl_name; /* Binary ID */
1054 const char *procname; /* Text ID for /proc/sys, or zero */ 1017 const char *procname; /* Text ID for /proc/sys, or zero */
1055 void *data; 1018 void *data;
1056 int maxlen; 1019 int maxlen;
@@ -1058,7 +1021,6 @@ struct ctl_table
1058 struct ctl_table *child; 1021 struct ctl_table *child;
1059 struct ctl_table *parent; /* Automatically set */ 1022 struct ctl_table *parent; /* Automatically set */
1060 proc_handler *proc_handler; /* Callback for text formatting */ 1023 proc_handler *proc_handler; /* Callback for text formatting */
1061 ctl_handler *strategy; /* Callback function for all r/w */
1062 void *extra1; 1024 void *extra1;
1063 void *extra2; 1025 void *extra2;
1064}; 1026};
@@ -1092,7 +1054,6 @@ struct ctl_table_header
1092/* struct ctl_path describes where in the hierarchy a table is added */ 1054/* struct ctl_path describes where in the hierarchy a table is added */
1093struct ctl_path { 1055struct ctl_path {
1094 const char *procname; 1056 const char *procname;
1095 int ctl_name;
1096}; 1057};
1097 1058
1098void register_sysctl_root(struct ctl_table_root *root); 1059void register_sysctl_root(struct ctl_table_root *root);
diff --git a/include/linux/tc_act/tc_defact.h b/include/linux/tc_act/tc_defact.h
index 964f473af0f0..6f65d07c7ce2 100644
--- a/include/linux/tc_act/tc_defact.h
+++ b/include/linux/tc_act/tc_defact.h
@@ -3,13 +3,11 @@
3 3
4#include <linux/pkt_cls.h> 4#include <linux/pkt_cls.h>
5 5
6struct tc_defact 6struct tc_defact {
7{
8 tc_gen; 7 tc_gen;
9}; 8};
10 9
11enum 10enum {
12{
13 TCA_DEF_UNSPEC, 11 TCA_DEF_UNSPEC,
14 TCA_DEF_TM, 12 TCA_DEF_TM,
15 TCA_DEF_PARMS, 13 TCA_DEF_PARMS,
diff --git a/include/linux/tc_act/tc_gact.h b/include/linux/tc_act/tc_gact.h
index e895c0a39629..f7bf94eed510 100644
--- a/include/linux/tc_act/tc_gact.h
+++ b/include/linux/tc_act/tc_gact.h
@@ -5,14 +5,12 @@
5#include <linux/pkt_cls.h> 5#include <linux/pkt_cls.h>
6 6
7#define TCA_ACT_GACT 5 7#define TCA_ACT_GACT 5
8struct tc_gact 8struct tc_gact {
9{
10 tc_gen; 9 tc_gen;
11 10
12}; 11};
13 12
14struct tc_gact_p 13struct tc_gact_p {
15{
16#define PGACT_NONE 0 14#define PGACT_NONE 0
17#define PGACT_NETRAND 1 15#define PGACT_NETRAND 1
18#define PGACT_DETERM 2 16#define PGACT_DETERM 2
@@ -22,8 +20,7 @@ struct tc_gact_p
22 int paction; 20 int paction;
23}; 21};
24 22
25enum 23enum {
26{
27 TCA_GACT_UNSPEC, 24 TCA_GACT_UNSPEC,
28 TCA_GACT_TM, 25 TCA_GACT_TM,
29 TCA_GACT_PARMS, 26 TCA_GACT_PARMS,
diff --git a/include/linux/tc_act/tc_ipt.h b/include/linux/tc_act/tc_ipt.h
index 4b6f7b6c7a79..a2335563d21f 100644
--- a/include/linux/tc_act/tc_ipt.h
+++ b/include/linux/tc_act/tc_ipt.h
@@ -5,8 +5,7 @@
5 5
6#define TCA_ACT_IPT 6 6#define TCA_ACT_IPT 6
7 7
8enum 8enum {
9{
10 TCA_IPT_UNSPEC, 9 TCA_IPT_UNSPEC,
11 TCA_IPT_TABLE, 10 TCA_IPT_TABLE,
12 TCA_IPT_HOOK, 11 TCA_IPT_HOOK,
diff --git a/include/linux/tc_act/tc_mirred.h b/include/linux/tc_act/tc_mirred.h
index 0a99ab60d610..7561750e8fd6 100644
--- a/include/linux/tc_act/tc_mirred.h
+++ b/include/linux/tc_act/tc_mirred.h
@@ -10,15 +10,13 @@
10#define TCA_INGRESS_REDIR 3 /* packet redirect to INGRESS*/ 10#define TCA_INGRESS_REDIR 3 /* packet redirect to INGRESS*/
11#define TCA_INGRESS_MIRROR 4 /* mirror packet to INGRESS */ 11#define TCA_INGRESS_MIRROR 4 /* mirror packet to INGRESS */
12 12
13struct tc_mirred 13struct tc_mirred {
14{
15 tc_gen; 14 tc_gen;
16 int eaction; /* one of IN/EGRESS_MIRROR/REDIR */ 15 int eaction; /* one of IN/EGRESS_MIRROR/REDIR */
17 __u32 ifindex; /* ifindex of egress port */ 16 __u32 ifindex; /* ifindex of egress port */
18}; 17};
19 18
20enum 19enum {
21{
22 TCA_MIRRED_UNSPEC, 20 TCA_MIRRED_UNSPEC,
23 TCA_MIRRED_TM, 21 TCA_MIRRED_TM,
24 TCA_MIRRED_PARMS, 22 TCA_MIRRED_PARMS,
diff --git a/include/linux/tc_act/tc_nat.h b/include/linux/tc_act/tc_nat.h
index e7cf31e8ba79..6663aeba0b9a 100644
--- a/include/linux/tc_act/tc_nat.h
+++ b/include/linux/tc_act/tc_nat.h
@@ -6,8 +6,7 @@
6 6
7#define TCA_ACT_NAT 9 7#define TCA_ACT_NAT 9
8 8
9enum 9enum {
10{
11 TCA_NAT_UNSPEC, 10 TCA_NAT_UNSPEC,
12 TCA_NAT_PARMS, 11 TCA_NAT_PARMS,
13 TCA_NAT_TM, 12 TCA_NAT_TM,
@@ -17,8 +16,7 @@ enum
17 16
18#define TCA_NAT_FLAG_EGRESS 1 17#define TCA_NAT_FLAG_EGRESS 1
19 18
20struct tc_nat 19struct tc_nat {
21{
22 tc_gen; 20 tc_gen;
23 __be32 old_addr; 21 __be32 old_addr;
24 __be32 new_addr; 22 __be32 new_addr;
diff --git a/include/linux/tc_act/tc_pedit.h b/include/linux/tc_act/tc_pedit.h
index 54ce9064115a..716cfabcd5b2 100644
--- a/include/linux/tc_act/tc_pedit.h
+++ b/include/linux/tc_act/tc_pedit.h
@@ -6,8 +6,7 @@
6 6
7#define TCA_ACT_PEDIT 7 7#define TCA_ACT_PEDIT 7
8 8
9enum 9enum {
10{
11 TCA_PEDIT_UNSPEC, 10 TCA_PEDIT_UNSPEC,
12 TCA_PEDIT_TM, 11 TCA_PEDIT_TM,
13 TCA_PEDIT_PARMS, 12 TCA_PEDIT_PARMS,
@@ -15,8 +14,7 @@ enum
15}; 14};
16#define TCA_PEDIT_MAX (__TCA_PEDIT_MAX - 1) 15#define TCA_PEDIT_MAX (__TCA_PEDIT_MAX - 1)
17 16
18struct tc_pedit_key 17struct tc_pedit_key {
19{
20 __u32 mask; /* AND */ 18 __u32 mask; /* AND */
21 __u32 val; /*XOR */ 19 __u32 val; /*XOR */
22 __u32 off; /*offset */ 20 __u32 off; /*offset */
@@ -25,8 +23,7 @@ struct tc_pedit_key
25 __u32 shift; 23 __u32 shift;
26}; 24};
27 25
28struct tc_pedit_sel 26struct tc_pedit_sel {
29{
30 tc_gen; 27 tc_gen;
31 unsigned char nkeys; 28 unsigned char nkeys;
32 unsigned char flags; 29 unsigned char flags;
diff --git a/include/linux/tc_act/tc_skbedit.h b/include/linux/tc_act/tc_skbedit.h
index a14e461a7af7..7a2e910a5f08 100644
--- a/include/linux/tc_act/tc_skbedit.h
+++ b/include/linux/tc_act/tc_skbedit.h
@@ -26,6 +26,7 @@
26 26
27#define SKBEDIT_F_PRIORITY 0x1 27#define SKBEDIT_F_PRIORITY 0x1
28#define SKBEDIT_F_QUEUE_MAPPING 0x2 28#define SKBEDIT_F_QUEUE_MAPPING 0x2
29#define SKBEDIT_F_MARK 0x4
29 30
30struct tc_skbedit { 31struct tc_skbedit {
31 tc_gen; 32 tc_gen;
@@ -37,6 +38,7 @@ enum {
37 TCA_SKBEDIT_PARMS, 38 TCA_SKBEDIT_PARMS,
38 TCA_SKBEDIT_PRIORITY, 39 TCA_SKBEDIT_PRIORITY,
39 TCA_SKBEDIT_QUEUE_MAPPING, 40 TCA_SKBEDIT_QUEUE_MAPPING,
41 TCA_SKBEDIT_MARK,
40 __TCA_SKBEDIT_MAX 42 __TCA_SKBEDIT_MAX
41}; 43};
42#define TCA_SKBEDIT_MAX (__TCA_SKBEDIT_MAX - 1) 44#define TCA_SKBEDIT_MAX (__TCA_SKBEDIT_MAX - 1)
diff --git a/include/linux/tc_ematch/tc_em_cmp.h b/include/linux/tc_ematch/tc_em_cmp.h
index 38e7f7b25ec2..f34bb1bae083 100644
--- a/include/linux/tc_ematch/tc_em_cmp.h
+++ b/include/linux/tc_ematch/tc_em_cmp.h
@@ -4,8 +4,7 @@
4#include <linux/types.h> 4#include <linux/types.h>
5#include <linux/pkt_cls.h> 5#include <linux/pkt_cls.h>
6 6
7struct tcf_em_cmp 7struct tcf_em_cmp {
8{
9 __u32 val; 8 __u32 val;
10 __u32 mask; 9 __u32 mask;
11 __u16 off; 10 __u16 off;
@@ -15,8 +14,7 @@ struct tcf_em_cmp
15 __u8 opnd:4; 14 __u8 opnd:4;
16}; 15};
17 16
18enum 17enum {
19{
20 TCF_EM_ALIGN_U8 = 1, 18 TCF_EM_ALIGN_U8 = 1,
21 TCF_EM_ALIGN_U16 = 2, 19 TCF_EM_ALIGN_U16 = 2,
22 TCF_EM_ALIGN_U32 = 4 20 TCF_EM_ALIGN_U32 = 4
diff --git a/include/linux/tc_ematch/tc_em_meta.h b/include/linux/tc_ematch/tc_em_meta.h
index dcfb733fa1f6..0864206ec1a3 100644
--- a/include/linux/tc_ematch/tc_em_meta.h
+++ b/include/linux/tc_ematch/tc_em_meta.h
@@ -4,8 +4,7 @@
4#include <linux/types.h> 4#include <linux/types.h>
5#include <linux/pkt_cls.h> 5#include <linux/pkt_cls.h>
6 6
7enum 7enum {
8{
9 TCA_EM_META_UNSPEC, 8 TCA_EM_META_UNSPEC,
10 TCA_EM_META_HDR, 9 TCA_EM_META_HDR,
11 TCA_EM_META_LVALUE, 10 TCA_EM_META_LVALUE,
@@ -14,8 +13,7 @@ enum
14}; 13};
15#define TCA_EM_META_MAX (__TCA_EM_META_MAX - 1) 14#define TCA_EM_META_MAX (__TCA_EM_META_MAX - 1)
16 15
17struct tcf_meta_val 16struct tcf_meta_val {
18{
19 __u16 kind; 17 __u16 kind;
20 __u8 shift; 18 __u8 shift;
21 __u8 op; 19 __u8 op;
@@ -26,16 +24,14 @@ struct tcf_meta_val
26#define TCF_META_ID_MASK 0x7ff 24#define TCF_META_ID_MASK 0x7ff
27#define TCF_META_ID(kind) ((kind) & TCF_META_ID_MASK) 25#define TCF_META_ID(kind) ((kind) & TCF_META_ID_MASK)
28 26
29enum 27enum {
30{
31 TCF_META_TYPE_VAR, 28 TCF_META_TYPE_VAR,
32 TCF_META_TYPE_INT, 29 TCF_META_TYPE_INT,
33 __TCF_META_TYPE_MAX 30 __TCF_META_TYPE_MAX
34}; 31};
35#define TCF_META_TYPE_MAX (__TCF_META_TYPE_MAX - 1) 32#define TCF_META_TYPE_MAX (__TCF_META_TYPE_MAX - 1)
36 33
37enum 34enum {
38{
39 TCF_META_ID_VALUE, 35 TCF_META_ID_VALUE,
40 TCF_META_ID_RANDOM, 36 TCF_META_ID_RANDOM,
41 TCF_META_ID_LOADAVG_0, 37 TCF_META_ID_LOADAVG_0,
@@ -87,8 +83,7 @@ enum
87}; 83};
88#define TCF_META_ID_MAX (__TCF_META_ID_MAX - 1) 84#define TCF_META_ID_MAX (__TCF_META_ID_MAX - 1)
89 85
90struct tcf_meta_hdr 86struct tcf_meta_hdr {
91{
92 struct tcf_meta_val left; 87 struct tcf_meta_val left;
93 struct tcf_meta_val right; 88 struct tcf_meta_val right;
94}; 89};
diff --git a/include/linux/tc_ematch/tc_em_nbyte.h b/include/linux/tc_ematch/tc_em_nbyte.h
index 9ed8c2e58488..7172cfb999c1 100644
--- a/include/linux/tc_ematch/tc_em_nbyte.h
+++ b/include/linux/tc_ematch/tc_em_nbyte.h
@@ -4,8 +4,7 @@
4#include <linux/types.h> 4#include <linux/types.h>
5#include <linux/pkt_cls.h> 5#include <linux/pkt_cls.h>
6 6
7struct tcf_em_nbyte 7struct tcf_em_nbyte {
8{
9 __u16 off; 8 __u16 off;
10 __u16 len:12; 9 __u16 len:12;
11 __u8 layer:4; 10 __u8 layer:4;
diff --git a/include/linux/tc_ematch/tc_em_text.h b/include/linux/tc_ematch/tc_em_text.h
index d12a73a225fc..5aac4045ba88 100644
--- a/include/linux/tc_ematch/tc_em_text.h
+++ b/include/linux/tc_ematch/tc_em_text.h
@@ -6,8 +6,7 @@
6 6
7#define TC_EM_TEXT_ALGOSIZ 16 7#define TC_EM_TEXT_ALGOSIZ 16
8 8
9struct tcf_em_text 9struct tcf_em_text {
10{
11 char algo[TC_EM_TEXT_ALGOSIZ]; 10 char algo[TC_EM_TEXT_ALGOSIZ];
12 __u16 from_offset; 11 __u16 from_offset;
13 __u16 to_offset; 12 __u16 to_offset;
diff --git a/include/linux/tcp.h b/include/linux/tcp.h
index 61723a7c21fe..7fee8a4df931 100644
--- a/include/linux/tcp.h
+++ b/include/linux/tcp.h
@@ -81,6 +81,12 @@ enum {
81 TCP_DATA_OFFSET = __cpu_to_be32(0xF0000000) 81 TCP_DATA_OFFSET = __cpu_to_be32(0xF0000000)
82}; 82};
83 83
84/*
85 * TCP general constants
86 */
87#define TCP_MSS_DEFAULT 536U /* IPv4 (RFC1122, RFC2581) */
88#define TCP_MSS_DESIRED 1220U /* IPv6 (tunneled), EDNS0 (RFC3226) */
89
84/* TCP socket options */ 90/* TCP socket options */
85#define TCP_NODELAY 1 /* Turn off Nagle's algorithm. */ 91#define TCP_NODELAY 1 /* Turn off Nagle's algorithm. */
86#define TCP_MAXSEG 2 /* Limit MSS */ 92#define TCP_MAXSEG 2 /* Limit MSS */
@@ -96,14 +102,15 @@ enum {
96#define TCP_QUICKACK 12 /* Block/reenable quick acks */ 102#define TCP_QUICKACK 12 /* Block/reenable quick acks */
97#define TCP_CONGESTION 13 /* Congestion control algorithm */ 103#define TCP_CONGESTION 13 /* Congestion control algorithm */
98#define TCP_MD5SIG 14 /* TCP MD5 Signature (RFC2385) */ 104#define TCP_MD5SIG 14 /* TCP MD5 Signature (RFC2385) */
105#define TCP_COOKIE_TRANSACTIONS 15 /* TCP Cookie Transactions */
99 106
107/* for TCP_INFO socket option */
100#define TCPI_OPT_TIMESTAMPS 1 108#define TCPI_OPT_TIMESTAMPS 1
101#define TCPI_OPT_SACK 2 109#define TCPI_OPT_SACK 2
102#define TCPI_OPT_WSCALE 4 110#define TCPI_OPT_WSCALE 4
103#define TCPI_OPT_ECN 8 111#define TCPI_OPT_ECN 8
104 112
105enum tcp_ca_state 113enum tcp_ca_state {
106{
107 TCP_CA_Open = 0, 114 TCP_CA_Open = 0,
108#define TCPF_CA_Open (1<<TCP_CA_Open) 115#define TCPF_CA_Open (1<<TCP_CA_Open)
109 TCP_CA_Disorder = 1, 116 TCP_CA_Disorder = 1,
@@ -116,8 +123,7 @@ enum tcp_ca_state
116#define TCPF_CA_Loss (1<<TCP_CA_Loss) 123#define TCPF_CA_Loss (1<<TCP_CA_Loss)
117}; 124};
118 125
119struct tcp_info 126struct tcp_info {
120{
121 __u8 tcpi_state; 127 __u8 tcpi_state;
122 __u8 tcpi_ca_state; 128 __u8 tcpi_ca_state;
123 __u8 tcpi_retransmits; 129 __u8 tcpi_retransmits;
@@ -170,6 +176,30 @@ struct tcp_md5sig {
170 __u8 tcpm_key[TCP_MD5SIG_MAXKEYLEN]; /* key (binary) */ 176 __u8 tcpm_key[TCP_MD5SIG_MAXKEYLEN]; /* key (binary) */
171}; 177};
172 178
179/* for TCP_COOKIE_TRANSACTIONS (TCPCT) socket option */
180#define TCP_COOKIE_MIN 8 /* 64-bits */
181#define TCP_COOKIE_MAX 16 /* 128-bits */
182#define TCP_COOKIE_PAIR_SIZE (2*TCP_COOKIE_MAX)
183
184/* Flags for both getsockopt and setsockopt */
185#define TCP_COOKIE_IN_ALWAYS (1 << 0) /* Discard SYN without cookie */
186#define TCP_COOKIE_OUT_NEVER (1 << 1) /* Prohibit outgoing cookies,
187 * supercedes everything. */
188
189/* Flags for getsockopt */
190#define TCP_S_DATA_IN (1 << 2) /* Was data received? */
191#define TCP_S_DATA_OUT (1 << 3) /* Was data sent? */
192
193/* TCP_COOKIE_TRANSACTIONS data */
194struct tcp_cookie_transactions {
195 __u16 tcpct_flags; /* see above */
196 __u8 __tcpct_pad1; /* zero */
197 __u8 tcpct_cookie_desired; /* bytes */
198 __u16 tcpct_s_data_desired; /* bytes of variable data */
199 __u16 tcpct_used; /* bytes in value */
200 __u8 tcpct_value[TCP_MSS_DEFAULT];
201};
202
173#ifdef __KERNEL__ 203#ifdef __KERNEL__
174 204
175#include <linux/skbuff.h> 205#include <linux/skbuff.h>
@@ -217,26 +247,38 @@ struct tcp_options_received {
217 sack_ok : 4, /* SACK seen on SYN packet */ 247 sack_ok : 4, /* SACK seen on SYN packet */
218 snd_wscale : 4, /* Window scaling received from sender */ 248 snd_wscale : 4, /* Window scaling received from sender */
219 rcv_wscale : 4; /* Window scaling to send to receiver */ 249 rcv_wscale : 4; /* Window scaling to send to receiver */
220/* SACKs data */ 250 u8 cookie_plus:6, /* bytes in authenticator/cookie option */
251 cookie_out_never:1,
252 cookie_in_always:1;
221 u8 num_sacks; /* Number of SACK blocks */ 253 u8 num_sacks; /* Number of SACK blocks */
222 u16 user_mss; /* mss requested by user in ioctl */ 254 u16 user_mss; /* mss requested by user in ioctl */
223 u16 mss_clamp; /* Maximal mss, negotiated at connection setup */ 255 u16 mss_clamp; /* Maximal mss, negotiated at connection setup */
224}; 256};
225 257
258static inline void tcp_clear_options(struct tcp_options_received *rx_opt)
259{
260 rx_opt->tstamp_ok = rx_opt->sack_ok = 0;
261 rx_opt->wscale_ok = rx_opt->snd_wscale = 0;
262 rx_opt->cookie_plus = 0;
263}
264
226/* This is the max number of SACKS that we'll generate and process. It's safe 265/* This is the max number of SACKS that we'll generate and process. It's safe
227 * to increse this, although since: 266 * to increase this, although since:
228 * size = TCPOLEN_SACK_BASE_ALIGNED (4) + n * TCPOLEN_SACK_PERBLOCK (8) 267 * size = TCPOLEN_SACK_BASE_ALIGNED (4) + n * TCPOLEN_SACK_PERBLOCK (8)
229 * only four options will fit in a standard TCP header */ 268 * only four options will fit in a standard TCP header */
230#define TCP_NUM_SACKS 4 269#define TCP_NUM_SACKS 4
231 270
271struct tcp_cookie_values;
272struct tcp_request_sock_ops;
273
232struct tcp_request_sock { 274struct tcp_request_sock {
233 struct inet_request_sock req; 275 struct inet_request_sock req;
234#ifdef CONFIG_TCP_MD5SIG 276#ifdef CONFIG_TCP_MD5SIG
235 /* Only used by TCP MD5 Signature so far. */ 277 /* Only used by TCP MD5 Signature so far. */
236 const struct tcp_request_sock_ops *af_specific; 278 const struct tcp_request_sock_ops *af_specific;
237#endif 279#endif
238 u32 rcv_isn; 280 u32 rcv_isn;
239 u32 snt_isn; 281 u32 snt_isn;
240}; 282};
241 283
242static inline struct tcp_request_sock *tcp_rsk(const struct request_sock *req) 284static inline struct tcp_request_sock *tcp_rsk(const struct request_sock *req)
@@ -406,6 +448,12 @@ struct tcp_sock {
406/* TCP MD5 Signature Option information */ 448/* TCP MD5 Signature Option information */
407 struct tcp_md5sig_info *md5sig_info; 449 struct tcp_md5sig_info *md5sig_info;
408#endif 450#endif
451
452 /* When the cookie options are generated and exchanged, then this
453 * object holds a reference to them (cookie_values->kref). Also
454 * contains related tcp_cookie_transactions fields.
455 */
456 struct tcp_cookie_values *cookie_values;
409}; 457};
410 458
411static inline struct tcp_sock *tcp_sk(const struct sock *sk) 459static inline struct tcp_sock *tcp_sk(const struct sock *sk)
@@ -424,6 +472,10 @@ struct tcp_timewait_sock {
424 u16 tw_md5_keylen; 472 u16 tw_md5_keylen;
425 u8 tw_md5_key[TCP_MD5SIG_MAXKEYLEN]; 473 u8 tw_md5_key[TCP_MD5SIG_MAXKEYLEN];
426#endif 474#endif
475 /* Few sockets in timewait have cookies; in that case, then this
476 * object holds a reference to them (tw_cookie_values->kref).
477 */
478 struct tcp_cookie_values *tw_cookie_values;
427}; 479};
428 480
429static inline struct tcp_timewait_sock *tcp_twsk(const struct sock *sk) 481static inline struct tcp_timewait_sock *tcp_twsk(const struct sock *sk)
@@ -431,6 +483,6 @@ static inline struct tcp_timewait_sock *tcp_twsk(const struct sock *sk)
431 return (struct tcp_timewait_sock *)sk; 483 return (struct tcp_timewait_sock *)sk;
432} 484}
433 485
434#endif 486#endif /* __KERNEL__ */
435 487
436#endif /* _LINUX_TCP_H */ 488#endif /* _LINUX_TCP_H */
diff --git a/include/linux/udp.h b/include/linux/udp.h
index 0cf5c4c0ec81..03f72a2ba028 100644
--- a/include/linux/udp.h
+++ b/include/linux/udp.h
@@ -45,16 +45,19 @@ static inline struct udphdr *udp_hdr(const struct sk_buff *skb)
45 return (struct udphdr *)skb_transport_header(skb); 45 return (struct udphdr *)skb_transport_header(skb);
46} 46}
47 47
48#define UDP_HTABLE_SIZE 128 48#define UDP_HTABLE_SIZE_MIN (CONFIG_BASE_SMALL ? 128 : 256)
49 49
50static inline int udp_hashfn(struct net *net, const unsigned num) 50static inline int udp_hashfn(struct net *net, unsigned num, unsigned mask)
51{ 51{
52 return (num + net_hash_mix(net)) & (UDP_HTABLE_SIZE - 1); 52 return (num + net_hash_mix(net)) & mask;
53} 53}
54 54
55struct udp_sock { 55struct udp_sock {
56 /* inet_sock has to be the first member */ 56 /* inet_sock has to be the first member */
57 struct inet_sock inet; 57 struct inet_sock inet;
58#define udp_port_hash inet.sk.__sk_common.skc_u16hashes[0]
59#define udp_portaddr_hash inet.sk.__sk_common.skc_u16hashes[1]
60#define udp_portaddr_node inet.sk.__sk_common.skc_portaddr_node
58 int pending; /* Any pending frames ? */ 61 int pending; /* Any pending frames ? */
59 unsigned int corkflag; /* Cork is required */ 62 unsigned int corkflag; /* Cork is required */
60 __u16 encap_type; /* Is this an Encapsulation socket? */ 63 __u16 encap_type; /* Is this an Encapsulation socket? */
@@ -85,6 +88,12 @@ static inline struct udp_sock *udp_sk(const struct sock *sk)
85 return (struct udp_sock *)sk; 88 return (struct udp_sock *)sk;
86} 89}
87 90
91#define udp_portaddr_for_each_entry(__sk, node, list) \
92 hlist_nulls_for_each_entry(__sk, node, list, __sk_common.skc_portaddr_node)
93
94#define udp_portaddr_for_each_entry_rcu(__sk, node, list) \
95 hlist_nulls_for_each_entry_rcu(__sk, node, list, __sk_common.skc_portaddr_node)
96
88#define IS_UDPLITE(__sk) (udp_sk(__sk)->pcflag) 97#define IS_UDPLITE(__sk) (udp_sk(__sk)->pcflag)
89 98
90#endif 99#endif
diff --git a/include/linux/usb/usbnet.h b/include/linux/usb/usbnet.h
index f81473052059..8ce61359bf73 100644
--- a/include/linux/usb/usbnet.h
+++ b/include/linux/usb/usbnet.h
@@ -55,6 +55,7 @@ struct usbnet {
55 struct sk_buff_head done; 55 struct sk_buff_head done;
56 struct sk_buff_head rxq_pause; 56 struct sk_buff_head rxq_pause;
57 struct urb *interrupt; 57 struct urb *interrupt;
58 struct usb_anchor deferred;
58 struct tasklet_struct bh; 59 struct tasklet_struct bh;
59 60
60 struct work_struct kevent; 61 struct work_struct kevent;
@@ -65,6 +66,8 @@ struct usbnet {
65# define EVENT_STS_SPLIT 3 66# define EVENT_STS_SPLIT 3
66# define EVENT_LINK_RESET 4 67# define EVENT_LINK_RESET 4
67# define EVENT_RX_PAUSED 5 68# define EVENT_RX_PAUSED 5
69# define EVENT_DEV_WAKING 6
70# define EVENT_DEV_ASLEEP 7
68}; 71};
69 72
70static inline struct usb_driver *driver_of(struct usb_interface *intf) 73static inline struct usb_driver *driver_of(struct usb_interface *intf)
@@ -90,7 +93,9 @@ struct driver_info {
90#define FLAG_WLAN 0x0080 /* use "wlan%d" names */ 93#define FLAG_WLAN 0x0080 /* use "wlan%d" names */
91#define FLAG_AVOID_UNLINK_URBS 0x0100 /* don't unlink urbs at usbnet_stop() */ 94#define FLAG_AVOID_UNLINK_URBS 0x0100 /* don't unlink urbs at usbnet_stop() */
92#define FLAG_SEND_ZLP 0x0200 /* hw requires ZLPs are sent */ 95#define FLAG_SEND_ZLP 0x0200 /* hw requires ZLPs are sent */
96#define FLAG_WWAN 0x0400 /* use "wwan%d" names */
93 97
98#define FLAG_LINK_INTR 0x0800 /* updates link (carrier) status */
94 99
95 /* init device ... can sleep, or cause probe() failure */ 100 /* init device ... can sleep, or cause probe() failure */
96 int (*bind)(struct usbnet *, struct usb_interface *); 101 int (*bind)(struct usbnet *, struct usb_interface *);
@@ -107,6 +112,9 @@ struct driver_info {
107 /* see if peer is connected ... can sleep */ 112 /* see if peer is connected ... can sleep */
108 int (*check_connect)(struct usbnet *); 113 int (*check_connect)(struct usbnet *);
109 114
115 /* (dis)activate runtime power management */
116 int (*manage_power)(struct usbnet *, int);
117
110 /* for status polling */ 118 /* for status polling */
111 void (*status)(struct usbnet *, struct urb *); 119 void (*status)(struct usbnet *, struct urb *);
112 120
diff --git a/include/linux/user-return-notifier.h b/include/linux/user-return-notifier.h
new file mode 100644
index 000000000000..9c4a445bb43c
--- /dev/null
+++ b/include/linux/user-return-notifier.h
@@ -0,0 +1,49 @@
1#ifndef _LINUX_USER_RETURN_NOTIFIER_H
2#define _LINUX_USER_RETURN_NOTIFIER_H
3
4#ifdef CONFIG_USER_RETURN_NOTIFIER
5
6#include <linux/list.h>
7#include <linux/sched.h>
8
9struct user_return_notifier {
10 void (*on_user_return)(struct user_return_notifier *urn);
11 struct hlist_node link;
12};
13
14
15void user_return_notifier_register(struct user_return_notifier *urn);
16void user_return_notifier_unregister(struct user_return_notifier *urn);
17
18static inline void propagate_user_return_notify(struct task_struct *prev,
19 struct task_struct *next)
20{
21 if (test_tsk_thread_flag(prev, TIF_USER_RETURN_NOTIFY)) {
22 clear_tsk_thread_flag(prev, TIF_USER_RETURN_NOTIFY);
23 set_tsk_thread_flag(next, TIF_USER_RETURN_NOTIFY);
24 }
25}
26
27void fire_user_return_notifiers(void);
28
29static inline void clear_user_return_notifier(struct task_struct *p)
30{
31 clear_tsk_thread_flag(p, TIF_USER_RETURN_NOTIFY);
32}
33
34#else
35
36struct user_return_notifier {};
37
38static inline void propagate_user_return_notify(struct task_struct *prev,
39 struct task_struct *next)
40{
41}
42
43static inline void fire_user_return_notifiers(void) {}
44
45static inline void clear_user_return_notifier(struct task_struct *p) {}
46
47#endif
48
49#endif
diff --git a/include/linux/wimax/debug.h b/include/linux/wimax/debug.h
index c703e0340423..db8096e88533 100644
--- a/include/linux/wimax/debug.h
+++ b/include/linux/wimax/debug.h
@@ -450,4 +450,76 @@ do { \
450}) 450})
451 451
452 452
453static inline
454void d_submodule_set(struct d_level *d_level, size_t d_level_size,
455 const char *submodule, u8 level, const char *tag)
456{
457 struct d_level *itr, *top;
458 int index = -1;
459
460 for (itr = d_level, top = itr + d_level_size; itr < top; itr++) {
461 index++;
462 if (itr->name == NULL) {
463 printk(KERN_ERR "%s: itr->name NULL?? (%p, #%d)\n",
464 tag, itr, index);
465 continue;
466 }
467 if (!strcmp(itr->name, submodule)) {
468 itr->level = level;
469 return;
470 }
471 }
472 printk(KERN_ERR "%s: unknown submodule %s\n", tag, submodule);
473}
474
475
476/**
477 * d_parse_params - Parse a string with debug parameters from the
478 * command line
479 *
480 * @d_level: level structure (D_LEVEL)
481 * @d_level_size: number of items in the level structure
482 * (D_LEVEL_SIZE).
483 * @_params: string with the parameters; this is a space (not tab!)
484 * separated list of NAME:VALUE, where value is the debug level
485 * and NAME is the name of the submodule.
486 * @tag: string for error messages (example: MODULE.ARGNAME).
487 */
488static inline
489void d_parse_params(struct d_level *d_level, size_t d_level_size,
490 const char *_params, const char *tag)
491{
492 char submodule[130], *params, *params_orig, *token, *colon;
493 unsigned level, tokens;
494
495 if (_params == NULL)
496 return;
497 params_orig = kstrdup(_params, GFP_KERNEL);
498 params = params_orig;
499 while (1) {
500 token = strsep(&params, " ");
501 if (token == NULL)
502 break;
503 if (*token == '\0') /* eat joint spaces */
504 continue;
505 /* kernel's sscanf %s eats until whitespace, so we
506 * replace : by \n so it doesn't get eaten later by
507 * strsep */
508 colon = strchr(token, ':');
509 if (colon != NULL)
510 *colon = '\n';
511 tokens = sscanf(token, "%s\n%u", submodule, &level);
512 if (colon != NULL)
513 *colon = ':'; /* set back, for error messages */
514 if (tokens == 2)
515 d_submodule_set(d_level, d_level_size,
516 submodule, level, tag);
517 else
518 printk(KERN_ERR "%s: can't parse '%s' as a "
519 "SUBMODULE:LEVEL (%d tokens)\n",
520 tag, token, tokens);
521 }
522 kfree(params_orig);
523}
524
453#endif /* #ifndef __debug__h__ */ 525#endif /* #ifndef __debug__h__ */
diff --git a/include/linux/wimax/i2400m.h b/include/linux/wimax/i2400m.h
index 433693ef2bb0..62d356153565 100644
--- a/include/linux/wimax/i2400m.h
+++ b/include/linux/wimax/i2400m.h
@@ -138,7 +138,7 @@ struct i2400m_bcf_hdr {
138 __le32 module_id; 138 __le32 module_id;
139 __le32 module_vendor; 139 __le32 module_vendor;
140 __le32 date; /* BCD YYYMMDD */ 140 __le32 date; /* BCD YYYMMDD */
141 __le32 size; 141 __le32 size; /* in dwords */
142 __le32 key_size; /* in dwords */ 142 __le32 key_size; /* in dwords */
143 __le32 modulus_size; /* in dwords */ 143 __le32 modulus_size; /* in dwords */
144 __le32 exponent_size; /* in dwords */ 144 __le32 exponent_size; /* in dwords */
@@ -168,16 +168,6 @@ enum i2400m_brh {
168}; 168};
169 169
170 170
171/* Constants for bcf->module_id */
172enum i2400m_bcf_mod_id {
173 /* Firmware file carries its own pokes -- pokes are a set of
174 * magical values that have to be written in certain memory
175 * addresses to get the device up and ready for firmware
176 * download when it is in non-signed boot mode. */
177 I2400M_BCF_MOD_ID_POKES = 0x000000001,
178};
179
180
181/** 171/**
182 * i2400m_bootrom_header - Header for a boot-mode command 172 * i2400m_bootrom_header - Header for a boot-mode command
183 * 173 *
@@ -276,6 +266,7 @@ enum {
276 I2400M_WARM_RESET_BARKER = 0x50f750f7, 266 I2400M_WARM_RESET_BARKER = 0x50f750f7,
277 I2400M_NBOOT_BARKER = 0xdeadbeef, 267 I2400M_NBOOT_BARKER = 0xdeadbeef,
278 I2400M_SBOOT_BARKER = 0x0ff1c1a1, 268 I2400M_SBOOT_BARKER = 0x0ff1c1a1,
269 I2400M_SBOOT_BARKER_6050 = 0x80000001,
279 I2400M_ACK_BARKER = 0xfeedbabe, 270 I2400M_ACK_BARKER = 0xfeedbabe,
280 I2400M_D2H_MSG_BARKER = 0xbeefbabe, 271 I2400M_D2H_MSG_BARKER = 0xbeefbabe,
281}; 272};
diff --git a/include/linux/x25.h b/include/linux/x25.h
index d035e4e87d07..6450a7f12074 100644
--- a/include/linux/x25.h
+++ b/include/linux/x25.h
@@ -25,6 +25,7 @@
25#define SIOCX25SENDCALLACCPT (SIOCPROTOPRIVATE + 9) 25#define SIOCX25SENDCALLACCPT (SIOCPROTOPRIVATE + 9)
26#define SIOCX25GDTEFACILITIES (SIOCPROTOPRIVATE + 10) 26#define SIOCX25GDTEFACILITIES (SIOCPROTOPRIVATE + 10)
27#define SIOCX25SDTEFACILITIES (SIOCPROTOPRIVATE + 11) 27#define SIOCX25SDTEFACILITIES (SIOCPROTOPRIVATE + 11)
28#define SIOCX25SCAUSEDIAG (SIOCPROTOPRIVATE + 12)
28 29
29/* 30/*
30 * Values for {get,set}sockopt. 31 * Values for {get,set}sockopt.
diff --git a/include/linux/xfrm.h b/include/linux/xfrm.h
index 2d4ec15abaca..29e04beb1fc9 100644
--- a/include/linux/xfrm.h
+++ b/include/linux/xfrm.h
@@ -10,8 +10,7 @@
10/* Structure to encapsulate addresses. I do not want to use 10/* Structure to encapsulate addresses. I do not want to use
11 * "standard" structure. My apologies. 11 * "standard" structure. My apologies.
12 */ 12 */
13typedef union 13typedef union {
14{
15 __be32 a4; 14 __be32 a4;
16 __be32 a6[4]; 15 __be32 a6[4];
17} xfrm_address_t; 16} xfrm_address_t;
@@ -20,8 +19,7 @@ typedef union
20 * the state by (spi,daddr,ah/esp) or to store information about 19 * the state by (spi,daddr,ah/esp) or to store information about
21 * spi, protocol and tunnel address on output. 20 * spi, protocol and tunnel address on output.
22 */ 21 */
23struct xfrm_id 22struct xfrm_id {
24{
25 xfrm_address_t daddr; 23 xfrm_address_t daddr;
26 __be32 spi; 24 __be32 spi;
27 __u8 proto; 25 __u8 proto;
@@ -45,8 +43,7 @@ struct xfrm_sec_ctx {
45 43
46/* Selector, used as selector both on policy rules (SPD) and SAs. */ 44/* Selector, used as selector both on policy rules (SPD) and SAs. */
47 45
48struct xfrm_selector 46struct xfrm_selector {
49{
50 xfrm_address_t daddr; 47 xfrm_address_t daddr;
51 xfrm_address_t saddr; 48 xfrm_address_t saddr;
52 __be16 dport; 49 __be16 dport;
@@ -63,8 +60,7 @@ struct xfrm_selector
63 60
64#define XFRM_INF (~(__u64)0) 61#define XFRM_INF (~(__u64)0)
65 62
66struct xfrm_lifetime_cfg 63struct xfrm_lifetime_cfg {
67{
68 __u64 soft_byte_limit; 64 __u64 soft_byte_limit;
69 __u64 hard_byte_limit; 65 __u64 hard_byte_limit;
70 __u64 soft_packet_limit; 66 __u64 soft_packet_limit;
@@ -75,16 +71,14 @@ struct xfrm_lifetime_cfg
75 __u64 hard_use_expires_seconds; 71 __u64 hard_use_expires_seconds;
76}; 72};
77 73
78struct xfrm_lifetime_cur 74struct xfrm_lifetime_cur {
79{
80 __u64 bytes; 75 __u64 bytes;
81 __u64 packets; 76 __u64 packets;
82 __u64 add_time; 77 __u64 add_time;
83 __u64 use_time; 78 __u64 use_time;
84}; 79};
85 80
86struct xfrm_replay_state 81struct xfrm_replay_state {
87{
88 __u32 oseq; 82 __u32 oseq;
89 __u32 seq; 83 __u32 seq;
90 __u32 bitmap; 84 __u32 bitmap;
@@ -96,6 +90,13 @@ struct xfrm_algo {
96 char alg_key[0]; 90 char alg_key[0];
97}; 91};
98 92
93struct xfrm_algo_auth {
94 char alg_name[64];
95 unsigned int alg_key_len; /* in bits */
96 unsigned int alg_trunc_len; /* in bits */
97 char alg_key[0];
98};
99
99struct xfrm_algo_aead { 100struct xfrm_algo_aead {
100 char alg_name[64]; 101 char alg_name[64];
101 unsigned int alg_key_len; /* in bits */ 102 unsigned int alg_key_len; /* in bits */
@@ -109,16 +110,14 @@ struct xfrm_stats {
109 __u32 integrity_failed; 110 __u32 integrity_failed;
110}; 111};
111 112
112enum 113enum {
113{
114 XFRM_POLICY_TYPE_MAIN = 0, 114 XFRM_POLICY_TYPE_MAIN = 0,
115 XFRM_POLICY_TYPE_SUB = 1, 115 XFRM_POLICY_TYPE_SUB = 1,
116 XFRM_POLICY_TYPE_MAX = 2, 116 XFRM_POLICY_TYPE_MAX = 2,
117 XFRM_POLICY_TYPE_ANY = 255 117 XFRM_POLICY_TYPE_ANY = 255
118}; 118};
119 119
120enum 120enum {
121{
122 XFRM_POLICY_IN = 0, 121 XFRM_POLICY_IN = 0,
123 XFRM_POLICY_OUT = 1, 122 XFRM_POLICY_OUT = 1,
124 XFRM_POLICY_FWD = 2, 123 XFRM_POLICY_FWD = 2,
@@ -126,8 +125,7 @@ enum
126 XFRM_POLICY_MAX = 3 125 XFRM_POLICY_MAX = 3
127}; 126};
128 127
129enum 128enum {
130{
131 XFRM_SHARE_ANY, /* No limitations */ 129 XFRM_SHARE_ANY, /* No limitations */
132 XFRM_SHARE_SESSION, /* For this session only */ 130 XFRM_SHARE_SESSION, /* For this session only */
133 XFRM_SHARE_USER, /* For this user only */ 131 XFRM_SHARE_USER, /* For this user only */
@@ -283,6 +281,7 @@ enum xfrm_attr_type_t {
283 XFRMA_MIGRATE, 281 XFRMA_MIGRATE,
284 XFRMA_ALG_AEAD, /* struct xfrm_algo_aead */ 282 XFRMA_ALG_AEAD, /* struct xfrm_algo_aead */
285 XFRMA_KMADDRESS, /* struct xfrm_user_kmaddress */ 283 XFRMA_KMADDRESS, /* struct xfrm_user_kmaddress */
284 XFRMA_ALG_AUTH_TRUNC, /* struct xfrm_algo_auth */
286 __XFRMA_MAX 285 __XFRMA_MAX
287 286
288#define XFRMA_MAX (__XFRMA_MAX - 1) 287#define XFRMA_MAX (__XFRMA_MAX - 1)
diff --git a/include/net/ah.h b/include/net/ah.h
index ae1c322f4242..f0129f79a31a 100644
--- a/include/net/ah.h
+++ b/include/net/ah.h
@@ -1,43 +1,20 @@
1#ifndef _NET_AH_H 1#ifndef _NET_AH_H
2#define _NET_AH_H 2#define _NET_AH_H
3 3
4#include <linux/crypto.h> 4#include <linux/skbuff.h>
5#include <net/xfrm.h>
6 5
7/* This is the maximum truncated ICV length that we know of. */ 6/* This is the maximum truncated ICV length that we know of. */
8#define MAX_AH_AUTH_LEN 12 7#define MAX_AH_AUTH_LEN 12
9 8
10struct ah_data 9struct crypto_ahash;
11{ 10
12 u8 *work_icv; 11struct ah_data {
13 int icv_full_len; 12 int icv_full_len;
14 int icv_trunc_len; 13 int icv_trunc_len;
15 14
16 struct crypto_hash *tfm; 15 struct crypto_ahash *ahash;
17}; 16};
18 17
19static inline int ah_mac_digest(struct ah_data *ahp, struct sk_buff *skb,
20 u8 *auth_data)
21{
22 struct hash_desc desc;
23 int err;
24
25 desc.tfm = ahp->tfm;
26 desc.flags = 0;
27
28 memset(auth_data, 0, ahp->icv_trunc_len);
29 err = crypto_hash_init(&desc);
30 if (unlikely(err))
31 goto out;
32 err = skb_icv_walk(skb, &desc, 0, skb->len, crypto_hash_update);
33 if (unlikely(err))
34 goto out;
35 err = crypto_hash_final(&desc, ahp->work_icv);
36
37out:
38 return err;
39}
40
41struct ip_auth_hdr; 18struct ip_auth_hdr;
42 19
43static inline struct ip_auth_hdr *ip_auth_hdr(const struct sk_buff *skb) 20static inline struct ip_auth_hdr *ip_auth_hdr(const struct sk_buff *skb)
diff --git a/include/net/bluetooth/bluetooth.h b/include/net/bluetooth/bluetooth.h
index 718394e2c01e..04a6908e38d2 100644
--- a/include/net/bluetooth/bluetooth.h
+++ b/include/net/bluetooth/bluetooth.h
@@ -121,7 +121,7 @@ struct bt_sock_list {
121 rwlock_t lock; 121 rwlock_t lock;
122}; 122};
123 123
124int bt_sock_register(int proto, struct net_proto_family *ops); 124int bt_sock_register(int proto, const struct net_proto_family *ops);
125int bt_sock_unregister(int proto); 125int bt_sock_unregister(int proto);
126void bt_sock_link(struct bt_sock_list *l, struct sock *s); 126void bt_sock_link(struct bt_sock_list *l, struct sock *s);
127void bt_sock_unlink(struct bt_sock_list *l, struct sock *s); 127void bt_sock_unlink(struct bt_sock_list *l, struct sock *s);
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
index 7b640aeddb64..7b86094a894b 100644
--- a/include/net/bluetooth/hci_core.h
+++ b/include/net/bluetooth/hci_core.h
@@ -367,22 +367,6 @@ static inline void hci_conn_put(struct hci_conn *conn)
367 } 367 }
368} 368}
369 369
370/* ----- HCI tasks ----- */
371static inline void hci_sched_cmd(struct hci_dev *hdev)
372{
373 tasklet_schedule(&hdev->cmd_task);
374}
375
376static inline void hci_sched_rx(struct hci_dev *hdev)
377{
378 tasklet_schedule(&hdev->rx_task);
379}
380
381static inline void hci_sched_tx(struct hci_dev *hdev)
382{
383 tasklet_schedule(&hdev->tx_task);
384}
385
386/* ----- HCI Devices ----- */ 370/* ----- HCI Devices ----- */
387static inline void __hci_dev_put(struct hci_dev *d) 371static inline void __hci_dev_put(struct hci_dev *d)
388{ 372{
@@ -437,28 +421,7 @@ int hci_inquiry(void __user *arg);
437 421
438void hci_event_packet(struct hci_dev *hdev, struct sk_buff *skb); 422void hci_event_packet(struct hci_dev *hdev, struct sk_buff *skb);
439 423
440/* Receive frame from HCI drivers */ 424int hci_recv_frame(struct sk_buff *skb);
441static inline int hci_recv_frame(struct sk_buff *skb)
442{
443 struct hci_dev *hdev = (struct hci_dev *) skb->dev;
444 if (!hdev || (!test_bit(HCI_UP, &hdev->flags)
445 && !test_bit(HCI_INIT, &hdev->flags))) {
446 kfree_skb(skb);
447 return -ENXIO;
448 }
449
450 /* Incomming skb */
451 bt_cb(skb)->incoming = 1;
452
453 /* Time stamp */
454 __net_timestamp(skb);
455
456 /* Queue frame for rx task */
457 skb_queue_tail(&hdev->rx_q, skb);
458 hci_sched_rx(hdev);
459 return 0;
460}
461
462int hci_recv_fragment(struct hci_dev *hdev, int type, void *data, int count); 425int hci_recv_fragment(struct hci_dev *hdev, int type, void *data, int count);
463 426
464int hci_register_sysfs(struct hci_dev *hdev); 427int hci_register_sysfs(struct hci_dev *hdev);
diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h
index 9516f4b4a3c2..17a689f27a6a 100644
--- a/include/net/bluetooth/l2cap.h
+++ b/include/net/bluetooth/l2cap.h
@@ -324,7 +324,6 @@ struct l2cap_pinfo {
324 324
325 __u8 next_tx_seq; 325 __u8 next_tx_seq;
326 __u8 expected_ack_seq; 326 __u8 expected_ack_seq;
327 __u8 req_seq;
328 __u8 expected_tx_seq; 327 __u8 expected_tx_seq;
329 __u8 buffer_seq; 328 __u8 buffer_seq;
330 __u8 buffer_seq_srej; 329 __u8 buffer_seq_srej;
@@ -375,6 +374,7 @@ struct l2cap_pinfo {
375#define L2CAP_CONN_SEND_PBIT 0x10 374#define L2CAP_CONN_SEND_PBIT 0x10
376#define L2CAP_CONN_REMOTE_BUSY 0x20 375#define L2CAP_CONN_REMOTE_BUSY 0x20
377#define L2CAP_CONN_LOCAL_BUSY 0x40 376#define L2CAP_CONN_LOCAL_BUSY 0x40
377#define L2CAP_CONN_REJ_ACT 0x80
378 378
379#define __mod_retrans_timer() mod_timer(&l2cap_pi(sk)->retrans_timer, \ 379#define __mod_retrans_timer() mod_timer(&l2cap_pi(sk)->retrans_timer, \
380 jiffies + msecs_to_jiffies(L2CAP_DEFAULT_RETRANS_TO)); 380 jiffies + msecs_to_jiffies(L2CAP_DEFAULT_RETRANS_TO));
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 3d874c620219..0884b9a0f778 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -206,10 +206,12 @@ struct ieee80211_supported_band {
206 * struct vif_params - describes virtual interface parameters 206 * struct vif_params - describes virtual interface parameters
207 * @mesh_id: mesh ID to use 207 * @mesh_id: mesh ID to use
208 * @mesh_id_len: length of the mesh ID 208 * @mesh_id_len: length of the mesh ID
209 * @use_4addr: use 4-address frames
209 */ 210 */
210struct vif_params { 211struct vif_params {
211 u8 *mesh_id; 212 u8 *mesh_id;
212 int mesh_id_len; 213 int mesh_id_len;
214 int use_4addr;
213}; 215};
214 216
215/** 217/**
@@ -233,6 +235,35 @@ struct key_params {
233}; 235};
234 236
235/** 237/**
238 * enum survey_info_flags - survey information flags
239 *
240 * Used by the driver to indicate which info in &struct survey_info
241 * it has filled in during the get_survey().
242 */
243enum survey_info_flags {
244 SURVEY_INFO_NOISE_DBM = 1<<0,
245};
246
247/**
248 * struct survey_info - channel survey response
249 *
250 * Used by dump_survey() to report back per-channel survey information.
251 *
252 * @channel: the channel this survey record reports, mandatory
253 * @filled: bitflag of flags from &enum survey_info_flags
254 * @noise: channel noise in dBm. This and all following fields are
255 * optional
256 *
257 * This structure can later be expanded with things like
258 * channel duty cycle etc.
259 */
260struct survey_info {
261 struct ieee80211_channel *channel;
262 u32 filled;
263 s8 noise;
264};
265
266/**
236 * struct beacon_parameters - beacon parameters 267 * struct beacon_parameters - beacon parameters
237 * 268 *
238 * Used to configure the beacon for an interface. 269 * Used to configure the beacon for an interface.
@@ -418,7 +449,7 @@ enum monitor_flags {
418 * in during get_station() or dump_station(). 449 * in during get_station() or dump_station().
419 * 450 *
420 * MPATH_INFO_FRAME_QLEN: @frame_qlen filled 451 * MPATH_INFO_FRAME_QLEN: @frame_qlen filled
421 * MPATH_INFO_DSN: @dsn filled 452 * MPATH_INFO_SN: @sn filled
422 * MPATH_INFO_METRIC: @metric filled 453 * MPATH_INFO_METRIC: @metric filled
423 * MPATH_INFO_EXPTIME: @exptime filled 454 * MPATH_INFO_EXPTIME: @exptime filled
424 * MPATH_INFO_DISCOVERY_TIMEOUT: @discovery_timeout filled 455 * MPATH_INFO_DISCOVERY_TIMEOUT: @discovery_timeout filled
@@ -427,7 +458,7 @@ enum monitor_flags {
427 */ 458 */
428enum mpath_info_flags { 459enum mpath_info_flags {
429 MPATH_INFO_FRAME_QLEN = BIT(0), 460 MPATH_INFO_FRAME_QLEN = BIT(0),
430 MPATH_INFO_DSN = BIT(1), 461 MPATH_INFO_SN = BIT(1),
431 MPATH_INFO_METRIC = BIT(2), 462 MPATH_INFO_METRIC = BIT(2),
432 MPATH_INFO_EXPTIME = BIT(3), 463 MPATH_INFO_EXPTIME = BIT(3),
433 MPATH_INFO_DISCOVERY_TIMEOUT = BIT(4), 464 MPATH_INFO_DISCOVERY_TIMEOUT = BIT(4),
@@ -442,7 +473,7 @@ enum mpath_info_flags {
442 * 473 *
443 * @filled: bitfield of flags from &enum mpath_info_flags 474 * @filled: bitfield of flags from &enum mpath_info_flags
444 * @frame_qlen: number of queued frames for this destination 475 * @frame_qlen: number of queued frames for this destination
445 * @dsn: destination sequence number 476 * @sn: target sequence number
446 * @metric: metric (cost) of this mesh path 477 * @metric: metric (cost) of this mesh path
447 * @exptime: expiration time for the mesh path from now, in msecs 478 * @exptime: expiration time for the mesh path from now, in msecs
448 * @flags: mesh path flags 479 * @flags: mesh path flags
@@ -456,7 +487,7 @@ enum mpath_info_flags {
456struct mpath_info { 487struct mpath_info {
457 u32 filled; 488 u32 filled;
458 u32 frame_qlen; 489 u32 frame_qlen;
459 u32 dsn; 490 u32 sn;
460 u32 metric; 491 u32 metric;
461 u32 exptime; 492 u32 exptime;
462 u32 discovery_timeout; 493 u32 discovery_timeout;
@@ -506,6 +537,7 @@ struct mesh_config {
506 u32 dot11MeshHWMPactivePathTimeout; 537 u32 dot11MeshHWMPactivePathTimeout;
507 u16 dot11MeshHWMPpreqMinInterval; 538 u16 dot11MeshHWMPpreqMinInterval;
508 u16 dot11MeshHWMPnetDiameterTraversalTime; 539 u16 dot11MeshHWMPnetDiameterTraversalTime;
540 u8 dot11MeshHWMPRootMode;
509}; 541};
510 542
511/** 543/**
@@ -839,6 +871,19 @@ struct cfg80211_bitrate_mask {
839 u32 fixed; /* fixed bitrate, 0 == not fixed */ 871 u32 fixed; /* fixed bitrate, 0 == not fixed */
840 u32 maxrate; /* in kbps, 0 == no limit */ 872 u32 maxrate; /* in kbps, 0 == no limit */
841}; 873};
874/**
875 * struct cfg80211_pmksa - PMK Security Association
876 *
877 * This structure is passed to the set/del_pmksa() method for PMKSA
878 * caching.
879 *
880 * @bssid: The AP's BSSID.
881 * @pmkid: The PMK material itself.
882 */
883struct cfg80211_pmksa {
884 u8 *bssid;
885 u8 *pmkid;
886};
842 887
843/** 888/**
844 * struct cfg80211_ops - backend description for wireless configuration 889 * struct cfg80211_ops - backend description for wireless configuration
@@ -941,7 +986,16 @@ struct cfg80211_bitrate_mask {
941 * @rfkill_poll: polls the hw rfkill line, use cfg80211 reporting 986 * @rfkill_poll: polls the hw rfkill line, use cfg80211 reporting
942 * functions to adjust rfkill hw state 987 * functions to adjust rfkill hw state
943 * 988 *
989 * @dump_survey: get site survey information.
990 *
944 * @testmode_cmd: run a test mode command 991 * @testmode_cmd: run a test mode command
992 *
993 * @set_pmksa: Cache a PMKID for a BSSID. This is mostly useful for fullmac
994 * devices running firmwares capable of generating the (re) association
995 * RSN IE. It allows for faster roaming between WPA2 BSSIDs.
996 * @del_pmksa: Delete a cached PMKID.
997 * @flush_pmksa: Flush all cached PMKIDs.
998 *
945 */ 999 */
946struct cfg80211_ops { 1000struct cfg80211_ops {
947 int (*suspend)(struct wiphy *wiphy); 1001 int (*suspend)(struct wiphy *wiphy);
@@ -1060,6 +1114,15 @@ struct cfg80211_ops {
1060 const u8 *peer, 1114 const u8 *peer,
1061 const struct cfg80211_bitrate_mask *mask); 1115 const struct cfg80211_bitrate_mask *mask);
1062 1116
1117 int (*dump_survey)(struct wiphy *wiphy, struct net_device *netdev,
1118 int idx, struct survey_info *info);
1119
1120 int (*set_pmksa)(struct wiphy *wiphy, struct net_device *netdev,
1121 struct cfg80211_pmksa *pmksa);
1122 int (*del_pmksa)(struct wiphy *wiphy, struct net_device *netdev,
1123 struct cfg80211_pmksa *pmksa);
1124 int (*flush_pmksa)(struct wiphy *wiphy, struct net_device *netdev);
1125
1063 /* some temporary stuff to finish wext */ 1126 /* some temporary stuff to finish wext */
1064 int (*set_power_mgmt)(struct wiphy *wiphy, struct net_device *dev, 1127 int (*set_power_mgmt)(struct wiphy *wiphy, struct net_device *dev,
1065 bool enabled, int timeout); 1128 bool enabled, int timeout);
@@ -1071,27 +1134,50 @@ struct cfg80211_ops {
1071 */ 1134 */
1072 1135
1073/** 1136/**
1074 * struct wiphy - wireless hardware description 1137 * enum wiphy_flags - wiphy capability flags
1075 * @idx: the wiphy index assigned to this item 1138 *
1076 * @class_dev: the class device representing /sys/class/ieee80211/<wiphy-name> 1139 * @WIPHY_FLAG_CUSTOM_REGULATORY: tells us the driver for this device
1077 * @custom_regulatory: tells us the driver for this device
1078 * has its own custom regulatory domain and cannot identify the 1140 * has its own custom regulatory domain and cannot identify the
1079 * ISO / IEC 3166 alpha2 it belongs to. When this is enabled 1141 * ISO / IEC 3166 alpha2 it belongs to. When this is enabled
1080 * we will disregard the first regulatory hint (when the 1142 * we will disregard the first regulatory hint (when the
1081 * initiator is %REGDOM_SET_BY_CORE). 1143 * initiator is %REGDOM_SET_BY_CORE).
1082 * @strict_regulatory: tells us the driver for this device will ignore 1144 * @WIPHY_FLAG_STRICT_REGULATORY: tells us the driver for this device will
1083 * regulatory domain settings until it gets its own regulatory domain 1145 * ignore regulatory domain settings until it gets its own regulatory
1084 * via its regulatory_hint(). After its gets its own regulatory domain 1146 * domain via its regulatory_hint(). After its gets its own regulatory
1085 * it will only allow further regulatory domain settings to further 1147 * domain it will only allow further regulatory domain settings to
1086 * enhance compliance. For example if channel 13 and 14 are disabled 1148 * further enhance compliance. For example if channel 13 and 14 are
1087 * by this regulatory domain no user regulatory domain can enable these 1149 * disabled by this regulatory domain no user regulatory domain can
1088 * channels at a later time. This can be used for devices which do not 1150 * enable these channels at a later time. This can be used for devices
1089 * have calibration information gauranteed for frequencies or settings 1151 * which do not have calibration information gauranteed for frequencies
1090 * outside of its regulatory domain. 1152 * or settings outside of its regulatory domain.
1091 * @disable_beacon_hints: enable this if your driver needs to ensure that 1153 * @WIPHY_FLAG_DISABLE_BEACON_HINTS: enable this if your driver needs to ensure
1092 * passive scan flags and beaconing flags may not be lifted by cfg80211 1154 * that passive scan flags and beaconing flags may not be lifted by
1093 * due to regulatory beacon hints. For more information on beacon 1155 * cfg80211 due to regulatory beacon hints. For more information on beacon
1094 * hints read the documenation for regulatory_hint_found_beacon() 1156 * hints read the documenation for regulatory_hint_found_beacon()
1157 * @WIPHY_FLAG_NETNS_OK: if not set, do not allow changing the netns of this
1158 * wiphy at all
1159 * @WIPHY_FLAG_PS_ON_BY_DEFAULT: if set to true, powersave will be enabled
1160 * by default -- this flag will be set depending on the kernel's default
1161 * on wiphy_new(), but can be changed by the driver if it has a good
1162 * reason to override the default
1163 * @WIPHY_FLAG_4ADDR_AP: supports 4addr mode even on AP (with a single station
1164 * on a VLAN interface)
1165 * @WIPHY_FLAG_4ADDR_STATION: supports 4addr mode even as a station
1166 */
1167enum wiphy_flags {
1168 WIPHY_FLAG_CUSTOM_REGULATORY = BIT(0),
1169 WIPHY_FLAG_STRICT_REGULATORY = BIT(1),
1170 WIPHY_FLAG_DISABLE_BEACON_HINTS = BIT(2),
1171 WIPHY_FLAG_NETNS_OK = BIT(3),
1172 WIPHY_FLAG_PS_ON_BY_DEFAULT = BIT(4),
1173 WIPHY_FLAG_4ADDR_AP = BIT(5),
1174 WIPHY_FLAG_4ADDR_STATION = BIT(6),
1175};
1176
1177/**
1178 * struct wiphy - wireless hardware description
1179 * @idx: the wiphy index assigned to this item
1180 * @class_dev: the class device representing /sys/class/ieee80211/<wiphy-name>
1095 * @reg_notifier: the driver's regulatory notification callback 1181 * @reg_notifier: the driver's regulatory notification callback
1096 * @regd: the driver's regulatory domain, if one was requested via 1182 * @regd: the driver's regulatory domain, if one was requested via
1097 * the regulatory_hint() API. This can be used by the driver 1183 * the regulatory_hint() API. This can be used by the driver
@@ -1106,11 +1192,6 @@ struct cfg80211_ops {
1106 * -1 = fragmentation disabled, only odd values >= 256 used 1192 * -1 = fragmentation disabled, only odd values >= 256 used
1107 * @rts_threshold: RTS threshold (dot11RTSThreshold); -1 = RTS/CTS disabled 1193 * @rts_threshold: RTS threshold (dot11RTSThreshold); -1 = RTS/CTS disabled
1108 * @net: the network namespace this wiphy currently lives in 1194 * @net: the network namespace this wiphy currently lives in
1109 * @netnsok: if set to false, do not allow changing the netns of this
1110 * wiphy at all
1111 * @ps_default: default for powersave, will be set depending on the
1112 * kernel's default on wiphy_new(), but can be changed by the
1113 * driver if it has a good reason to override the default
1114 */ 1195 */
1115struct wiphy { 1196struct wiphy {
1116 /* assign these fields before you register the wiphy */ 1197 /* assign these fields before you register the wiphy */
@@ -1121,12 +1202,7 @@ struct wiphy {
1121 /* Supported interface modes, OR together BIT(NL80211_IFTYPE_...) */ 1202 /* Supported interface modes, OR together BIT(NL80211_IFTYPE_...) */
1122 u16 interface_modes; 1203 u16 interface_modes;
1123 1204
1124 bool custom_regulatory; 1205 u32 flags;
1125 bool strict_regulatory;
1126 bool disable_beacon_hints;
1127
1128 bool netnsok;
1129 bool ps_default;
1130 1206
1131 enum cfg80211_signal_type signal_type; 1207 enum cfg80211_signal_type signal_type;
1132 1208
@@ -1142,6 +1218,11 @@ struct wiphy {
1142 u32 frag_threshold; 1218 u32 frag_threshold;
1143 u32 rts_threshold; 1219 u32 rts_threshold;
1144 1220
1221 char fw_version[ETHTOOL_BUSINFO_LEN];
1222 u32 hw_version;
1223
1224 u8 max_num_pmkids;
1225
1145 /* If multiple wiphys are registered and you're handed e.g. 1226 /* If multiple wiphys are registered and you're handed e.g.
1146 * a regular netdev with assigned ieee80211_ptr, you won't 1227 * a regular netdev with assigned ieee80211_ptr, you won't
1147 * know whether it points to a wiphy your driver has registered 1228 * know whether it points to a wiphy your driver has registered
@@ -1171,6 +1252,10 @@ struct wiphy {
1171 struct net *_net; 1252 struct net *_net;
1172#endif 1253#endif
1173 1254
1255#ifdef CONFIG_CFG80211_WEXT
1256 const struct iw_handler_def *wext;
1257#endif
1258
1174 char priv[0] __attribute__((__aligned__(NETDEV_ALIGN))); 1259 char priv[0] __attribute__((__aligned__(NETDEV_ALIGN)));
1175}; 1260};
1176 1261
@@ -1314,6 +1399,10 @@ struct cfg80211_cached_keys;
1314 * @ssid_len: (private) Used by the internal configuration code 1399 * @ssid_len: (private) Used by the internal configuration code
1315 * @wext: (private) Used by the internal wireless extensions compat code 1400 * @wext: (private) Used by the internal wireless extensions compat code
1316 * @wext_bssid: (private) Used by the internal wireless extensions compat code 1401 * @wext_bssid: (private) Used by the internal wireless extensions compat code
1402 * @use_4addr: indicates 4addr mode is used on this interface, must be
1403 * set by driver (if supported) on add_interface BEFORE registering the
1404 * netdev and may otherwise be used by driver read-only, will be update
1405 * by cfg80211 on change_interface
1317 */ 1406 */
1318struct wireless_dev { 1407struct wireless_dev {
1319 struct wiphy *wiphy; 1408 struct wiphy *wiphy;
@@ -1327,6 +1416,8 @@ struct wireless_dev {
1327 1416
1328 struct work_struct cleanup_work; 1417 struct work_struct cleanup_work;
1329 1418
1419 bool use_4addr;
1420
1330 /* currently used for IBSS and SME - might be rearranged later */ 1421 /* currently used for IBSS and SME - might be rearranged later */
1331 u8 ssid[IEEE80211_MAX_SSID_LEN]; 1422 u8 ssid[IEEE80211_MAX_SSID_LEN];
1332 u8 ssid_len; 1423 u8 ssid_len;
@@ -1345,7 +1436,7 @@ struct wireless_dev {
1345 struct cfg80211_internal_bss *auth_bsses[MAX_AUTH_BSSES]; 1436 struct cfg80211_internal_bss *auth_bsses[MAX_AUTH_BSSES];
1346 struct cfg80211_internal_bss *current_bss; /* associated / joined */ 1437 struct cfg80211_internal_bss *current_bss; /* associated / joined */
1347 1438
1348#ifdef CONFIG_WIRELESS_EXT 1439#ifdef CONFIG_CFG80211_WEXT
1349 /* wext data */ 1440 /* wext data */
1350 struct { 1441 struct {
1351 struct cfg80211_ibss_params ibss; 1442 struct cfg80211_ibss_params ibss;
@@ -1776,6 +1867,18 @@ void cfg80211_send_rx_auth(struct net_device *dev, const u8 *buf, size_t len);
1776void cfg80211_send_auth_timeout(struct net_device *dev, const u8 *addr); 1867void cfg80211_send_auth_timeout(struct net_device *dev, const u8 *addr);
1777 1868
1778/** 1869/**
1870 * __cfg80211_auth_canceled - notify cfg80211 that authentication was canceled
1871 * @dev: network device
1872 * @addr: The MAC address of the device with which the authentication timed out
1873 *
1874 * When a pending authentication had no action yet, the driver may decide
1875 * to not send a deauth frame, but in that case must calls this function
1876 * to tell cfg80211 about this decision. It is only valid to call this
1877 * function within the deauth() callback.
1878 */
1879void __cfg80211_auth_canceled(struct net_device *dev, const u8 *addr);
1880
1881/**
1779 * cfg80211_send_rx_assoc - notification of processed association 1882 * cfg80211_send_rx_assoc - notification of processed association
1780 * @dev: network device 1883 * @dev: network device
1781 * @buf: (re)association response frame (header + body) 1884 * @buf: (re)association response frame (header + body)
@@ -1802,30 +1905,45 @@ void cfg80211_send_assoc_timeout(struct net_device *dev, const u8 *addr);
1802 * @dev: network device 1905 * @dev: network device
1803 * @buf: deauthentication frame (header + body) 1906 * @buf: deauthentication frame (header + body)
1804 * @len: length of the frame data 1907 * @len: length of the frame data
1805 * @cookie: cookie from ->deauth if called within that callback,
1806 * %NULL otherwise
1807 * 1908 *
1808 * This function is called whenever deauthentication has been processed in 1909 * This function is called whenever deauthentication has been processed in
1809 * station mode. This includes both received deauthentication frames and 1910 * station mode. This includes both received deauthentication frames and
1810 * locally generated ones. This function may sleep. 1911 * locally generated ones. This function may sleep.
1811 */ 1912 */
1812void cfg80211_send_deauth(struct net_device *dev, const u8 *buf, size_t len, 1913void cfg80211_send_deauth(struct net_device *dev, const u8 *buf, size_t len);
1813 void *cookie); 1914
1915/**
1916 * __cfg80211_send_deauth - notification of processed deauthentication
1917 * @dev: network device
1918 * @buf: deauthentication frame (header + body)
1919 * @len: length of the frame data
1920 *
1921 * Like cfg80211_send_deauth(), but doesn't take the wdev lock.
1922 */
1923void __cfg80211_send_deauth(struct net_device *dev, const u8 *buf, size_t len);
1814 1924
1815/** 1925/**
1816 * cfg80211_send_disassoc - notification of processed disassociation 1926 * cfg80211_send_disassoc - notification of processed disassociation
1817 * @dev: network device 1927 * @dev: network device
1818 * @buf: disassociation response frame (header + body) 1928 * @buf: disassociation response frame (header + body)
1819 * @len: length of the frame data 1929 * @len: length of the frame data
1820 * @cookie: cookie from ->disassoc if called within that callback,
1821 * %NULL otherwise
1822 * 1930 *
1823 * This function is called whenever disassociation has been processed in 1931 * This function is called whenever disassociation has been processed in
1824 * station mode. This includes both received disassociation frames and locally 1932 * station mode. This includes both received disassociation frames and locally
1825 * generated ones. This function may sleep. 1933 * generated ones. This function may sleep.
1826 */ 1934 */
1827void cfg80211_send_disassoc(struct net_device *dev, const u8 *buf, size_t len, 1935void cfg80211_send_disassoc(struct net_device *dev, const u8 *buf, size_t len);
1828 void *cookie); 1936
1937/**
1938 * __cfg80211_send_disassoc - notification of processed disassociation
1939 * @dev: network device
1940 * @buf: disassociation response frame (header + body)
1941 * @len: length of the frame data
1942 *
1943 * Like cfg80211_send_disassoc(), but doesn't take the wdev lock.
1944 */
1945void __cfg80211_send_disassoc(struct net_device *dev, const u8 *buf,
1946 size_t len);
1829 1947
1830/** 1948/**
1831 * cfg80211_michael_mic_failure - notification of Michael MIC failure (TKIP) 1949 * cfg80211_michael_mic_failure - notification of Michael MIC failure (TKIP)
diff --git a/include/net/compat.h b/include/net/compat.h
index 7c3002832d05..3c7d4e38fa1d 100644
--- a/include/net/compat.h
+++ b/include/net/compat.h
@@ -18,6 +18,11 @@ struct compat_msghdr {
18 compat_uint_t msg_flags; 18 compat_uint_t msg_flags;
19}; 19};
20 20
21struct compat_mmsghdr {
22 struct compat_msghdr msg_hdr;
23 compat_uint_t msg_len;
24};
25
21struct compat_cmsghdr { 26struct compat_cmsghdr {
22 compat_size_t cmsg_len; 27 compat_size_t cmsg_len;
23 compat_int_t cmsg_level; 28 compat_int_t cmsg_level;
@@ -28,13 +33,20 @@ extern int compat_sock_get_timestamp(struct sock *, struct timeval __user *);
28extern int compat_sock_get_timestampns(struct sock *, struct timespec __user *); 33extern int compat_sock_get_timestampns(struct sock *, struct timespec __user *);
29 34
30#else /* defined(CONFIG_COMPAT) */ 35#else /* defined(CONFIG_COMPAT) */
31#define compat_msghdr msghdr /* to avoid compiler warnings */ 36/*
37 * To avoid compiler warnings:
38 */
39#define compat_msghdr msghdr
40#define compat_mmsghdr mmsghdr
32#endif /* defined(CONFIG_COMPAT) */ 41#endif /* defined(CONFIG_COMPAT) */
33 42
34extern int get_compat_msghdr(struct msghdr *, struct compat_msghdr __user *); 43extern int get_compat_msghdr(struct msghdr *, struct compat_msghdr __user *);
35extern int verify_compat_iovec(struct msghdr *, struct iovec *, struct sockaddr *, int); 44extern int verify_compat_iovec(struct msghdr *, struct iovec *, struct sockaddr *, int);
36extern asmlinkage long compat_sys_sendmsg(int,struct compat_msghdr __user *,unsigned); 45extern asmlinkage long compat_sys_sendmsg(int,struct compat_msghdr __user *,unsigned);
37extern asmlinkage long compat_sys_recvmsg(int,struct compat_msghdr __user *,unsigned); 46extern asmlinkage long compat_sys_recvmsg(int,struct compat_msghdr __user *,unsigned);
47extern asmlinkage long compat_sys_recvmmsg(int, struct compat_mmsghdr __user *,
48 unsigned, unsigned,
49 struct timespec __user *);
38extern asmlinkage long compat_sys_getsockopt(int, int, int, char __user *, int __user *); 50extern asmlinkage long compat_sys_getsockopt(int, int, int, char __user *, int __user *);
39extern int put_cmsg_compat(struct msghdr*, int, int, int, void *); 51extern int put_cmsg_compat(struct msghdr*, int, int, int, void *);
40 52
diff --git a/include/net/dn_dev.h b/include/net/dn_dev.h
index cee46821dc53..511a459ec10f 100644
--- a/include/net/dn_dev.h
+++ b/include/net/dn_dev.h
@@ -75,7 +75,6 @@ struct dn_dev_parms {
75 unsigned long t3; /* Default value of t3 */ 75 unsigned long t3; /* Default value of t3 */
76 int priority; /* Priority to be a router */ 76 int priority; /* Priority to be a router */
77 char *name; /* Name for sysctl */ 77 char *name; /* Name for sysctl */
78 int ctl_name; /* Index for sysctl */
79 int (*up)(struct net_device *); 78 int (*up)(struct net_device *);
80 void (*down)(struct net_device *); 79 void (*down)(struct net_device *);
81 void (*timer3)(struct net_device *, struct dn_ifaddr *ifa); 80 void (*timer3)(struct net_device *, struct dn_ifaddr *ifa);
@@ -97,16 +96,14 @@ struct dn_dev {
97 unsigned long uptime; /* Time device went up in jiffies */ 96 unsigned long uptime; /* Time device went up in jiffies */
98}; 97};
99 98
100struct dn_short_packet 99struct dn_short_packet {
101{
102 __u8 msgflg; 100 __u8 msgflg;
103 __le16 dstnode; 101 __le16 dstnode;
104 __le16 srcnode; 102 __le16 srcnode;
105 __u8 forward; 103 __u8 forward;
106} __attribute__((packed)); 104} __attribute__((packed));
107 105
108struct dn_long_packet 106struct dn_long_packet {
109{
110 __u8 msgflg; 107 __u8 msgflg;
111 __u8 d_area; 108 __u8 d_area;
112 __u8 d_subarea; 109 __u8 d_subarea;
@@ -122,8 +119,7 @@ struct dn_long_packet
122 119
123/*------------------------- DRP - Routing messages ---------------------*/ 120/*------------------------- DRP - Routing messages ---------------------*/
124 121
125struct endnode_hello_message 122struct endnode_hello_message {
126{
127 __u8 msgflg; 123 __u8 msgflg;
128 __u8 tiver[3]; 124 __u8 tiver[3];
129 __u8 id[6]; 125 __u8 id[6];
@@ -138,8 +134,7 @@ struct endnode_hello_message
138 __u8 data[2]; 134 __u8 data[2];
139} __attribute__((packed)); 135} __attribute__((packed));
140 136
141struct rtnode_hello_message 137struct rtnode_hello_message {
142{
143 __u8 msgflg; 138 __u8 msgflg;
144 __u8 tiver[3]; 139 __u8 tiver[3];
145 __u8 id[6]; 140 __u8 id[6];
diff --git a/include/net/dn_fib.h b/include/net/dn_fib.h
index c378be7bf960..52da6c3dd50d 100644
--- a/include/net/dn_fib.h
+++ b/include/net/dn_fib.h
@@ -4,8 +4,7 @@
4/* WARNING: The ordering of these elements must match ordering 4/* WARNING: The ordering of these elements must match ordering
5 * of RTA_* rtnetlink attribute numbers. 5 * of RTA_* rtnetlink attribute numbers.
6 */ 6 */
7struct dn_kern_rta 7struct dn_kern_rta {
8{
9 void *rta_dst; 8 void *rta_dst;
10 void *rta_src; 9 void *rta_src;
11 int *rta_iif; 10 int *rta_iif;
diff --git a/include/net/dn_nsp.h b/include/net/dn_nsp.h
index 96e816b6974d..17d43d2db5ec 100644
--- a/include/net/dn_nsp.h
+++ b/include/net/dn_nsp.h
@@ -70,30 +70,26 @@ extern struct sk_buff *dn_alloc_send_skb(struct sock *sk, size_t *size, int nobl
70 70
71/* Data Messages (data segment/interrupt/link service) */ 71/* Data Messages (data segment/interrupt/link service) */
72 72
73struct nsp_data_seg_msg 73struct nsp_data_seg_msg {
74{
75 __u8 msgflg; 74 __u8 msgflg;
76 __le16 dstaddr; 75 __le16 dstaddr;
77 __le16 srcaddr; 76 __le16 srcaddr;
78} __attribute__((packed)); 77} __attribute__((packed));
79 78
80struct nsp_data_opt_msg 79struct nsp_data_opt_msg {
81{
82 __le16 acknum; 80 __le16 acknum;
83 __le16 segnum; 81 __le16 segnum;
84 __le16 lsflgs; 82 __le16 lsflgs;
85} __attribute__((packed)); 83} __attribute__((packed));
86 84
87struct nsp_data_opt_msg1 85struct nsp_data_opt_msg1 {
88{
89 __le16 acknum; 86 __le16 acknum;
90 __le16 segnum; 87 __le16 segnum;
91} __attribute__((packed)); 88} __attribute__((packed));
92 89
93 90
94/* Acknowledgment Message (data/other data) */ 91/* Acknowledgment Message (data/other data) */
95struct nsp_data_ack_msg 92struct nsp_data_ack_msg {
96{
97 __u8 msgflg; 93 __u8 msgflg;
98 __le16 dstaddr; 94 __le16 dstaddr;
99 __le16 srcaddr; 95 __le16 srcaddr;
@@ -101,16 +97,14 @@ struct nsp_data_ack_msg
101} __attribute__((packed)); 97} __attribute__((packed));
102 98
103/* Connect Acknowledgment Message */ 99/* Connect Acknowledgment Message */
104struct nsp_conn_ack_msg 100struct nsp_conn_ack_msg {
105{
106 __u8 msgflg; 101 __u8 msgflg;
107 __le16 dstaddr; 102 __le16 dstaddr;
108} __attribute__((packed)); 103} __attribute__((packed));
109 104
110 105
111/* Connect Initiate/Retransmit Initiate/Connect Confirm */ 106/* Connect Initiate/Retransmit Initiate/Connect Confirm */
112struct nsp_conn_init_msg 107struct nsp_conn_init_msg {
113{
114 __u8 msgflg; 108 __u8 msgflg;
115#define NSP_CI 0x18 /* Connect Initiate */ 109#define NSP_CI 0x18 /* Connect Initiate */
116#define NSP_RCI 0x68 /* Retrans. Conn Init */ 110#define NSP_RCI 0x68 /* Retrans. Conn Init */
@@ -126,8 +120,7 @@ struct nsp_conn_init_msg
126} __attribute__((packed)); 120} __attribute__((packed));
127 121
128/* Disconnect Initiate/Disconnect Confirm */ 122/* Disconnect Initiate/Disconnect Confirm */
129struct nsp_disconn_init_msg 123struct nsp_disconn_init_msg {
130{
131 __u8 msgflg; 124 __u8 msgflg;
132 __le16 dstaddr; 125 __le16 dstaddr;
133 __le16 srcaddr; 126 __le16 srcaddr;
@@ -136,8 +129,7 @@ struct nsp_disconn_init_msg
136 129
137 130
138 131
139struct srcobj_fmt 132struct srcobj_fmt {
140{
141 __u8 format; 133 __u8 format;
142 __u8 task; 134 __u8 task;
143 __le16 grpcode; 135 __le16 grpcode;
diff --git a/include/net/dst.h b/include/net/dst.h
index 5a900ddcf10d..387cb3cfde7e 100644
--- a/include/net/dst.h
+++ b/include/net/dst.h
@@ -36,8 +36,7 @@
36 36
37struct sk_buff; 37struct sk_buff;
38 38
39struct dst_entry 39struct dst_entry {
40{
41 struct rcu_head rcu_head; 40 struct rcu_head rcu_head;
42 struct dst_entry *child; 41 struct dst_entry *child;
43 struct net_device *dev; 42 struct net_device *dev;
@@ -111,6 +110,12 @@ dst_metric(const struct dst_entry *dst, int metric)
111 return dst->metrics[metric-1]; 110 return dst->metrics[metric-1];
112} 111}
113 112
113static inline u32
114dst_feature(const struct dst_entry *dst, u32 feature)
115{
116 return (dst ? dst_metric(dst, RTAX_FEATURES) & feature : 0);
117}
118
114static inline u32 dst_mtu(const struct dst_entry *dst) 119static inline u32 dst_mtu(const struct dst_entry *dst)
115{ 120{
116 u32 mtu = dst_metric(dst, RTAX_MTU); 121 u32 mtu = dst_metric(dst, RTAX_MTU);
@@ -136,7 +141,7 @@ static inline void set_dst_metric_rtt(struct dst_entry *dst, int metric,
136static inline u32 141static inline u32
137dst_allfrag(const struct dst_entry *dst) 142dst_allfrag(const struct dst_entry *dst)
138{ 143{
139 int ret = dst_metric(dst, RTAX_FEATURES) & RTAX_FEATURE_ALLFRAG; 144 int ret = dst_feature(dst, RTAX_FEATURE_ALLFRAG);
140 /* Yes, _exactly_. This is paranoia. */ 145 /* Yes, _exactly_. This is paranoia. */
141 barrier(); 146 barrier();
142 return ret; 147 return ret;
@@ -222,11 +227,19 @@ static inline void dst_confirm(struct dst_entry *dst)
222 neigh_confirm(dst->neighbour); 227 neigh_confirm(dst->neighbour);
223} 228}
224 229
225static inline void dst_negative_advice(struct dst_entry **dst_p) 230static inline void dst_negative_advice(struct dst_entry **dst_p,
231 struct sock *sk)
226{ 232{
227 struct dst_entry * dst = *dst_p; 233 struct dst_entry * dst = *dst_p;
228 if (dst && dst->ops->negative_advice) 234 if (dst && dst->ops->negative_advice) {
229 *dst_p = dst->ops->negative_advice(dst); 235 *dst_p = dst->ops->negative_advice(dst);
236
237 if (dst != *dst_p) {
238 extern void sk_reset_txq(struct sock *sk);
239
240 sk_reset_txq(sk);
241 }
242 }
230} 243}
231 244
232static inline void dst_link_failure(struct sk_buff *skb) 245static inline void dst_link_failure(struct sk_buff *skb)
diff --git a/include/net/fib_rules.h b/include/net/fib_rules.h
index ca4b2e840078..c07ac9650ebc 100644
--- a/include/net/fib_rules.h
+++ b/include/net/fib_rules.h
@@ -7,12 +7,11 @@
7#include <net/flow.h> 7#include <net/flow.h>
8#include <net/rtnetlink.h> 8#include <net/rtnetlink.h>
9 9
10struct fib_rule 10struct fib_rule {
11{
12 struct list_head list; 11 struct list_head list;
13 atomic_t refcnt; 12 atomic_t refcnt;
14 int ifindex; 13 int iifindex;
15 char ifname[IFNAMSIZ]; 14 int oifindex;
16 u32 mark; 15 u32 mark;
17 u32 mark_mask; 16 u32 mark_mask;
18 u32 pref; 17 u32 pref;
@@ -21,19 +20,19 @@ struct fib_rule
21 u8 action; 20 u8 action;
22 u32 target; 21 u32 target;
23 struct fib_rule * ctarget; 22 struct fib_rule * ctarget;
23 char iifname[IFNAMSIZ];
24 char oifname[IFNAMSIZ];
24 struct rcu_head rcu; 25 struct rcu_head rcu;
25 struct net * fr_net; 26 struct net * fr_net;
26}; 27};
27 28
28struct fib_lookup_arg 29struct fib_lookup_arg {
29{
30 void *lookup_ptr; 30 void *lookup_ptr;
31 void *result; 31 void *result;
32 struct fib_rule *rule; 32 struct fib_rule *rule;
33}; 33};
34 34
35struct fib_rules_ops 35struct fib_rules_ops {
36{
37 int family; 36 int family;
38 struct list_head list; 37 struct list_head list;
39 int rule_size; 38 int rule_size;
@@ -67,10 +66,12 @@ struct fib_rules_ops
67 struct list_head rules_list; 66 struct list_head rules_list;
68 struct module *owner; 67 struct module *owner;
69 struct net *fro_net; 68 struct net *fro_net;
69 struct rcu_head rcu;
70}; 70};
71 71
72#define FRA_GENERIC_POLICY \ 72#define FRA_GENERIC_POLICY \
73 [FRA_IFNAME] = { .type = NLA_STRING, .len = IFNAMSIZ - 1 }, \ 73 [FRA_IIFNAME] = { .type = NLA_STRING, .len = IFNAMSIZ - 1 }, \
74 [FRA_OIFNAME] = { .type = NLA_STRING, .len = IFNAMSIZ - 1 }, \
74 [FRA_PRIORITY] = { .type = NLA_U32 }, \ 75 [FRA_PRIORITY] = { .type = NLA_U32 }, \
75 [FRA_FWMARK] = { .type = NLA_U32 }, \ 76 [FRA_FWMARK] = { .type = NLA_U32 }, \
76 [FRA_FWMASK] = { .type = NLA_U32 }, \ 77 [FRA_FWMASK] = { .type = NLA_U32 }, \
@@ -102,7 +103,7 @@ static inline u32 frh_get_table(struct fib_rule_hdr *frh, struct nlattr **nla)
102 return frh->table; 103 return frh->table;
103} 104}
104 105
105extern int fib_rules_register(struct fib_rules_ops *); 106extern struct fib_rules_ops *fib_rules_register(struct fib_rules_ops *, struct net *);
106extern void fib_rules_unregister(struct fib_rules_ops *); 107extern void fib_rules_unregister(struct fib_rules_ops *);
107extern void fib_rules_cleanup_ops(struct fib_rules_ops *); 108extern void fib_rules_cleanup_ops(struct fib_rules_ops *);
108 109
diff --git a/include/net/gen_stats.h b/include/net/gen_stats.h
index c1488553e349..fa157712e982 100644
--- a/include/net/gen_stats.h
+++ b/include/net/gen_stats.h
@@ -6,8 +6,7 @@
6#include <linux/rtnetlink.h> 6#include <linux/rtnetlink.h>
7#include <linux/pkt_sched.h> 7#include <linux/pkt_sched.h>
8 8
9struct gnet_dump 9struct gnet_dump {
10{
11 spinlock_t * lock; 10 spinlock_t * lock;
12 struct sk_buff * skb; 11 struct sk_buff * skb;
13 struct nlattr * tail; 12 struct nlattr * tail;
@@ -30,6 +29,7 @@ extern int gnet_stats_start_copy_compat(struct sk_buff *skb, int type,
30extern int gnet_stats_copy_basic(struct gnet_dump *d, 29extern int gnet_stats_copy_basic(struct gnet_dump *d,
31 struct gnet_stats_basic_packed *b); 30 struct gnet_stats_basic_packed *b);
32extern int gnet_stats_copy_rate_est(struct gnet_dump *d, 31extern int gnet_stats_copy_rate_est(struct gnet_dump *d,
32 const struct gnet_stats_basic_packed *b,
33 struct gnet_stats_rate_est *r); 33 struct gnet_stats_rate_est *r);
34extern int gnet_stats_copy_queue(struct gnet_dump *d, 34extern int gnet_stats_copy_queue(struct gnet_dump *d,
35 struct gnet_stats_queue *q); 35 struct gnet_stats_queue *q);
diff --git a/include/net/genetlink.h b/include/net/genetlink.h
index 2a1c06874c42..eb551baafc04 100644
--- a/include/net/genetlink.h
+++ b/include/net/genetlink.h
@@ -13,8 +13,7 @@
13 * @list: list entry for linking 13 * @list: list entry for linking
14 * @family: pointer to family, need not be set before registering 14 * @family: pointer to family, need not be set before registering
15 */ 15 */
16struct genl_multicast_group 16struct genl_multicast_group {
17{
18 struct genl_family *family; /* private */ 17 struct genl_family *family; /* private */
19 struct list_head list; /* private */ 18 struct list_head list; /* private */
20 char name[GENL_NAMSIZ]; 19 char name[GENL_NAMSIZ];
@@ -35,8 +34,7 @@ struct genl_multicast_group
35 * @family_list: family list 34 * @family_list: family list
36 * @mcast_groups: multicast groups list 35 * @mcast_groups: multicast groups list
37 */ 36 */
38struct genl_family 37struct genl_family {
39{
40 unsigned int id; 38 unsigned int id;
41 unsigned int hdrsize; 39 unsigned int hdrsize;
42 char name[GENL_NAMSIZ]; 40 char name[GENL_NAMSIZ];
@@ -58,8 +56,7 @@ struct genl_family
58 * @userhdr: user specific header 56 * @userhdr: user specific header
59 * @attrs: netlink attributes 57 * @attrs: netlink attributes
60 */ 58 */
61struct genl_info 59struct genl_info {
62{
63 u32 snd_seq; 60 u32 snd_seq;
64 u32 snd_pid; 61 u32 snd_pid;
65 struct nlmsghdr * nlhdr; 62 struct nlmsghdr * nlhdr;
@@ -102,8 +99,7 @@ static inline void genl_info_net_set(struct genl_info *info, struct net *net)
102 * @done: completion callback for dumps 99 * @done: completion callback for dumps
103 * @ops_list: operations list 100 * @ops_list: operations list
104 */ 101 */
105struct genl_ops 102struct genl_ops {
106{
107 u8 cmd; 103 u8 cmd;
108 unsigned int flags; 104 unsigned int flags;
109 const struct nla_policy *policy; 105 const struct nla_policy *policy;
diff --git a/include/net/ieee80211_radiotap.h b/include/net/ieee80211_radiotap.h
index 23c3f3d97779..9d3d86aaccbb 100644
--- a/include/net/ieee80211_radiotap.h
+++ b/include/net/ieee80211_radiotap.h
@@ -80,7 +80,7 @@ struct ieee80211_radiotap_header {
80 * Additional extensions are made 80 * Additional extensions are made
81 * by setting bit 31. 81 * by setting bit 31.
82 */ 82 */
83}; 83} __packed;
84 84
85/* Name Data type Units 85/* Name Data type Units
86 * ---- --------- ----- 86 * ---- --------- -----
diff --git a/include/net/ieee802154_netdev.h b/include/net/ieee802154_netdev.h
index 5dc6a61952de..57430555487a 100644
--- a/include/net/ieee802154_netdev.h
+++ b/include/net/ieee802154_netdev.h
@@ -74,8 +74,12 @@ static inline int mac_cb_type(struct sk_buff *skb)
74#define IEEE802154_MAC_SCAN_PASSIVE 2 74#define IEEE802154_MAC_SCAN_PASSIVE 2
75#define IEEE802154_MAC_SCAN_ORPHAN 3 75#define IEEE802154_MAC_SCAN_ORPHAN 3
76 76
77struct wpan_phy;
77/* 78/*
78 * This should be located at net_device->ml_priv 79 * This should be located at net_device->ml_priv
80 *
81 * get_phy should increment the reference counting on returned phy.
82 * Use wpan_wpy_put to put that reference.
79 */ 83 */
80struct ieee802154_mlme_ops { 84struct ieee802154_mlme_ops {
81 int (*assoc_req)(struct net_device *dev, 85 int (*assoc_req)(struct net_device *dev,
@@ -94,18 +98,20 @@ struct ieee802154_mlme_ops {
94 int (*scan_req)(struct net_device *dev, 98 int (*scan_req)(struct net_device *dev,
95 u8 type, u32 channels, u8 page, u8 duration); 99 u8 type, u32 channels, u8 page, u8 duration);
96 100
101 struct wpan_phy *(*get_phy)(const struct net_device *dev);
102
97 /* 103 /*
98 * FIXME: these should become the part of PIB/MIB interface. 104 * FIXME: these should become the part of PIB/MIB interface.
99 * However we still don't have IB interface of any kind 105 * However we still don't have IB interface of any kind
100 */ 106 */
101 u16 (*get_pan_id)(struct net_device *dev); 107 u16 (*get_pan_id)(const struct net_device *dev);
102 u16 (*get_short_addr)(struct net_device *dev); 108 u16 (*get_short_addr)(const struct net_device *dev);
103 u8 (*get_dsn)(struct net_device *dev); 109 u8 (*get_dsn)(const struct net_device *dev);
104 u8 (*get_bsn)(struct net_device *dev); 110 u8 (*get_bsn)(const struct net_device *dev);
105}; 111};
106 112
107static inline struct ieee802154_mlme_ops *ieee802154_mlme_ops( 113static inline struct ieee802154_mlme_ops *ieee802154_mlme_ops(
108 struct net_device *dev) 114 const struct net_device *dev)
109{ 115{
110 return dev->ml_priv; 116 return dev->ml_priv;
111} 117}
diff --git a/include/net/if_inet6.h b/include/net/if_inet6.h
index 38b78132019b..e9d69d198495 100644
--- a/include/net/if_inet6.h
+++ b/include/net/if_inet6.h
@@ -32,8 +32,7 @@
32 32
33#ifdef __KERNEL__ 33#ifdef __KERNEL__
34 34
35struct inet6_ifaddr 35struct inet6_ifaddr {
36{
37 struct in6_addr addr; 36 struct in6_addr addr;
38 __u32 prefix_len; 37 __u32 prefix_len;
39 38
@@ -67,8 +66,7 @@ struct inet6_ifaddr
67 int dead; 66 int dead;
68}; 67};
69 68
70struct ip6_sf_socklist 69struct ip6_sf_socklist {
71{
72 unsigned int sl_max; 70 unsigned int sl_max;
73 unsigned int sl_count; 71 unsigned int sl_count;
74 struct in6_addr sl_addr[0]; 72 struct in6_addr sl_addr[0];
@@ -79,8 +77,7 @@ struct ip6_sf_socklist
79 77
80#define IP6_SFBLOCK 10 /* allocate this many at once */ 78#define IP6_SFBLOCK 10 /* allocate this many at once */
81 79
82struct ipv6_mc_socklist 80struct ipv6_mc_socklist {
83{
84 struct in6_addr addr; 81 struct in6_addr addr;
85 int ifindex; 82 int ifindex;
86 struct ipv6_mc_socklist *next; 83 struct ipv6_mc_socklist *next;
@@ -89,8 +86,7 @@ struct ipv6_mc_socklist
89 struct ip6_sf_socklist *sflist; 86 struct ip6_sf_socklist *sflist;
90}; 87};
91 88
92struct ip6_sf_list 89struct ip6_sf_list {
93{
94 struct ip6_sf_list *sf_next; 90 struct ip6_sf_list *sf_next;
95 struct in6_addr sf_addr; 91 struct in6_addr sf_addr;
96 unsigned long sf_count[2]; /* include/exclude counts */ 92 unsigned long sf_count[2]; /* include/exclude counts */
@@ -105,8 +101,7 @@ struct ip6_sf_list
105#define MAF_NOREPORT 0x08 101#define MAF_NOREPORT 0x08
106#define MAF_GSQUERY 0x10 102#define MAF_GSQUERY 0x10
107 103
108struct ifmcaddr6 104struct ifmcaddr6 {
109{
110 struct in6_addr mca_addr; 105 struct in6_addr mca_addr;
111 struct inet6_dev *idev; 106 struct inet6_dev *idev;
112 struct ifmcaddr6 *next; 107 struct ifmcaddr6 *next;
@@ -126,15 +121,13 @@ struct ifmcaddr6
126 121
127/* Anycast stuff */ 122/* Anycast stuff */
128 123
129struct ipv6_ac_socklist 124struct ipv6_ac_socklist {
130{
131 struct in6_addr acl_addr; 125 struct in6_addr acl_addr;
132 int acl_ifindex; 126 int acl_ifindex;
133 struct ipv6_ac_socklist *acl_next; 127 struct ipv6_ac_socklist *acl_next;
134}; 128};
135 129
136struct ifacaddr6 130struct ifacaddr6 {
137{
138 struct in6_addr aca_addr; 131 struct in6_addr aca_addr;
139 struct inet6_dev *aca_idev; 132 struct inet6_dev *aca_idev;
140 struct rt6_info *aca_rt; 133 struct rt6_info *aca_rt;
@@ -157,8 +150,7 @@ struct ipv6_devstat {
157 DEFINE_SNMP_STAT(struct icmpv6msg_mib, icmpv6msg); 150 DEFINE_SNMP_STAT(struct icmpv6msg_mib, icmpv6msg);
158}; 151};
159 152
160struct inet6_dev 153struct inet6_dev {
161{
162 struct net_device *dev; 154 struct net_device *dev;
163 155
164 struct inet6_ifaddr *addr_list; 156 struct inet6_ifaddr *addr_list;
diff --git a/include/net/inet6_hashtables.h b/include/net/inet6_hashtables.h
index 22c73a77cd99..92838d3a1ab7 100644
--- a/include/net/inet6_hashtables.h
+++ b/include/net/inet6_hashtables.h
@@ -46,8 +46,8 @@ static inline int inet6_sk_ehashfn(const struct sock *sk)
46 const struct ipv6_pinfo *np = inet6_sk(sk); 46 const struct ipv6_pinfo *np = inet6_sk(sk);
47 const struct in6_addr *laddr = &np->rcv_saddr; 47 const struct in6_addr *laddr = &np->rcv_saddr;
48 const struct in6_addr *faddr = &np->daddr; 48 const struct in6_addr *faddr = &np->daddr;
49 const __u16 lport = inet->num; 49 const __u16 lport = inet->inet_num;
50 const __be16 fport = inet->dport; 50 const __be16 fport = inet->inet_dport;
51 struct net *net = sock_net(sk); 51 struct net *net = sock_net(sk);
52 52
53 return inet6_ehashfn(net, laddr, lport, faddr, fport); 53 return inet6_ehashfn(net, laddr, lport, faddr, fport);
diff --git a/include/net/inet_hashtables.h b/include/net/inet_hashtables.h
index d522dcf3031a..41cbddd25b70 100644
--- a/include/net/inet_hashtables.h
+++ b/include/net/inet_hashtables.h
@@ -92,8 +92,8 @@ static inline struct net *ib_net(struct inet_bind_bucket *ib)
92 return read_pnet(&ib->ib_net); 92 return read_pnet(&ib->ib_net);
93} 93}
94 94
95#define inet_bind_bucket_for_each(tb, node, head) \ 95#define inet_bind_bucket_for_each(tb, pos, head) \
96 hlist_for_each_entry(tb, node, head, node) 96 hlist_for_each_entry(tb, pos, head, node)
97 97
98struct inet_bind_hashbucket { 98struct inet_bind_hashbucket {
99 spinlock_t lock; 99 spinlock_t lock;
@@ -125,7 +125,7 @@ struct inet_hashinfo {
125 */ 125 */
126 struct inet_ehash_bucket *ehash; 126 struct inet_ehash_bucket *ehash;
127 spinlock_t *ehash_locks; 127 spinlock_t *ehash_locks;
128 unsigned int ehash_size; 128 unsigned int ehash_mask;
129 unsigned int ehash_locks_mask; 129 unsigned int ehash_locks_mask;
130 130
131 /* Ok, let's try this, I give up, we do need a local binding 131 /* Ok, let's try this, I give up, we do need a local binding
@@ -158,7 +158,7 @@ static inline struct inet_ehash_bucket *inet_ehash_bucket(
158 struct inet_hashinfo *hashinfo, 158 struct inet_hashinfo *hashinfo,
159 unsigned int hash) 159 unsigned int hash)
160{ 160{
161 return &hashinfo->ehash[hash & (hashinfo->ehash_size - 1)]; 161 return &hashinfo->ehash[hash & hashinfo->ehash_mask];
162} 162}
163 163
164static inline spinlock_t *inet_ehash_lockp( 164static inline spinlock_t *inet_ehash_lockp(
@@ -241,7 +241,7 @@ static inline int inet_lhashfn(struct net *net, const unsigned short num)
241 241
242static inline int inet_sk_listen_hashfn(const struct sock *sk) 242static inline int inet_sk_listen_hashfn(const struct sock *sk)
243{ 243{
244 return inet_lhashfn(sock_net(sk), inet_sk(sk)->num); 244 return inet_lhashfn(sock_net(sk), inet_sk(sk)->inet_num);
245} 245}
246 246
247/* Caller must disable local BH processing. */ 247/* Caller must disable local BH processing. */
@@ -301,8 +301,8 @@ typedef __u64 __bitwise __addrpair;
301#endif /* __BIG_ENDIAN */ 301#endif /* __BIG_ENDIAN */
302#define INET_MATCH(__sk, __net, __hash, __cookie, __saddr, __daddr, __ports, __dif)\ 302#define INET_MATCH(__sk, __net, __hash, __cookie, __saddr, __daddr, __ports, __dif)\
303 (((__sk)->sk_hash == (__hash)) && net_eq(sock_net(__sk), (__net)) && \ 303 (((__sk)->sk_hash == (__hash)) && net_eq(sock_net(__sk), (__net)) && \
304 ((*((__addrpair *)&(inet_sk(__sk)->daddr))) == (__cookie)) && \ 304 ((*((__addrpair *)&(inet_sk(__sk)->inet_daddr))) == (__cookie)) && \
305 ((*((__portpair *)&(inet_sk(__sk)->dport))) == (__ports)) && \ 305 ((*((__portpair *)&(inet_sk(__sk)->inet_dport))) == (__ports)) && \
306 (!((__sk)->sk_bound_dev_if) || ((__sk)->sk_bound_dev_if == (__dif)))) 306 (!((__sk)->sk_bound_dev_if) || ((__sk)->sk_bound_dev_if == (__dif))))
307#define INET_TW_MATCH(__sk, __net, __hash, __cookie, __saddr, __daddr, __ports, __dif)\ 307#define INET_TW_MATCH(__sk, __net, __hash, __cookie, __saddr, __daddr, __ports, __dif)\
308 (((__sk)->sk_hash == (__hash)) && net_eq(sock_net(__sk), (__net)) && \ 308 (((__sk)->sk_hash == (__hash)) && net_eq(sock_net(__sk), (__net)) && \
@@ -313,9 +313,9 @@ typedef __u64 __bitwise __addrpair;
313#define INET_ADDR_COOKIE(__name, __saddr, __daddr) 313#define INET_ADDR_COOKIE(__name, __saddr, __daddr)
314#define INET_MATCH(__sk, __net, __hash, __cookie, __saddr, __daddr, __ports, __dif) \ 314#define INET_MATCH(__sk, __net, __hash, __cookie, __saddr, __daddr, __ports, __dif) \
315 (((__sk)->sk_hash == (__hash)) && net_eq(sock_net(__sk), (__net)) && \ 315 (((__sk)->sk_hash == (__hash)) && net_eq(sock_net(__sk), (__net)) && \
316 (inet_sk(__sk)->daddr == (__saddr)) && \ 316 (inet_sk(__sk)->inet_daddr == (__saddr)) && \
317 (inet_sk(__sk)->rcv_saddr == (__daddr)) && \ 317 (inet_sk(__sk)->inet_rcv_saddr == (__daddr)) && \
318 ((*((__portpair *)&(inet_sk(__sk)->dport))) == (__ports)) && \ 318 ((*((__portpair *)&(inet_sk(__sk)->inet_dport))) == (__ports)) && \
319 (!((__sk)->sk_bound_dev_if) || ((__sk)->sk_bound_dev_if == (__dif)))) 319 (!((__sk)->sk_bound_dev_if) || ((__sk)->sk_bound_dev_if == (__dif))))
320#define INET_TW_MATCH(__sk, __net, __hash,__cookie, __saddr, __daddr, __ports, __dif) \ 320#define INET_TW_MATCH(__sk, __net, __hash,__cookie, __saddr, __daddr, __ports, __dif) \
321 (((__sk)->sk_hash == (__hash)) && net_eq(sock_net(__sk), (__net)) && \ 321 (((__sk)->sk_hash == (__hash)) && net_eq(sock_net(__sk), (__net)) && \
diff --git a/include/net/inet_sock.h b/include/net/inet_sock.h
index 47004f35cc7e..bd4c53f75ac0 100644
--- a/include/net/inet_sock.h
+++ b/include/net/inet_sock.h
@@ -93,14 +93,14 @@ struct rtable;
93 * 93 *
94 * @sk - ancestor class 94 * @sk - ancestor class
95 * @pinet6 - pointer to IPv6 control block 95 * @pinet6 - pointer to IPv6 control block
96 * @daddr - Foreign IPv4 addr 96 * @inet_daddr - Foreign IPv4 addr
97 * @rcv_saddr - Bound local IPv4 addr 97 * @inet_rcv_saddr - Bound local IPv4 addr
98 * @dport - Destination port 98 * @inet_dport - Destination port
99 * @num - Local port 99 * @inet_num - Local port
100 * @saddr - Sending source 100 * @inet_saddr - Sending source
101 * @uc_ttl - Unicast TTL 101 * @uc_ttl - Unicast TTL
102 * @sport - Source port 102 * @inet_sport - Source port
103 * @id - ID counter for DF pkts 103 * @inet_id - ID counter for DF pkts
104 * @tos - TOS 104 * @tos - TOS
105 * @mc_ttl - Multicasting TTL 105 * @mc_ttl - Multicasting TTL
106 * @is_icsk - is this an inet_connection_sock? 106 * @is_icsk - is this an inet_connection_sock?
@@ -115,16 +115,16 @@ struct inet_sock {
115 struct ipv6_pinfo *pinet6; 115 struct ipv6_pinfo *pinet6;
116#endif 116#endif
117 /* Socket demultiplex comparisons on incoming packets. */ 117 /* Socket demultiplex comparisons on incoming packets. */
118 __be32 daddr; 118 __be32 inet_daddr;
119 __be32 rcv_saddr; 119 __be32 inet_rcv_saddr;
120 __be16 dport; 120 __be16 inet_dport;
121 __u16 num; 121 __u16 inet_num;
122 __be32 saddr; 122 __be32 inet_saddr;
123 __s16 uc_ttl; 123 __s16 uc_ttl;
124 __u16 cmsg_flags; 124 __u16 cmsg_flags;
125 struct ip_options *opt; 125 struct ip_options *opt;
126 __be16 sport; 126 __be16 inet_sport;
127 __u16 id; 127 __u16 inet_id;
128 __u8 tos; 128 __u8 tos;
129 __u8 mc_ttl; 129 __u8 mc_ttl;
130 __u8 pmtudisc; 130 __u8 pmtudisc;
@@ -190,10 +190,10 @@ static inline unsigned int inet_ehashfn(struct net *net,
190static inline int inet_sk_ehashfn(const struct sock *sk) 190static inline int inet_sk_ehashfn(const struct sock *sk)
191{ 191{
192 const struct inet_sock *inet = inet_sk(sk); 192 const struct inet_sock *inet = inet_sk(sk);
193 const __be32 laddr = inet->rcv_saddr; 193 const __be32 laddr = inet->inet_rcv_saddr;
194 const __u16 lport = inet->num; 194 const __u16 lport = inet->inet_num;
195 const __be32 faddr = inet->daddr; 195 const __be32 faddr = inet->inet_daddr;
196 const __be16 fport = inet->dport; 196 const __be16 fport = inet->inet_dport;
197 struct net *net = sock_net(sk); 197 struct net *net = sock_net(sk);
198 198
199 return inet_ehashfn(net, laddr, lport, faddr, fport); 199 return inet_ehashfn(net, laddr, lport, faddr, fport);
diff --git a/include/net/inet_timewait_sock.h b/include/net/inet_timewait_sock.h
index f93ad90a601b..b801ade2295e 100644
--- a/include/net/inet_timewait_sock.h
+++ b/include/net/inet_timewait_sock.h
@@ -194,11 +194,13 @@ static inline struct inet_timewait_sock *inet_twsk(const struct sock *sk)
194static inline __be32 inet_rcv_saddr(const struct sock *sk) 194static inline __be32 inet_rcv_saddr(const struct sock *sk)
195{ 195{
196 return likely(sk->sk_state != TCP_TIME_WAIT) ? 196 return likely(sk->sk_state != TCP_TIME_WAIT) ?
197 inet_sk(sk)->rcv_saddr : inet_twsk(sk)->tw_rcv_saddr; 197 inet_sk(sk)->inet_rcv_saddr : inet_twsk(sk)->tw_rcv_saddr;
198} 198}
199 199
200extern void inet_twsk_put(struct inet_timewait_sock *tw); 200extern void inet_twsk_put(struct inet_timewait_sock *tw);
201 201
202extern int inet_twsk_unhash(struct inet_timewait_sock *tw);
203
202extern struct inet_timewait_sock *inet_twsk_alloc(const struct sock *sk, 204extern struct inet_timewait_sock *inet_twsk_alloc(const struct sock *sk,
203 const int state); 205 const int state);
204 206
@@ -212,14 +214,14 @@ extern void inet_twsk_schedule(struct inet_timewait_sock *tw,
212extern void inet_twsk_deschedule(struct inet_timewait_sock *tw, 214extern void inet_twsk_deschedule(struct inet_timewait_sock *tw,
213 struct inet_timewait_death_row *twdr); 215 struct inet_timewait_death_row *twdr);
214 216
215extern void inet_twsk_purge(struct net *net, struct inet_hashinfo *hashinfo, 217extern void inet_twsk_purge(struct inet_hashinfo *hashinfo,
216 struct inet_timewait_death_row *twdr, int family); 218 struct inet_timewait_death_row *twdr, int family);
217 219
218static inline 220static inline
219struct net *twsk_net(const struct inet_timewait_sock *twsk) 221struct net *twsk_net(const struct inet_timewait_sock *twsk)
220{ 222{
221#ifdef CONFIG_NET_NS 223#ifdef CONFIG_NET_NS
222 return twsk->tw_net; 224 return rcu_dereference(twsk->tw_net);
223#else 225#else
224 return &init_net; 226 return &init_net;
225#endif 227#endif
@@ -229,7 +231,7 @@ static inline
229void twsk_net_set(struct inet_timewait_sock *twsk, struct net *net) 231void twsk_net_set(struct inet_timewait_sock *twsk, struct net *net)
230{ 232{
231#ifdef CONFIG_NET_NS 233#ifdef CONFIG_NET_NS
232 twsk->tw_net = net; 234 rcu_assign_pointer(twsk->tw_net, net);
233#endif 235#endif
234} 236}
235#endif /* _INET_TIMEWAIT_SOCK_ */ 237#endif /* _INET_TIMEWAIT_SOCK_ */
diff --git a/include/net/inetpeer.h b/include/net/inetpeer.h
index 15e1f8fe4c1f..87b1df0d4d8c 100644
--- a/include/net/inetpeer.h
+++ b/include/net/inetpeer.h
@@ -13,20 +13,19 @@
13#include <linux/spinlock.h> 13#include <linux/spinlock.h>
14#include <asm/atomic.h> 14#include <asm/atomic.h>
15 15
16struct inet_peer 16struct inet_peer {
17{
18 /* group together avl_left,avl_right,v4daddr to speedup lookups */ 17 /* group together avl_left,avl_right,v4daddr to speedup lookups */
19 struct inet_peer *avl_left, *avl_right; 18 struct inet_peer *avl_left, *avl_right;
20 __be32 v4daddr; /* peer's address */ 19 __be32 v4daddr; /* peer's address */
21 __u16 avl_height; 20 __u32 avl_height;
22 __u16 ip_id_count; /* IP ID for the next packet */
23 struct list_head unused; 21 struct list_head unused;
24 __u32 dtime; /* the time of last use of not 22 __u32 dtime; /* the time of last use of not
25 * referenced entries */ 23 * referenced entries */
26 atomic_t refcnt; 24 atomic_t refcnt;
27 atomic_t rid; /* Frag reception counter */ 25 atomic_t rid; /* Frag reception counter */
26 atomic_t ip_id_count; /* IP ID for the next packet */
28 __u32 tcp_ts; 27 __u32 tcp_ts;
29 unsigned long tcp_ts_stamp; 28 __u32 tcp_ts_stamp;
30}; 29};
31 30
32void inet_initpeers(void) __init; 31void inet_initpeers(void) __init;
@@ -37,17 +36,11 @@ struct inet_peer *inet_getpeer(__be32 daddr, int create);
37/* can be called from BH context or outside */ 36/* can be called from BH context or outside */
38extern void inet_putpeer(struct inet_peer *p); 37extern void inet_putpeer(struct inet_peer *p);
39 38
40extern spinlock_t inet_peer_idlock;
41/* can be called with or without local BH being disabled */ 39/* can be called with or without local BH being disabled */
42static inline __u16 inet_getid(struct inet_peer *p, int more) 40static inline __u16 inet_getid(struct inet_peer *p, int more)
43{ 41{
44 __u16 id; 42 more++;
45 43 return atomic_add_return(more, &p->ip_id_count) - more;
46 spin_lock_bh(&inet_peer_idlock);
47 id = p->ip_id_count;
48 p->ip_id_count += 1 + more;
49 spin_unlock_bh(&inet_peer_idlock);
50 return id;
51} 44}
52 45
53#endif /* _NET_INETPEER_H */ 46#endif /* _NET_INETPEER_H */
diff --git a/include/net/ip.h b/include/net/ip.h
index 2f47e5482b55..e6b9d12d5f62 100644
--- a/include/net/ip.h
+++ b/include/net/ip.h
@@ -33,8 +33,7 @@
33 33
34struct sock; 34struct sock;
35 35
36struct inet_skb_parm 36struct inet_skb_parm {
37{
38 struct ip_options opt; /* Compiled IP options */ 37 struct ip_options opt; /* Compiled IP options */
39 unsigned char flags; 38 unsigned char flags;
40 39
@@ -50,8 +49,7 @@ static inline unsigned int ip_hdrlen(const struct sk_buff *skb)
50 return ip_hdr(skb)->ihl * 4; 49 return ip_hdr(skb)->ihl * 4;
51} 50}
52 51
53struct ipcm_cookie 52struct ipcm_cookie {
54{
55 __be32 addr; 53 __be32 addr;
56 int oif; 54 int oif;
57 struct ip_options *opt; 55 struct ip_options *opt;
@@ -60,8 +58,7 @@ struct ipcm_cookie
60 58
61#define IPCB(skb) ((struct inet_skb_parm*)((skb)->cb)) 59#define IPCB(skb) ((struct inet_skb_parm*)((skb)->cb))
62 60
63struct ip_ra_chain 61struct ip_ra_chain {
64{
65 struct ip_ra_chain *next; 62 struct ip_ra_chain *next;
66 struct sock *sk; 63 struct sock *sk;
67 void (*destructor)(struct sock *); 64 void (*destructor)(struct sock *);
@@ -159,8 +156,7 @@ static inline __u8 ip_reply_arg_flowi_flags(const struct ip_reply_arg *arg)
159void ip_send_reply(struct sock *sk, struct sk_buff *skb, struct ip_reply_arg *arg, 156void ip_send_reply(struct sock *sk, struct sk_buff *skb, struct ip_reply_arg *arg,
160 unsigned int len); 157 unsigned int len);
161 158
162struct ipv4_config 159struct ipv4_config {
163{
164 int log_martians; 160 int log_martians;
165 int no_pmtu_disc; 161 int no_pmtu_disc;
166}; 162};
@@ -240,8 +236,8 @@ static inline void ip_select_ident(struct iphdr *iph, struct dst_entry *dst, str
240 * does not change, they drop every other packet in 236 * does not change, they drop every other packet in
241 * a TCP stream using header compression. 237 * a TCP stream using header compression.
242 */ 238 */
243 iph->id = (sk && inet_sk(sk)->daddr) ? 239 iph->id = (sk && inet_sk(sk)->inet_daddr) ?
244 htons(inet_sk(sk)->id++) : 0; 240 htons(inet_sk(sk)->inet_id++) : 0;
245 } else 241 } else
246 __ip_select_ident(iph, dst, 0); 242 __ip_select_ident(iph, dst, 0);
247} 243}
@@ -249,9 +245,9 @@ static inline void ip_select_ident(struct iphdr *iph, struct dst_entry *dst, str
249static inline void ip_select_ident_more(struct iphdr *iph, struct dst_entry *dst, struct sock *sk, int more) 245static inline void ip_select_ident_more(struct iphdr *iph, struct dst_entry *dst, struct sock *sk, int more)
250{ 246{
251 if (iph->frag_off & htons(IP_DF)) { 247 if (iph->frag_off & htons(IP_DF)) {
252 if (sk && inet_sk(sk)->daddr) { 248 if (sk && inet_sk(sk)->inet_daddr) {
253 iph->id = htons(inet_sk(sk)->id); 249 iph->id = htons(inet_sk(sk)->inet_id);
254 inet_sk(sk)->id += 1 + more; 250 inet_sk(sk)->inet_id += 1 + more;
255 } else 251 } else
256 iph->id = 0; 252 iph->id = 0;
257 } else 253 } else
@@ -317,7 +313,7 @@ static inline void ip_ib_mc_map(__be32 naddr, const unsigned char *broadcast, ch
317 313
318static __inline__ void inet_reset_saddr(struct sock *sk) 314static __inline__ void inet_reset_saddr(struct sock *sk)
319{ 315{
320 inet_sk(sk)->rcv_saddr = inet_sk(sk)->saddr = 0; 316 inet_sk(sk)->inet_rcv_saddr = inet_sk(sk)->inet_saddr = 0;
321#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) 317#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
322 if (sk->sk_family == PF_INET6) { 318 if (sk->sk_family == PF_INET6) {
323 struct ipv6_pinfo *np = inet6_sk(sk); 319 struct ipv6_pinfo *np = inet6_sk(sk);
@@ -336,8 +332,7 @@ extern int ip_call_ra_chain(struct sk_buff *skb);
336 * Functions provided by ip_fragment.c 332 * Functions provided by ip_fragment.c
337 */ 333 */
338 334
339enum ip_defrag_users 335enum ip_defrag_users {
340{
341 IP_DEFRAG_LOCAL_DELIVER, 336 IP_DEFRAG_LOCAL_DELIVER,
342 IP_DEFRAG_CALL_RA_CHAIN, 337 IP_DEFRAG_CALL_RA_CHAIN,
343 IP_DEFRAG_CONNTRACK_IN, 338 IP_DEFRAG_CONNTRACK_IN,
diff --git a/include/net/ip6_fib.h b/include/net/ip6_fib.h
index 15b492a9aa79..257808188add 100644
--- a/include/net/ip6_fib.h
+++ b/include/net/ip6_fib.h
@@ -30,8 +30,7 @@
30 30
31struct rt6_info; 31struct rt6_info;
32 32
33struct fib6_config 33struct fib6_config {
34{
35 u32 fc_table; 34 u32 fc_table;
36 u32 fc_metric; 35 u32 fc_metric;
37 int fc_dst_len; 36 int fc_dst_len;
@@ -51,8 +50,7 @@ struct fib6_config
51 struct nl_info fc_nlinfo; 50 struct nl_info fc_nlinfo;
52}; 51};
53 52
54struct fib6_node 53struct fib6_node {
55{
56 struct fib6_node *parent; 54 struct fib6_node *parent;
57 struct fib6_node *left; 55 struct fib6_node *left;
58 struct fib6_node *right; 56 struct fib6_node *right;
@@ -78,16 +76,14 @@ struct fib6_node
78 * 76 *
79 */ 77 */
80 78
81struct rt6key 79struct rt6key {
82{
83 struct in6_addr addr; 80 struct in6_addr addr;
84 int plen; 81 int plen;
85}; 82};
86 83
87struct fib6_table; 84struct fib6_table;
88 85
89struct rt6_info 86struct rt6_info {
90{
91 union { 87 union {
92 struct dst_entry dst; 88 struct dst_entry dst;
93 } u; 89 } u;
@@ -127,8 +123,7 @@ static inline struct inet6_dev *ip6_dst_idev(struct dst_entry *dst)
127 return ((struct rt6_info *)dst)->rt6i_idev; 123 return ((struct rt6_info *)dst)->rt6i_idev;
128} 124}
129 125
130struct fib6_walker_t 126struct fib6_walker_t {
131{
132 struct fib6_walker_t *prev, *next; 127 struct fib6_walker_t *prev, *next;
133 struct fib6_node *root, *node; 128 struct fib6_node *root, *node;
134 struct rt6_info *leaf; 129 struct rt6_info *leaf;
diff --git a/include/net/ip6_route.h b/include/net/ip6_route.h
index 0e1b8aebaff8..4a808de7c0f6 100644
--- a/include/net/ip6_route.h
+++ b/include/net/ip6_route.h
@@ -103,8 +103,7 @@ extern void rt6_pmtu_discovery(struct in6_addr *daddr,
103 103
104struct netlink_callback; 104struct netlink_callback;
105 105
106struct rt6_rtnl_dump_arg 106struct rt6_rtnl_dump_arg {
107{
108 struct sk_buff *skb; 107 struct sk_buff *skb;
109 struct netlink_callback *cb; 108 struct netlink_callback *cb;
110 struct net *net; 109 struct net *net;
diff --git a/include/net/ip_fib.h b/include/net/ip_fib.h
index 4d22fabc7719..c93f94edc610 100644
--- a/include/net/ip_fib.h
+++ b/include/net/ip_fib.h
@@ -144,18 +144,21 @@ struct fib_table {
144 struct hlist_node tb_hlist; 144 struct hlist_node tb_hlist;
145 u32 tb_id; 145 u32 tb_id;
146 int tb_default; 146 int tb_default;
147 int (*tb_lookup)(struct fib_table *tb, const struct flowi *flp, struct fib_result *res);
148 int (*tb_insert)(struct fib_table *, struct fib_config *);
149 int (*tb_delete)(struct fib_table *, struct fib_config *);
150 int (*tb_dump)(struct fib_table *table, struct sk_buff *skb,
151 struct netlink_callback *cb);
152 int (*tb_flush)(struct fib_table *table);
153 void (*tb_select_default)(struct fib_table *table,
154 const struct flowi *flp, struct fib_result *res);
155
156 unsigned char tb_data[0]; 147 unsigned char tb_data[0];
157}; 148};
158 149
150extern int fib_table_lookup(struct fib_table *tb, const struct flowi *flp,
151 struct fib_result *res);
152extern int fib_table_insert(struct fib_table *, struct fib_config *);
153extern int fib_table_delete(struct fib_table *, struct fib_config *);
154extern int fib_table_dump(struct fib_table *table, struct sk_buff *skb,
155 struct netlink_callback *cb);
156extern int fib_table_flush(struct fib_table *table);
157extern void fib_table_select_default(struct fib_table *table,
158 const struct flowi *flp,
159 struct fib_result *res);
160
161
159#ifndef CONFIG_IP_MULTIPLE_TABLES 162#ifndef CONFIG_IP_MULTIPLE_TABLES
160 163
161#define TABLE_LOCAL_INDEX 0 164#define TABLE_LOCAL_INDEX 0
@@ -182,11 +185,11 @@ static inline int fib_lookup(struct net *net, const struct flowi *flp,
182 struct fib_table *table; 185 struct fib_table *table;
183 186
184 table = fib_get_table(net, RT_TABLE_LOCAL); 187 table = fib_get_table(net, RT_TABLE_LOCAL);
185 if (!table->tb_lookup(table, flp, res)) 188 if (!fib_table_lookup(table, flp, res))
186 return 0; 189 return 0;
187 190
188 table = fib_get_table(net, RT_TABLE_MAIN); 191 table = fib_get_table(net, RT_TABLE_MAIN);
189 if (!table->tb_lookup(table, flp, res)) 192 if (!fib_table_lookup(table, flp, res))
190 return 0; 193 return 0;
191 return -ENETUNREACH; 194 return -ENETUNREACH;
192} 195}
diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h
index 98978e73f666..8dc3296b7bea 100644
--- a/include/net/ip_vs.h
+++ b/include/net/ip_vs.h
@@ -251,8 +251,7 @@ struct ip_vs_estimator {
251 u32 outbps; 251 u32 outbps;
252}; 252};
253 253
254struct ip_vs_stats 254struct ip_vs_stats {
255{
256 struct ip_vs_stats_user ustats; /* statistics */ 255 struct ip_vs_stats_user ustats; /* statistics */
257 struct ip_vs_estimator est; /* estimator */ 256 struct ip_vs_estimator est; /* estimator */
258 257
@@ -518,8 +517,7 @@ struct ip_vs_scheduler {
518/* 517/*
519 * The application module object (a.k.a. app incarnation) 518 * The application module object (a.k.a. app incarnation)
520 */ 519 */
521struct ip_vs_app 520struct ip_vs_app {
522{
523 struct list_head a_list; /* member in app list */ 521 struct list_head a_list; /* member in app list */
524 int type; /* IP_VS_APP_TYPE_xxx */ 522 int type; /* IP_VS_APP_TYPE_xxx */
525 char *name; /* application module name */ 523 char *name; /* application module name */
diff --git a/include/net/ipip.h b/include/net/ipip.h
index 87acf8f3a155..11e8513d2d07 100644
--- a/include/net/ipip.h
+++ b/include/net/ipip.h
@@ -7,8 +7,15 @@
7/* Keep error state on tunnel for 30 sec */ 7/* Keep error state on tunnel for 30 sec */
8#define IPTUNNEL_ERR_TIMEO (30*HZ) 8#define IPTUNNEL_ERR_TIMEO (30*HZ)
9 9
10struct ip_tunnel 10/* 6rd prefix/relay information */
11{ 11struct ip_tunnel_6rd_parm {
12 struct in6_addr prefix;
13 __be32 relay_prefix;
14 u16 prefixlen;
15 u16 relay_prefixlen;
16};
17
18struct ip_tunnel {
12 struct ip_tunnel *next; 19 struct ip_tunnel *next;
13 struct net_device *dev; 20 struct net_device *dev;
14 21
@@ -23,15 +30,19 @@ struct ip_tunnel
23 30
24 struct ip_tunnel_parm parms; 31 struct ip_tunnel_parm parms;
25 32
33 /* for SIT */
34#ifdef CONFIG_IPV6_SIT_6RD
35 struct ip_tunnel_6rd_parm ip6rd;
36#endif
26 struct ip_tunnel_prl_entry *prl; /* potential router list */ 37 struct ip_tunnel_prl_entry *prl; /* potential router list */
27 unsigned int prl_count; /* # of entries in PRL */ 38 unsigned int prl_count; /* # of entries in PRL */
28}; 39};
29 40
30struct ip_tunnel_prl_entry 41struct ip_tunnel_prl_entry {
31{
32 struct ip_tunnel_prl_entry *next; 42 struct ip_tunnel_prl_entry *next;
33 __be32 addr; 43 __be32 addr;
34 u16 flags; 44 u16 flags;
45 struct rcu_head rcu_head;
35}; 46};
36 47
37#define IPTUNNEL_XMIT() do { \ 48#define IPTUNNEL_XMIT() do { \
@@ -42,9 +53,9 @@ struct ip_tunnel_prl_entry
42 ip_select_ident(iph, &rt->u.dst, NULL); \ 53 ip_select_ident(iph, &rt->u.dst, NULL); \
43 \ 54 \
44 err = ip_local_out(skb); \ 55 err = ip_local_out(skb); \
45 if (net_xmit_eval(err) == 0) { \ 56 if (likely(net_xmit_eval(err) == 0)) { \
46 stats->tx_bytes += pkt_len; \ 57 txq->tx_bytes += pkt_len; \
47 stats->tx_packets++; \ 58 txq->tx_packets++; \
48 } else { \ 59 } else { \
49 stats->tx_errors++; \ 60 stats->tx_errors++; \
50 stats->tx_aborted_errors++; \ 61 stats->tx_aborted_errors++; \
diff --git a/include/net/ipv6.h b/include/net/ipv6.h
index 8c31d8a0c1fe..92db8617d188 100644
--- a/include/net/ipv6.h
+++ b/include/net/ipv6.h
@@ -160,8 +160,7 @@ extern struct ctl_path net_ipv6_ctl_path[];
160#define ICMP6MSGIN_INC_STATS_BH(net, idev, field) \ 160#define ICMP6MSGIN_INC_STATS_BH(net, idev, field) \
161 _DEVINC(net, icmpv6msg, _BH, idev, field) 161 _DEVINC(net, icmpv6msg, _BH, idev, field)
162 162
163struct ip6_ra_chain 163struct ip6_ra_chain {
164{
165 struct ip6_ra_chain *next; 164 struct ip6_ra_chain *next;
166 struct sock *sk; 165 struct sock *sk;
167 int sel; 166 int sel;
@@ -176,8 +175,7 @@ extern rwlock_t ip6_ra_lock;
176 ancillary data and passed to IPv6. 175 ancillary data and passed to IPv6.
177 */ 176 */
178 177
179struct ipv6_txoptions 178struct ipv6_txoptions {
180{
181 /* Length of this structure */ 179 /* Length of this structure */
182 int tot_len; 180 int tot_len;
183 181
@@ -194,8 +192,7 @@ struct ipv6_txoptions
194 /* Option buffer, as read by IPV6_PKTOPTIONS, starts here. */ 192 /* Option buffer, as read by IPV6_PKTOPTIONS, starts here. */
195}; 193};
196 194
197struct ip6_flowlabel 195struct ip6_flowlabel {
198{
199 struct ip6_flowlabel *next; 196 struct ip6_flowlabel *next;
200 __be32 label; 197 __be32 label;
201 atomic_t users; 198 atomic_t users;
@@ -212,8 +209,7 @@ struct ip6_flowlabel
212#define IPV6_FLOWINFO_MASK cpu_to_be32(0x0FFFFFFF) 209#define IPV6_FLOWINFO_MASK cpu_to_be32(0x0FFFFFFF)
213#define IPV6_FLOWLABEL_MASK cpu_to_be32(0x000FFFFF) 210#define IPV6_FLOWLABEL_MASK cpu_to_be32(0x000FFFFF)
214 211
215struct ipv6_fl_socklist 212struct ipv6_fl_socklist {
216{
217 struct ipv6_fl_socklist *next; 213 struct ipv6_fl_socklist *next;
218 struct ip6_flowlabel *fl; 214 struct ip6_flowlabel *fl;
219}; 215};
diff --git a/include/net/iw_handler.h b/include/net/iw_handler.h
index e9054a283fde..b2b98f3fa265 100644
--- a/include/net/iw_handler.h
+++ b/include/net/iw_handler.h
@@ -300,8 +300,7 @@
300 * This struct is also my long term insurance. I can add new fields here 300 * This struct is also my long term insurance. I can add new fields here
301 * without breaking the prototype of iw_handler... 301 * without breaking the prototype of iw_handler...
302 */ 302 */
303struct iw_request_info 303struct iw_request_info {
304{
305 __u16 cmd; /* Wireless Extension command */ 304 __u16 cmd; /* Wireless Extension command */
306 __u16 flags; /* More to come ;-) */ 305 __u16 flags; /* More to come ;-) */
307}; 306};
@@ -321,20 +320,20 @@ typedef int (*iw_handler)(struct net_device *dev, struct iw_request_info *info,
321 * shared by all driver instances... Same for the members... 320 * shared by all driver instances... Same for the members...
322 * This will be linked from net_device in <linux/netdevice.h> 321 * This will be linked from net_device in <linux/netdevice.h>
323 */ 322 */
324struct iw_handler_def 323struct iw_handler_def {
325{
326 /* Number of handlers defined (more precisely, index of the
327 * last defined handler + 1) */
328 __u16 num_standard;
329 __u16 num_private;
330 /* Number of private arg description */
331 __u16 num_private_args;
332 324
333 /* Array of handlers for standard ioctls 325 /* Array of handlers for standard ioctls
334 * We will call dev->wireless_handlers->standard[ioctl - SIOCSIWCOMMIT] 326 * We will call dev->wireless_handlers->standard[ioctl - SIOCSIWCOMMIT]
335 */ 327 */
336 const iw_handler * standard; 328 const iw_handler * standard;
329 /* Number of handlers defined (more precisely, index of the
330 * last defined handler + 1) */
331 __u16 num_standard;
337 332
333#ifdef CONFIG_WEXT_PRIV
334 __u16 num_private;
335 /* Number of private arg description */
336 __u16 num_private_args;
338 /* Array of handlers for private ioctls 337 /* Array of handlers for private ioctls
339 * Will call dev->wireless_handlers->private[ioctl - SIOCIWFIRSTPRIV] 338 * Will call dev->wireless_handlers->private[ioctl - SIOCIWFIRSTPRIV]
340 */ 339 */
@@ -344,6 +343,7 @@ struct iw_handler_def
344 * can put it in any order you want and should not leave holes... 343 * can put it in any order you want and should not leave holes...
345 * We will automatically export that to user space... */ 344 * We will automatically export that to user space... */
346 const struct iw_priv_args * private_args; 345 const struct iw_priv_args * private_args;
346#endif
347 347
348 /* New location of get_wireless_stats, to de-bloat struct net_device. 348 /* New location of get_wireless_stats, to de-bloat struct net_device.
349 * The old pointer in struct net_device will be gradually phased 349 * The old pointer in struct net_device will be gradually phased
@@ -370,8 +370,7 @@ struct iw_handler_def
370/* 370/*
371 * Describe how a standard IOCTL looks like. 371 * Describe how a standard IOCTL looks like.
372 */ 372 */
373struct iw_ioctl_description 373struct iw_ioctl_description {
374{
375 __u8 header_type; /* NULL, iw_point or other */ 374 __u8 header_type; /* NULL, iw_point or other */
376 __u8 token_type; /* Future */ 375 __u8 token_type; /* Future */
377 __u16 token_size; /* Granularity of payload */ 376 __u16 token_size; /* Granularity of payload */
@@ -393,8 +392,7 @@ struct iw_ioctl_description
393/* 392/*
394 * Instance specific spy data, i.e. addresses spied and quality for them. 393 * Instance specific spy data, i.e. addresses spied and quality for them.
395 */ 394 */
396struct iw_spy_data 395struct iw_spy_data {
397{
398 /* --- Standard spy support --- */ 396 /* --- Standard spy support --- */
399 int spy_number; 397 int spy_number;
400 u_char spy_address[IW_MAX_SPY][ETH_ALEN]; 398 u_char spy_address[IW_MAX_SPY][ETH_ALEN];
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 998c30fc8981..2aff4906b2ae 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -219,7 +219,7 @@ struct ieee80211_bss_conf {
219 * 219 *
220 * These flags are used with the @flags member of &ieee80211_tx_info. 220 * These flags are used with the @flags member of &ieee80211_tx_info.
221 * 221 *
222 * @IEEE80211_TX_CTL_REQ_TX_STATUS: request TX status callback for this frame. 222 * @IEEE80211_TX_CTL_REQ_TX_STATUS: require TX status callback for this frame.
223 * @IEEE80211_TX_CTL_ASSIGN_SEQ: The driver has to assign a sequence 223 * @IEEE80211_TX_CTL_ASSIGN_SEQ: The driver has to assign a sequence
224 * number to this frame, taking care of not overwriting the fragment 224 * number to this frame, taking care of not overwriting the fragment
225 * number and increasing the sequence number only when the 225 * number and increasing the sequence number only when the
@@ -390,10 +390,12 @@ struct ieee80211_tx_rate {
390 * @control: union for control data 390 * @control: union for control data
391 * @status: union for status data 391 * @status: union for status data
392 * @driver_data: array of driver_data pointers 392 * @driver_data: array of driver_data pointers
393 * @ampdu_ack_len: number of aggregated frames. 393 * @ampdu_ack_len: number of acked aggregated frames.
394 * relevant only if IEEE80211_TX_STATUS_AMPDU was set. 394 * relevant only if IEEE80211_TX_STATUS_AMPDU was set.
395 * @ampdu_ack_map: block ack bit map for the aggregation. 395 * @ampdu_ack_map: block ack bit map for the aggregation.
396 * relevant only if IEEE80211_TX_STATUS_AMPDU was set. 396 * relevant only if IEEE80211_TX_STATUS_AMPDU was set.
397 * @ampdu_len: number of aggregated frames.
398 * relevant only if IEEE80211_TX_STATUS_AMPDU was set.
397 * @ack_signal: signal strength of the ACK frame 399 * @ack_signal: signal strength of the ACK frame
398 */ 400 */
399struct ieee80211_tx_info { 401struct ieee80211_tx_info {
@@ -428,7 +430,8 @@ struct ieee80211_tx_info {
428 u8 ampdu_ack_len; 430 u8 ampdu_ack_len;
429 u64 ampdu_ack_map; 431 u64 ampdu_ack_map;
430 int ack_signal; 432 int ack_signal;
431 /* 8 bytes free */ 433 u8 ampdu_len;
434 /* 7 bytes free */
432 } status; 435 } status;
433 struct { 436 struct {
434 struct ieee80211_tx_rate driver_rates[ 437 struct ieee80211_tx_rate driver_rates[
@@ -494,7 +497,6 @@ ieee80211_tx_info_clear_status(struct ieee80211_tx_info *info)
494 * @RX_FLAG_MMIC_ERROR: Michael MIC error was reported on this frame. 497 * @RX_FLAG_MMIC_ERROR: Michael MIC error was reported on this frame.
495 * Use together with %RX_FLAG_MMIC_STRIPPED. 498 * Use together with %RX_FLAG_MMIC_STRIPPED.
496 * @RX_FLAG_DECRYPTED: This frame was decrypted in hardware. 499 * @RX_FLAG_DECRYPTED: This frame was decrypted in hardware.
497 * @RX_FLAG_RADIOTAP: This frame starts with a radiotap header.
498 * @RX_FLAG_MMIC_STRIPPED: the Michael MIC is stripped off this frame, 500 * @RX_FLAG_MMIC_STRIPPED: the Michael MIC is stripped off this frame,
499 * verification has been done by the hardware. 501 * verification has been done by the hardware.
500 * @RX_FLAG_IV_STRIPPED: The IV/ICV are stripped from this frame. 502 * @RX_FLAG_IV_STRIPPED: The IV/ICV are stripped from this frame.
@@ -511,11 +513,13 @@ ieee80211_tx_info_clear_status(struct ieee80211_tx_info *info)
511 * @RX_FLAG_HT: HT MCS was used and rate_idx is MCS index 513 * @RX_FLAG_HT: HT MCS was used and rate_idx is MCS index
512 * @RX_FLAG_40MHZ: HT40 (40 MHz) was used 514 * @RX_FLAG_40MHZ: HT40 (40 MHz) was used
513 * @RX_FLAG_SHORT_GI: Short guard interval was used 515 * @RX_FLAG_SHORT_GI: Short guard interval was used
516 * @RX_FLAG_INTERNAL_CMTR: set internally after frame was reported
517 * on cooked monitor to avoid double-reporting it for multiple
518 * virtual interfaces
514 */ 519 */
515enum mac80211_rx_flags { 520enum mac80211_rx_flags {
516 RX_FLAG_MMIC_ERROR = 1<<0, 521 RX_FLAG_MMIC_ERROR = 1<<0,
517 RX_FLAG_DECRYPTED = 1<<1, 522 RX_FLAG_DECRYPTED = 1<<1,
518 RX_FLAG_RADIOTAP = 1<<2,
519 RX_FLAG_MMIC_STRIPPED = 1<<3, 523 RX_FLAG_MMIC_STRIPPED = 1<<3,
520 RX_FLAG_IV_STRIPPED = 1<<4, 524 RX_FLAG_IV_STRIPPED = 1<<4,
521 RX_FLAG_FAILED_FCS_CRC = 1<<5, 525 RX_FLAG_FAILED_FCS_CRC = 1<<5,
@@ -525,6 +529,7 @@ enum mac80211_rx_flags {
525 RX_FLAG_HT = 1<<9, 529 RX_FLAG_HT = 1<<9,
526 RX_FLAG_40MHZ = 1<<10, 530 RX_FLAG_40MHZ = 1<<10,
527 RX_FLAG_SHORT_GI = 1<<11, 531 RX_FLAG_SHORT_GI = 1<<11,
532 RX_FLAG_INTERNAL_CMTR = 1<<12,
528}; 533};
529 534
530/** 535/**
@@ -554,7 +559,7 @@ struct ieee80211_rx_status {
554 int freq; 559 int freq;
555 int signal; 560 int signal;
556 int noise; 561 int noise;
557 int qual; 562 int __deprecated qual;
558 int antenna; 563 int antenna;
559 int rate_idx; 564 int rate_idx;
560 int flag; 565 int flag;
@@ -565,7 +570,9 @@ struct ieee80211_rx_status {
565 * 570 *
566 * Flags to define PHY configuration options 571 * Flags to define PHY configuration options
567 * 572 *
568 * @IEEE80211_CONF_RADIOTAP: add radiotap header at receive time (if supported) 573 * @IEEE80211_CONF_MONITOR: there's a monitor interface present -- use this
574 * to determine for example whether to calculate timestamps for packets
575 * or not, do not use instead of filter flags!
569 * @IEEE80211_CONF_PS: Enable 802.11 power save mode (managed mode only) 576 * @IEEE80211_CONF_PS: Enable 802.11 power save mode (managed mode only)
570 * @IEEE80211_CONF_IDLE: The device is running, but idle; if the flag is set 577 * @IEEE80211_CONF_IDLE: The device is running, but idle; if the flag is set
571 * the driver should be prepared to handle configuration requests but 578 * the driver should be prepared to handle configuration requests but
@@ -574,7 +581,7 @@ struct ieee80211_rx_status {
574 * it can also be unset in that case when monitor interfaces are active. 581 * it can also be unset in that case when monitor interfaces are active.
575 */ 582 */
576enum ieee80211_conf_flags { 583enum ieee80211_conf_flags {
577 IEEE80211_CONF_RADIOTAP = (1<<0), 584 IEEE80211_CONF_MONITOR = (1<<0),
578 IEEE80211_CONF_PS = (1<<1), 585 IEEE80211_CONF_PS = (1<<1),
579 IEEE80211_CONF_IDLE = (1<<2), 586 IEEE80211_CONF_IDLE = (1<<2),
580}; 587};
@@ -584,7 +591,7 @@ enum ieee80211_conf_flags {
584 * enum ieee80211_conf_changed - denotes which configuration changed 591 * enum ieee80211_conf_changed - denotes which configuration changed
585 * 592 *
586 * @IEEE80211_CONF_CHANGE_LISTEN_INTERVAL: the listen interval changed 593 * @IEEE80211_CONF_CHANGE_LISTEN_INTERVAL: the listen interval changed
587 * @IEEE80211_CONF_CHANGE_RADIOTAP: the radiotap flag changed 594 * @IEEE80211_CONF_CHANGE_MONITOR: the monitor flag changed
588 * @IEEE80211_CONF_CHANGE_PS: the PS flag or dynamic PS timeout changed 595 * @IEEE80211_CONF_CHANGE_PS: the PS flag or dynamic PS timeout changed
589 * @IEEE80211_CONF_CHANGE_POWER: the TX power changed 596 * @IEEE80211_CONF_CHANGE_POWER: the TX power changed
590 * @IEEE80211_CONF_CHANGE_CHANNEL: the channel/channel_type changed 597 * @IEEE80211_CONF_CHANGE_CHANNEL: the channel/channel_type changed
@@ -593,7 +600,7 @@ enum ieee80211_conf_flags {
593 */ 600 */
594enum ieee80211_conf_changed { 601enum ieee80211_conf_changed {
595 IEEE80211_CONF_CHANGE_LISTEN_INTERVAL = BIT(2), 602 IEEE80211_CONF_CHANGE_LISTEN_INTERVAL = BIT(2),
596 IEEE80211_CONF_CHANGE_RADIOTAP = BIT(3), 603 IEEE80211_CONF_CHANGE_MONITOR = BIT(3),
597 IEEE80211_CONF_CHANGE_PS = BIT(4), 604 IEEE80211_CONF_CHANGE_PS = BIT(4),
598 IEEE80211_CONF_CHANGE_POWER = BIT(5), 605 IEEE80211_CONF_CHANGE_POWER = BIT(5),
599 IEEE80211_CONF_CHANGE_CHANNEL = BIT(6), 606 IEEE80211_CONF_CHANGE_CHANNEL = BIT(6),
@@ -852,6 +859,19 @@ enum ieee80211_tkip_key_type {
852 * any particular flags. There are some exceptions to this rule, 859 * any particular flags. There are some exceptions to this rule,
853 * however, so you are advised to review these flags carefully. 860 * however, so you are advised to review these flags carefully.
854 * 861 *
862 * @IEEE80211_HW_HAS_RATE_CONTROL:
863 * The hardware or firmware includes rate control, and cannot be
864 * controlled by the stack. As such, no rate control algorithm
865 * should be instantiated, and the TX rate reported to userspace
866 * will be taken from the TX status instead of the rate control
867 * algorithm.
868 * Note that this requires that the driver implement a number of
869 * callbacks so it has the correct information, it needs to have
870 * the @set_rts_threshold callback and must look at the BSS config
871 * @use_cts_prot for G/N protection, @use_short_slot for slot
872 * timing in 2.4 GHz and @use_short_preamble for preambles for
873 * CCK frames.
874 *
855 * @IEEE80211_HW_RX_INCLUDES_FCS: 875 * @IEEE80211_HW_RX_INCLUDES_FCS:
856 * Indicates that received frames passed to the stack include 876 * Indicates that received frames passed to the stack include
857 * the FCS at the end. 877 * the FCS at the end.
@@ -910,6 +930,7 @@ enum ieee80211_tkip_key_type {
910 * avoid waking up cpu. 930 * avoid waking up cpu.
911 */ 931 */
912enum ieee80211_hw_flags { 932enum ieee80211_hw_flags {
933 IEEE80211_HW_HAS_RATE_CONTROL = 1<<0,
913 IEEE80211_HW_RX_INCLUDES_FCS = 1<<1, 934 IEEE80211_HW_RX_INCLUDES_FCS = 1<<1,
914 IEEE80211_HW_HOST_BROADCAST_PS_BUFFERING = 1<<2, 935 IEEE80211_HW_HOST_BROADCAST_PS_BUFFERING = 1<<2,
915 IEEE80211_HW_2GHZ_SHORT_SLOT_INCAPABLE = 1<<3, 936 IEEE80211_HW_2GHZ_SHORT_SLOT_INCAPABLE = 1<<3,
@@ -1511,6 +1532,7 @@ struct ieee80211_ops {
1511 void (*reset_tsf)(struct ieee80211_hw *hw); 1532 void (*reset_tsf)(struct ieee80211_hw *hw);
1512 int (*tx_last_beacon)(struct ieee80211_hw *hw); 1533 int (*tx_last_beacon)(struct ieee80211_hw *hw);
1513 int (*ampdu_action)(struct ieee80211_hw *hw, 1534 int (*ampdu_action)(struct ieee80211_hw *hw,
1535 struct ieee80211_vif *vif,
1514 enum ieee80211_ampdu_mlme_action action, 1536 enum ieee80211_ampdu_mlme_action action,
1515 struct ieee80211_sta *sta, u16 tid, u16 *ssn); 1537 struct ieee80211_sta *sta, u16 tid, u16 *ssn);
1516 1538
@@ -1667,15 +1689,14 @@ void ieee80211_restart_hw(struct ieee80211_hw *hw);
1667 * ieee80211_rx - receive frame 1689 * ieee80211_rx - receive frame
1668 * 1690 *
1669 * Use this function to hand received frames to mac80211. The receive 1691 * Use this function to hand received frames to mac80211. The receive
1670 * buffer in @skb must start with an IEEE 802.11 header or a radiotap 1692 * buffer in @skb must start with an IEEE 802.11 header.
1671 * header if %RX_FLAG_RADIOTAP is set in the @status flags.
1672 * 1693 *
1673 * This function may not be called in IRQ context. Calls to this function 1694 * This function may not be called in IRQ context. Calls to this function
1674 * for a single hardware must be synchronized against each other. Calls 1695 * for a single hardware must be synchronized against each other. Calls to
1675 * to this function and ieee80211_rx_irqsafe() may not be mixed for a 1696 * this function, ieee80211_rx_ni() and ieee80211_rx_irqsafe() may not be
1676 * single hardware. 1697 * mixed for a single hardware.
1677 * 1698 *
1678 * Note that right now, this function must be called with softirqs disabled. 1699 * In process context use instead ieee80211_rx_ni().
1679 * 1700 *
1680 * @hw: the hardware this frame came in on 1701 * @hw: the hardware this frame came in on
1681 * @skb: the buffer to receive, owned by mac80211 after this call 1702 * @skb: the buffer to receive, owned by mac80211 after this call
@@ -1688,8 +1709,8 @@ void ieee80211_rx(struct ieee80211_hw *hw, struct sk_buff *skb);
1688 * Like ieee80211_rx() but can be called in IRQ context 1709 * Like ieee80211_rx() but can be called in IRQ context
1689 * (internally defers to a tasklet.) 1710 * (internally defers to a tasklet.)
1690 * 1711 *
1691 * Calls to this function and ieee80211_rx() may not be mixed for a 1712 * Calls to this function, ieee80211_rx() or ieee80211_rx_ni() may not
1692 * single hardware. 1713 * be mixed for a single hardware.
1693 * 1714 *
1694 * @hw: the hardware this frame came in on 1715 * @hw: the hardware this frame came in on
1695 * @skb: the buffer to receive, owned by mac80211 after this call 1716 * @skb: the buffer to receive, owned by mac80211 after this call
@@ -1697,6 +1718,26 @@ void ieee80211_rx(struct ieee80211_hw *hw, struct sk_buff *skb);
1697void ieee80211_rx_irqsafe(struct ieee80211_hw *hw, struct sk_buff *skb); 1718void ieee80211_rx_irqsafe(struct ieee80211_hw *hw, struct sk_buff *skb);
1698 1719
1699/** 1720/**
1721 * ieee80211_rx_ni - receive frame (in process context)
1722 *
1723 * Like ieee80211_rx() but can be called in process context
1724 * (internally disables bottom halves).
1725 *
1726 * Calls to this function, ieee80211_rx() and ieee80211_rx_irqsafe() may
1727 * not be mixed for a single hardware.
1728 *
1729 * @hw: the hardware this frame came in on
1730 * @skb: the buffer to receive, owned by mac80211 after this call
1731 */
1732static inline void ieee80211_rx_ni(struct ieee80211_hw *hw,
1733 struct sk_buff *skb)
1734{
1735 local_bh_disable();
1736 ieee80211_rx(hw, skb);
1737 local_bh_enable();
1738}
1739
1740/**
1700 * ieee80211_tx_status - transmit status callback 1741 * ieee80211_tx_status - transmit status callback
1701 * 1742 *
1702 * Call this function for all transmitted frames after they have been 1743 * Call this function for all transmitted frames after they have been
@@ -1730,19 +1771,45 @@ void ieee80211_tx_status_irqsafe(struct ieee80211_hw *hw,
1730 struct sk_buff *skb); 1771 struct sk_buff *skb);
1731 1772
1732/** 1773/**
1733 * ieee80211_beacon_get - beacon generation function 1774 * ieee80211_beacon_get_tim - beacon generation function
1734 * @hw: pointer obtained from ieee80211_alloc_hw(). 1775 * @hw: pointer obtained from ieee80211_alloc_hw().
1735 * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf. 1776 * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf.
1777 * @tim_offset: pointer to variable that will receive the TIM IE offset.
1778 * Set to 0 if invalid (in non-AP modes).
1779 * @tim_length: pointer to variable that will receive the TIM IE length,
1780 * (including the ID and length bytes!).
1781 * Set to 0 if invalid (in non-AP modes).
1782 *
1783 * If the driver implements beaconing modes, it must use this function to
1784 * obtain the beacon frame/template.
1736 * 1785 *
1737 * If the beacon frames are generated by the host system (i.e., not in 1786 * If the beacon frames are generated by the host system (i.e., not in
1738 * hardware/firmware), the low-level driver uses this function to receive 1787 * hardware/firmware), the driver uses this function to get each beacon
1739 * the next beacon frame from the 802.11 code. The low-level is responsible 1788 * frame from mac80211 -- it is responsible for calling this function
1740 * for calling this function before beacon data is needed (e.g., based on 1789 * before the beacon is needed (e.g. based on hardware interrupt).
1741 * hardware interrupt). Returned skb is used only once and low-level driver 1790 *
1742 * is responsible for freeing it. 1791 * If the beacon frames are generated by the device, then the driver
1792 * must use the returned beacon as the template and change the TIM IE
1793 * according to the current DTIM parameters/TIM bitmap.
1794 *
1795 * The driver is responsible for freeing the returned skb.
1743 */ 1796 */
1744struct sk_buff *ieee80211_beacon_get(struct ieee80211_hw *hw, 1797struct sk_buff *ieee80211_beacon_get_tim(struct ieee80211_hw *hw,
1745 struct ieee80211_vif *vif); 1798 struct ieee80211_vif *vif,
1799 u16 *tim_offset, u16 *tim_length);
1800
1801/**
1802 * ieee80211_beacon_get - beacon generation function
1803 * @hw: pointer obtained from ieee80211_alloc_hw().
1804 * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf.
1805 *
1806 * See ieee80211_beacon_get_tim().
1807 */
1808static inline struct sk_buff *ieee80211_beacon_get(struct ieee80211_hw *hw,
1809 struct ieee80211_vif *vif)
1810{
1811 return ieee80211_beacon_get_tim(hw, vif, NULL, NULL);
1812}
1746 1813
1747/** 1814/**
1748 * ieee80211_rts_get - RTS frame generation function 1815 * ieee80211_rts_get - RTS frame generation function
@@ -1987,8 +2054,7 @@ void ieee80211_queue_delayed_work(struct ieee80211_hw *hw,
1987 2054
1988/** 2055/**
1989 * ieee80211_start_tx_ba_session - Start a tx Block Ack session. 2056 * ieee80211_start_tx_ba_session - Start a tx Block Ack session.
1990 * @hw: pointer as obtained from ieee80211_alloc_hw(). 2057 * @sta: the station for which to start a BA session
1991 * @ra: receiver address of the BA session recipient
1992 * @tid: the TID to BA on. 2058 * @tid: the TID to BA on.
1993 * 2059 *
1994 * Return: success if addBA request was sent, failure otherwise 2060 * Return: success if addBA request was sent, failure otherwise
@@ -1997,22 +2063,22 @@ void ieee80211_queue_delayed_work(struct ieee80211_hw *hw,
1997 * the need to start aggregation on a certain RA/TID, the session level 2063 * the need to start aggregation on a certain RA/TID, the session level
1998 * will be managed by the mac80211. 2064 * will be managed by the mac80211.
1999 */ 2065 */
2000int ieee80211_start_tx_ba_session(struct ieee80211_hw *hw, u8 *ra, u16 tid); 2066int ieee80211_start_tx_ba_session(struct ieee80211_sta *sta, u16 tid);
2001 2067
2002/** 2068/**
2003 * ieee80211_start_tx_ba_cb - low level driver ready to aggregate. 2069 * ieee80211_start_tx_ba_cb - low level driver ready to aggregate.
2004 * @hw: pointer as obtained from ieee80211_alloc_hw(). 2070 * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf
2005 * @ra: receiver address of the BA session recipient. 2071 * @ra: receiver address of the BA session recipient.
2006 * @tid: the TID to BA on. 2072 * @tid: the TID to BA on.
2007 * 2073 *
2008 * This function must be called by low level driver once it has 2074 * This function must be called by low level driver once it has
2009 * finished with preparations for the BA session. 2075 * finished with preparations for the BA session.
2010 */ 2076 */
2011void ieee80211_start_tx_ba_cb(struct ieee80211_hw *hw, u8 *ra, u16 tid); 2077void ieee80211_start_tx_ba_cb(struct ieee80211_vif *vif, u8 *ra, u16 tid);
2012 2078
2013/** 2079/**
2014 * ieee80211_start_tx_ba_cb_irqsafe - low level driver ready to aggregate. 2080 * ieee80211_start_tx_ba_cb_irqsafe - low level driver ready to aggregate.
2015 * @hw: pointer as obtained from ieee80211_alloc_hw(). 2081 * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf
2016 * @ra: receiver address of the BA session recipient. 2082 * @ra: receiver address of the BA session recipient.
2017 * @tid: the TID to BA on. 2083 * @tid: the TID to BA on.
2018 * 2084 *
@@ -2020,13 +2086,12 @@ void ieee80211_start_tx_ba_cb(struct ieee80211_hw *hw, u8 *ra, u16 tid);
2020 * finished with preparations for the BA session. 2086 * finished with preparations for the BA session.
2021 * This version of the function is IRQ-safe. 2087 * This version of the function is IRQ-safe.
2022 */ 2088 */
2023void ieee80211_start_tx_ba_cb_irqsafe(struct ieee80211_hw *hw, const u8 *ra, 2089void ieee80211_start_tx_ba_cb_irqsafe(struct ieee80211_vif *vif, const u8 *ra,
2024 u16 tid); 2090 u16 tid);
2025 2091
2026/** 2092/**
2027 * ieee80211_stop_tx_ba_session - Stop a Block Ack session. 2093 * ieee80211_stop_tx_ba_session - Stop a Block Ack session.
2028 * @hw: pointer as obtained from ieee80211_alloc_hw(). 2094 * @sta: the station whose BA session to stop
2029 * @ra: receiver address of the BA session recipient
2030 * @tid: the TID to stop BA. 2095 * @tid: the TID to stop BA.
2031 * @initiator: if indicates initiator DELBA frame will be sent. 2096 * @initiator: if indicates initiator DELBA frame will be sent.
2032 * 2097 *
@@ -2036,24 +2101,23 @@ void ieee80211_start_tx_ba_cb_irqsafe(struct ieee80211_hw *hw, const u8 *ra,
2036 * the need to stop aggregation on a certain RA/TID, the session level 2101 * the need to stop aggregation on a certain RA/TID, the session level
2037 * will be managed by the mac80211. 2102 * will be managed by the mac80211.
2038 */ 2103 */
2039int ieee80211_stop_tx_ba_session(struct ieee80211_hw *hw, 2104int ieee80211_stop_tx_ba_session(struct ieee80211_sta *sta, u16 tid,
2040 u8 *ra, u16 tid,
2041 enum ieee80211_back_parties initiator); 2105 enum ieee80211_back_parties initiator);
2042 2106
2043/** 2107/**
2044 * ieee80211_stop_tx_ba_cb - low level driver ready to stop aggregate. 2108 * ieee80211_stop_tx_ba_cb - low level driver ready to stop aggregate.
2045 * @hw: pointer as obtained from ieee80211_alloc_hw(). 2109 * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf
2046 * @ra: receiver address of the BA session recipient. 2110 * @ra: receiver address of the BA session recipient.
2047 * @tid: the desired TID to BA on. 2111 * @tid: the desired TID to BA on.
2048 * 2112 *
2049 * This function must be called by low level driver once it has 2113 * This function must be called by low level driver once it has
2050 * finished with preparations for the BA session tear down. 2114 * finished with preparations for the BA session tear down.
2051 */ 2115 */
2052void ieee80211_stop_tx_ba_cb(struct ieee80211_hw *hw, u8 *ra, u8 tid); 2116void ieee80211_stop_tx_ba_cb(struct ieee80211_vif *vif, u8 *ra, u8 tid);
2053 2117
2054/** 2118/**
2055 * ieee80211_stop_tx_ba_cb_irqsafe - low level driver ready to stop aggregate. 2119 * ieee80211_stop_tx_ba_cb_irqsafe - low level driver ready to stop aggregate.
2056 * @hw: pointer as obtained from ieee80211_alloc_hw(). 2120 * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf
2057 * @ra: receiver address of the BA session recipient. 2121 * @ra: receiver address of the BA session recipient.
2058 * @tid: the desired TID to BA on. 2122 * @tid: the desired TID to BA on.
2059 * 2123 *
@@ -2061,22 +2125,75 @@ void ieee80211_stop_tx_ba_cb(struct ieee80211_hw *hw, u8 *ra, u8 tid);
2061 * finished with preparations for the BA session tear down. 2125 * finished with preparations for the BA session tear down.
2062 * This version of the function is IRQ-safe. 2126 * This version of the function is IRQ-safe.
2063 */ 2127 */
2064void ieee80211_stop_tx_ba_cb_irqsafe(struct ieee80211_hw *hw, const u8 *ra, 2128void ieee80211_stop_tx_ba_cb_irqsafe(struct ieee80211_vif *vif, const u8 *ra,
2065 u16 tid); 2129 u16 tid);
2066 2130
2067/** 2131/**
2068 * ieee80211_find_sta - find a station 2132 * ieee80211_find_sta - find a station
2069 * 2133 *
2070 * @hw: pointer as obtained from ieee80211_alloc_hw() 2134 * @vif: virtual interface to look for station on
2071 * @addr: station's address 2135 * @addr: station's address
2072 * 2136 *
2073 * This function must be called under RCU lock and the 2137 * This function must be called under RCU lock and the
2074 * resulting pointer is only valid under RCU lock as well. 2138 * resulting pointer is only valid under RCU lock as well.
2075 */ 2139 */
2076struct ieee80211_sta *ieee80211_find_sta(struct ieee80211_hw *hw, 2140struct ieee80211_sta *ieee80211_find_sta(struct ieee80211_vif *vif,
2077 const u8 *addr); 2141 const u8 *addr);
2078 2142
2079/** 2143/**
2144 * ieee80211_find_sta_by_hw - find a station on hardware
2145 *
2146 * @hw: pointer as obtained from ieee80211_alloc_hw()
2147 * @addr: station's address
2148 *
2149 * This function must be called under RCU lock and the
2150 * resulting pointer is only valid under RCU lock as well.
2151 *
2152 * NOTE: This function should not be used! When mac80211 is converted
2153 * internally to properly keep track of stations on multiple
2154 * virtual interfaces, it will not always know which station to
2155 * return here since a single address might be used by multiple
2156 * logical stations (e.g. consider a station connecting to another
2157 * BSSID on the same AP hardware without disconnecting first).
2158 *
2159 * DO NOT USE THIS FUNCTION.
2160 */
2161struct ieee80211_sta *ieee80211_find_sta_by_hw(struct ieee80211_hw *hw,
2162 const u8 *addr);
2163
2164/**
2165 * ieee80211_sta_block_awake - block station from waking up
2166 * @hw: the hardware
2167 * @pubsta: the station
2168 * @block: whether to block or unblock
2169 *
2170 * Some devices require that all frames that are on the queues
2171 * for a specific station that went to sleep are flushed before
2172 * a poll response or frames after the station woke up can be
2173 * delivered to that it. Note that such frames must be rejected
2174 * by the driver as filtered, with the appropriate status flag.
2175 *
2176 * This function allows implementing this mode in a race-free
2177 * manner.
2178 *
2179 * To do this, a driver must keep track of the number of frames
2180 * still enqueued for a specific station. If this number is not
2181 * zero when the station goes to sleep, the driver must call
2182 * this function to force mac80211 to consider the station to
2183 * be asleep regardless of the station's actual state. Once the
2184 * number of outstanding frames reaches zero, the driver must
2185 * call this function again to unblock the station. That will
2186 * cause mac80211 to be able to send ps-poll responses, and if
2187 * the station queried in the meantime then frames will also
2188 * be sent out as a result of this. Additionally, the driver
2189 * will be notified that the station woke up some time after
2190 * it is unblocked, regardless of whether the station actually
2191 * woke up while blocked or not.
2192 */
2193void ieee80211_sta_block_awake(struct ieee80211_hw *hw,
2194 struct ieee80211_sta *pubsta, bool block);
2195
2196/**
2080 * ieee80211_beacon_loss - inform hardware does not receive beacons 2197 * ieee80211_beacon_loss - inform hardware does not receive beacons
2081 * 2198 *
2082 * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf. 2199 * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf.
diff --git a/include/net/neighbour.h b/include/net/neighbour.h
index 3817fda82a80..0302f31a2fb7 100644
--- a/include/net/neighbour.h
+++ b/include/net/neighbour.h
@@ -37,8 +37,7 @@
37 37
38struct neighbour; 38struct neighbour;
39 39
40struct neigh_parms 40struct neigh_parms {
41{
42#ifdef CONFIG_NET_NS 41#ifdef CONFIG_NET_NS
43 struct net *net; 42 struct net *net;
44#endif 43#endif
@@ -70,8 +69,7 @@ struct neigh_parms
70 int locktime; 69 int locktime;
71}; 70};
72 71
73struct neigh_statistics 72struct neigh_statistics {
74{
75 unsigned long allocs; /* number of allocated neighs */ 73 unsigned long allocs; /* number of allocated neighs */
76 unsigned long destroys; /* number of destroyed neighs */ 74 unsigned long destroys; /* number of destroyed neighs */
77 unsigned long hash_grows; /* number of hash resizes */ 75 unsigned long hash_grows; /* number of hash resizes */
@@ -97,8 +95,7 @@ struct neigh_statistics
97 preempt_enable(); \ 95 preempt_enable(); \
98 } while (0) 96 } while (0)
99 97
100struct neighbour 98struct neighbour {
101{
102 struct neighbour *next; 99 struct neighbour *next;
103 struct neigh_table *tbl; 100 struct neigh_table *tbl;
104 struct neigh_parms *parms; 101 struct neigh_parms *parms;
@@ -122,8 +119,7 @@ struct neighbour
122 u8 primary_key[0]; 119 u8 primary_key[0];
123}; 120};
124 121
125struct neigh_ops 122struct neigh_ops {
126{
127 int family; 123 int family;
128 void (*solicit)(struct neighbour *, struct sk_buff*); 124 void (*solicit)(struct neighbour *, struct sk_buff*);
129 void (*error_report)(struct neighbour *, struct sk_buff*); 125 void (*error_report)(struct neighbour *, struct sk_buff*);
@@ -133,8 +129,7 @@ struct neigh_ops
133 int (*queue_xmit)(struct sk_buff*); 129 int (*queue_xmit)(struct sk_buff*);
134}; 130};
135 131
136struct pneigh_entry 132struct pneigh_entry {
137{
138 struct pneigh_entry *next; 133 struct pneigh_entry *next;
139#ifdef CONFIG_NET_NS 134#ifdef CONFIG_NET_NS
140 struct net *net; 135 struct net *net;
@@ -149,8 +144,7 @@ struct pneigh_entry
149 */ 144 */
150 145
151 146
152struct neigh_table 147struct neigh_table {
153{
154 struct neigh_table *next; 148 struct neigh_table *next;
155 int family; 149 int family;
156 int entry_size; 150 int entry_size;
@@ -264,8 +258,7 @@ extern int neigh_sysctl_register(struct net_device *dev,
264 struct neigh_parms *p, 258 struct neigh_parms *p,
265 int p_id, int pdev_id, 259 int p_id, int pdev_id,
266 char *p_name, 260 char *p_name,
267 proc_handler *proc_handler, 261 proc_handler *proc_handler);
268 ctl_handler *strategy);
269extern void neigh_sysctl_unregister(struct neigh_parms *p); 262extern void neigh_sysctl_unregister(struct neigh_parms *p);
270 263
271static inline void __neigh_parms_put(struct neigh_parms *parms) 264static inline void __neigh_parms_put(struct neigh_parms *parms)
diff --git a/include/net/net_namespace.h b/include/net/net_namespace.h
index a1202841aadd..f307e133d14c 100644
--- a/include/net/net_namespace.h
+++ b/include/net/net_namespace.h
@@ -28,6 +28,10 @@ struct ctl_table_header;
28struct net_generic; 28struct net_generic;
29struct sock; 29struct sock;
30 30
31
32#define NETDEV_HASHBITS 8
33#define NETDEV_HASHENTRIES (1 << NETDEV_HASHBITS)
34
31struct net { 35struct net {
32 atomic_t count; /* To decided when the network 36 atomic_t count; /* To decided when the network
33 * namespace should be freed. 37 * namespace should be freed.
@@ -38,7 +42,8 @@ struct net {
38 */ 42 */
39#endif 43#endif
40 struct list_head list; /* list of network namespaces */ 44 struct list_head list; /* list of network namespaces */
41 struct work_struct work; /* work struct for freeing */ 45 struct list_head cleanup_list; /* namespaces on death row */
46 struct list_head exit_list; /* Use only net_mutex */
42 47
43 struct proc_dir_entry *proc_net; 48 struct proc_dir_entry *proc_net;
44 struct proc_dir_entry *proc_net_stat; 49 struct proc_dir_entry *proc_net_stat;
@@ -80,7 +85,7 @@ struct net {
80#ifdef CONFIG_XFRM 85#ifdef CONFIG_XFRM
81 struct netns_xfrm xfrm; 86 struct netns_xfrm xfrm;
82#endif 87#endif
83#ifdef CONFIG_WIRELESS_EXT 88#ifdef CONFIG_WEXT_CORE
84 struct sk_buff_head wext_nlevents; 89 struct sk_buff_head wext_nlevents;
85#endif 90#endif
86 struct net_generic *gen; 91 struct net_generic *gen;
@@ -232,6 +237,9 @@ struct pernet_operations {
232 struct list_head list; 237 struct list_head list;
233 int (*init)(struct net *net); 238 int (*init)(struct net *net);
234 void (*exit)(struct net *net); 239 void (*exit)(struct net *net);
240 void (*exit_batch)(struct list_head *net_exit_list);
241 int *id;
242 size_t size;
235}; 243};
236 244
237/* 245/*
@@ -255,12 +263,8 @@ struct pernet_operations {
255 */ 263 */
256extern int register_pernet_subsys(struct pernet_operations *); 264extern int register_pernet_subsys(struct pernet_operations *);
257extern void unregister_pernet_subsys(struct pernet_operations *); 265extern void unregister_pernet_subsys(struct pernet_operations *);
258extern int register_pernet_gen_subsys(int *id, struct pernet_operations *);
259extern void unregister_pernet_gen_subsys(int id, struct pernet_operations *);
260extern int register_pernet_device(struct pernet_operations *); 266extern int register_pernet_device(struct pernet_operations *);
261extern void unregister_pernet_device(struct pernet_operations *); 267extern void unregister_pernet_device(struct pernet_operations *);
262extern int register_pernet_gen_device(int *id, struct pernet_operations *);
263extern void unregister_pernet_gen_device(int id, struct pernet_operations *);
264 268
265struct ctl_path; 269struct ctl_path;
266struct ctl_table; 270struct ctl_table;
diff --git a/include/net/netfilter/nf_conntrack_ecache.h b/include/net/netfilter/nf_conntrack_ecache.h
index 4f20d58e2ab7..475facc3051a 100644
--- a/include/net/netfilter/nf_conntrack_ecache.h
+++ b/include/net/netfilter/nf_conntrack_ecache.h
@@ -13,8 +13,7 @@
13#include <net/netfilter/nf_conntrack_extend.h> 13#include <net/netfilter/nf_conntrack_extend.h>
14 14
15/* Connection tracking event types */ 15/* Connection tracking event types */
16enum ip_conntrack_events 16enum ip_conntrack_events {
17{
18 IPCT_NEW = 0, /* new conntrack */ 17 IPCT_NEW = 0, /* new conntrack */
19 IPCT_RELATED = 1, /* related conntrack */ 18 IPCT_RELATED = 1, /* related conntrack */
20 IPCT_DESTROY = 2, /* destroyed conntrack */ 19 IPCT_DESTROY = 2, /* destroyed conntrack */
diff --git a/include/net/netfilter/nf_conntrack_expect.h b/include/net/netfilter/nf_conntrack_expect.h
index a9652806d0df..9a2b9cb52271 100644
--- a/include/net/netfilter/nf_conntrack_expect.h
+++ b/include/net/netfilter/nf_conntrack_expect.h
@@ -9,8 +9,7 @@
9extern unsigned int nf_ct_expect_hsize; 9extern unsigned int nf_ct_expect_hsize;
10extern unsigned int nf_ct_expect_max; 10extern unsigned int nf_ct_expect_max;
11 11
12struct nf_conntrack_expect 12struct nf_conntrack_expect {
13{
14 /* Conntrack expectation list member */ 13 /* Conntrack expectation list member */
15 struct hlist_node lnode; 14 struct hlist_node lnode;
16 15
@@ -64,8 +63,7 @@ static inline struct net *nf_ct_exp_net(struct nf_conntrack_expect *exp)
64#endif 63#endif
65} 64}
66 65
67struct nf_conntrack_expect_policy 66struct nf_conntrack_expect_policy {
68{
69 unsigned int max_expected; 67 unsigned int max_expected;
70 unsigned int timeout; 68 unsigned int timeout;
71}; 69};
diff --git a/include/net/netfilter/nf_conntrack_extend.h b/include/net/netfilter/nf_conntrack_extend.h
index 7f8fc5d123c5..e192dc17c583 100644
--- a/include/net/netfilter/nf_conntrack_extend.h
+++ b/include/net/netfilter/nf_conntrack_extend.h
@@ -3,8 +3,7 @@
3 3
4#include <net/netfilter/nf_conntrack.h> 4#include <net/netfilter/nf_conntrack.h>
5 5
6enum nf_ct_ext_id 6enum nf_ct_ext_id {
7{
8 NF_CT_EXT_HELPER, 7 NF_CT_EXT_HELPER,
9 NF_CT_EXT_NAT, 8 NF_CT_EXT_NAT,
10 NF_CT_EXT_ACCT, 9 NF_CT_EXT_ACCT,
@@ -65,8 +64,7 @@ __nf_ct_ext_add(struct nf_conn *ct, enum nf_ct_ext_id id, gfp_t gfp);
65 64
66#define NF_CT_EXT_F_PREALLOC 0x0001 65#define NF_CT_EXT_F_PREALLOC 0x0001
67 66
68struct nf_ct_ext_type 67struct nf_ct_ext_type {
69{
70 /* Destroys relationships (can be NULL). */ 68 /* Destroys relationships (can be NULL). */
71 void (*destroy)(struct nf_conn *ct); 69 void (*destroy)(struct nf_conn *ct);
72 /* Called when realloacted (can be NULL). 70 /* Called when realloacted (can be NULL).
diff --git a/include/net/netfilter/nf_conntrack_helper.h b/include/net/netfilter/nf_conntrack_helper.h
index 1b7068000927..d015de92e03f 100644
--- a/include/net/netfilter/nf_conntrack_helper.h
+++ b/include/net/netfilter/nf_conntrack_helper.h
@@ -16,8 +16,7 @@ struct module;
16 16
17#define NF_CT_HELPER_NAME_LEN 16 17#define NF_CT_HELPER_NAME_LEN 16
18 18
19struct nf_conntrack_helper 19struct nf_conntrack_helper {
20{
21 struct hlist_node hnode; /* Internal use. */ 20 struct hlist_node hnode; /* Internal use. */
22 21
23 const char *name; /* name of the module */ 22 const char *name; /* name of the module */
diff --git a/include/net/netfilter/nf_conntrack_l3proto.h b/include/net/netfilter/nf_conntrack_l3proto.h
index 9f99d36d5de9..a7547611e8f1 100644
--- a/include/net/netfilter/nf_conntrack_l3proto.h
+++ b/include/net/netfilter/nf_conntrack_l3proto.h
@@ -16,8 +16,7 @@
16#include <linux/seq_file.h> 16#include <linux/seq_file.h>
17#include <net/netfilter/nf_conntrack.h> 17#include <net/netfilter/nf_conntrack.h>
18 18
19struct nf_conntrack_l3proto 19struct nf_conntrack_l3proto {
20{
21 /* L3 Protocol Family number. ex) PF_INET */ 20 /* L3 Protocol Family number. ex) PF_INET */
22 u_int16_t l3proto; 21 u_int16_t l3proto;
23 22
diff --git a/include/net/netfilter/nf_conntrack_l4proto.h b/include/net/netfilter/nf_conntrack_l4proto.h
index 3767fb41e541..ca6dcf3445ab 100644
--- a/include/net/netfilter/nf_conntrack_l4proto.h
+++ b/include/net/netfilter/nf_conntrack_l4proto.h
@@ -15,8 +15,7 @@
15 15
16struct seq_file; 16struct seq_file;
17 17
18struct nf_conntrack_l4proto 18struct nf_conntrack_l4proto {
19{
20 /* L3 Protocol number. */ 19 /* L3 Protocol number. */
21 u_int16_t l3proto; 20 u_int16_t l3proto;
22 21
diff --git a/include/net/netfilter/nf_conntrack_tuple.h b/include/net/netfilter/nf_conntrack_tuple.h
index 2628c154d40e..4ee44c84a304 100644
--- a/include/net/netfilter/nf_conntrack_tuple.h
+++ b/include/net/netfilter/nf_conntrack_tuple.h
@@ -26,8 +26,7 @@
26 26
27/* The protocol-specific manipulable parts of the tuple: always in 27/* The protocol-specific manipulable parts of the tuple: always in
28 network order! */ 28 network order! */
29union nf_conntrack_man_proto 29union nf_conntrack_man_proto {
30{
31 /* Add other protocols here. */ 30 /* Add other protocols here. */
32 __be16 all; 31 __be16 all;
33 32
@@ -52,8 +51,7 @@ union nf_conntrack_man_proto
52}; 51};
53 52
54/* The manipulable part of the tuple. */ 53/* The manipulable part of the tuple. */
55struct nf_conntrack_man 54struct nf_conntrack_man {
56{
57 union nf_inet_addr u3; 55 union nf_inet_addr u3;
58 union nf_conntrack_man_proto u; 56 union nf_conntrack_man_proto u;
59 /* Layer 3 protocol */ 57 /* Layer 3 protocol */
@@ -61,8 +59,7 @@ struct nf_conntrack_man
61}; 59};
62 60
63/* This contains the information to distinguish a connection. */ 61/* This contains the information to distinguish a connection. */
64struct nf_conntrack_tuple 62struct nf_conntrack_tuple {
65{
66 struct nf_conntrack_man src; 63 struct nf_conntrack_man src;
67 64
68 /* These are the parts of the tuple which are fixed. */ 65 /* These are the parts of the tuple which are fixed. */
@@ -100,8 +97,7 @@ struct nf_conntrack_tuple
100 } dst; 97 } dst;
101}; 98};
102 99
103struct nf_conntrack_tuple_mask 100struct nf_conntrack_tuple_mask {
104{
105 struct { 101 struct {
106 union nf_inet_addr u3; 102 union nf_inet_addr u3;
107 union nf_conntrack_man_proto u; 103 union nf_conntrack_man_proto u;
diff --git a/include/net/netfilter/nf_nat.h b/include/net/netfilter/nf_nat.h
index 8df0b7f7fc6e..f5f09f032a90 100644
--- a/include/net/netfilter/nf_nat.h
+++ b/include/net/netfilter/nf_nat.h
@@ -5,8 +5,7 @@
5 5
6#define NF_NAT_MAPPING_TYPE_MAX_NAMELEN 16 6#define NF_NAT_MAPPING_TYPE_MAX_NAMELEN 16
7 7
8enum nf_nat_manip_type 8enum nf_nat_manip_type {
9{
10 IP_NAT_MANIP_SRC, 9 IP_NAT_MANIP_SRC,
11 IP_NAT_MANIP_DST 10 IP_NAT_MANIP_DST
12}; 11};
@@ -30,8 +29,7 @@ struct nf_nat_seq {
30}; 29};
31 30
32/* Single range specification. */ 31/* Single range specification. */
33struct nf_nat_range 32struct nf_nat_range {
34{
35 /* Set to OR of flags above. */ 33 /* Set to OR of flags above. */
36 unsigned int flags; 34 unsigned int flags;
37 35
@@ -43,8 +41,7 @@ struct nf_nat_range
43}; 41};
44 42
45/* For backwards compat: don't use in modern code. */ 43/* For backwards compat: don't use in modern code. */
46struct nf_nat_multi_range_compat 44struct nf_nat_multi_range_compat {
47{
48 unsigned int rangesize; /* Must be 1. */ 45 unsigned int rangesize; /* Must be 1. */
49 46
50 /* hangs off end. */ 47 /* hangs off end. */
@@ -57,8 +54,7 @@ struct nf_nat_multi_range_compat
57#include <net/netfilter/nf_conntrack_extend.h> 54#include <net/netfilter/nf_conntrack_extend.h>
58 55
59/* per conntrack: nat application helper private data */ 56/* per conntrack: nat application helper private data */
60union nf_conntrack_nat_help 57union nf_conntrack_nat_help {
61{
62 /* insert nat helper private data here */ 58 /* insert nat helper private data here */
63 struct nf_nat_pptp nat_pptp_info; 59 struct nf_nat_pptp nat_pptp_info;
64}; 60};
@@ -66,8 +62,7 @@ union nf_conntrack_nat_help
66struct nf_conn; 62struct nf_conn;
67 63
68/* The structure embedded in the conntrack structure. */ 64/* The structure embedded in the conntrack structure. */
69struct nf_conn_nat 65struct nf_conn_nat {
70{
71 struct hlist_node bysource; 66 struct hlist_node bysource;
72 struct nf_nat_seq seq[IP_CT_DIR_MAX]; 67 struct nf_nat_seq seq[IP_CT_DIR_MAX];
73 struct nf_conn *ct; 68 struct nf_conn *ct;
diff --git a/include/net/netfilter/nf_nat_protocol.h b/include/net/netfilter/nf_nat_protocol.h
index f3662c4394ef..c398017ccfa3 100644
--- a/include/net/netfilter/nf_nat_protocol.h
+++ b/include/net/netfilter/nf_nat_protocol.h
@@ -6,8 +6,7 @@
6 6
7struct nf_nat_range; 7struct nf_nat_range;
8 8
9struct nf_nat_protocol 9struct nf_nat_protocol {
10{
11 /* Protocol number. */ 10 /* Protocol number. */
12 unsigned int protonum; 11 unsigned int protonum;
13 12
diff --git a/include/net/netns/generic.h b/include/net/netns/generic.h
index 0c04fd2a700b..ff4982ab84b6 100644
--- a/include/net/netns/generic.h
+++ b/include/net/netns/generic.h
@@ -12,9 +12,11 @@
12 * stuff on the struct net without explicit struct net modification 12 * stuff on the struct net without explicit struct net modification
13 * 13 *
14 * The rules are simple: 14 * The rules are simple:
15 * 1. register the ops with register_pernet_gen_device to get the id 15 * 1. set pernet_operations->id. After register_pernet_device you
16 * of your private pointer; 16 * will have the id of your private pointer.
17 * 2. call net_assign_generic() to put the private data on the struct 17 * 2. Either set pernet_operations->size (to have the code allocate and
18 * free a private structure pointed to from struct net ) or
19 * call net_assign_generic() to put the private data on the struct
18 * net (most preferably this should be done in the ->init callback 20 * net (most preferably this should be done in the ->init callback
19 * of the ops registered); 21 * of the ops registered);
20 * 3. do not change this pointer while the net is alive; 22 * 3. do not change this pointer while the net is alive;
diff --git a/include/net/netns/xfrm.h b/include/net/netns/xfrm.h
index 1ba912749caa..56f8e5585df7 100644
--- a/include/net/netns/xfrm.h
+++ b/include/net/netns/xfrm.h
@@ -43,6 +43,7 @@ struct netns_xfrm {
43 struct work_struct policy_hash_work; 43 struct work_struct policy_hash_work;
44 44
45 struct sock *nlsk; 45 struct sock *nlsk;
46 struct sock *nlsk_stash;
46 47
47 u32 sysctl_aevent_etime; 48 u32 sysctl_aevent_etime;
48 u32 sysctl_aevent_rseqth; 49 u32 sysctl_aevent_rseqth;
diff --git a/include/net/phonet/phonet.h b/include/net/phonet/phonet.h
index d43f71b5ec00..7b114079a51b 100644
--- a/include/net/phonet/phonet.h
+++ b/include/net/phonet/phonet.h
@@ -46,7 +46,9 @@ static inline struct pn_sock *pn_sk(struct sock *sk)
46 46
47extern const struct proto_ops phonet_dgram_ops; 47extern const struct proto_ops phonet_dgram_ops;
48 48
49void pn_sock_init(void);
49struct sock *pn_find_sock_by_sa(struct net *net, const struct sockaddr_pn *sa); 50struct sock *pn_find_sock_by_sa(struct net *net, const struct sockaddr_pn *sa);
51void pn_deliver_sock_broadcast(struct net *net, struct sk_buff *skb);
50void phonet_get_local_port_range(int *min, int *max); 52void phonet_get_local_port_range(int *min, int *max);
51void pn_sock_hash(struct sock *sk); 53void pn_sock_hash(struct sock *sk);
52void pn_sock_unhash(struct sock *sk); 54void pn_sock_unhash(struct sock *sk);
diff --git a/include/net/phonet/pn_dev.h b/include/net/phonet/pn_dev.h
index 44c923c9e21d..d7b989ca3d63 100644
--- a/include/net/phonet/pn_dev.h
+++ b/include/net/phonet/pn_dev.h
@@ -25,7 +25,7 @@
25 25
26struct phonet_device_list { 26struct phonet_device_list {
27 struct list_head list; 27 struct list_head list;
28 spinlock_t lock; 28 struct mutex lock;
29}; 29};
30 30
31struct phonet_device_list *phonet_device_list(struct net *net); 31struct phonet_device_list *phonet_device_list(struct net *net);
@@ -47,6 +47,12 @@ u8 phonet_address_get(struct net_device *dev, u8 addr);
47int phonet_address_lookup(struct net *net, u8 addr); 47int phonet_address_lookup(struct net *net, u8 addr);
48void phonet_address_notify(int event, struct net_device *dev, u8 addr); 48void phonet_address_notify(int event, struct net_device *dev, u8 addr);
49 49
50int phonet_route_add(struct net_device *dev, u8 daddr);
51int phonet_route_del(struct net_device *dev, u8 daddr);
52void rtm_phonet_notify(int event, struct net_device *dev, u8 dst);
53struct net_device *phonet_route_get(struct net *net, u8 daddr);
54struct net_device *phonet_route_output(struct net *net, u8 daddr);
55
50#define PN_NO_ADDR 0xff 56#define PN_NO_ADDR 0xff
51 57
52extern const struct file_operations pn_sock_seq_fops; 58extern const struct file_operations pn_sock_seq_fops;
diff --git a/include/net/pkt_cls.h b/include/net/pkt_cls.h
index d1ca31444644..dd3031aed9d5 100644
--- a/include/net/pkt_cls.h
+++ b/include/net/pkt_cls.h
@@ -7,8 +7,7 @@
7 7
8/* Basic packet classifier frontend definitions. */ 8/* Basic packet classifier frontend definitions. */
9 9
10struct tcf_walker 10struct tcf_walker {
11{
12 int stop; 11 int stop;
13 int skip; 12 int skip;
14 int count; 13 int count;
@@ -61,8 +60,7 @@ tcf_unbind_filter(struct tcf_proto *tp, struct tcf_result *r)
61 tp->q->ops->cl_ops->unbind_tcf(tp->q, cl); 60 tp->q->ops->cl_ops->unbind_tcf(tp->q, cl);
62} 61}
63 62
64struct tcf_exts 63struct tcf_exts {
65{
66#ifdef CONFIG_NET_CLS_ACT 64#ifdef CONFIG_NET_CLS_ACT
67 struct tc_action *action; 65 struct tc_action *action;
68#endif 66#endif
@@ -71,8 +69,7 @@ struct tcf_exts
71/* Map to export classifier specific extension TLV types to the 69/* Map to export classifier specific extension TLV types to the
72 * generic extensions API. Unsupported extensions must be set to 0. 70 * generic extensions API. Unsupported extensions must be set to 0.
73 */ 71 */
74struct tcf_ext_map 72struct tcf_ext_map {
75{
76 int action; 73 int action;
77 int police; 74 int police;
78}; 75};
@@ -143,8 +140,7 @@ extern int tcf_exts_dump_stats(struct sk_buff *skb, struct tcf_exts *exts,
143/** 140/**
144 * struct tcf_pkt_info - packet information 141 * struct tcf_pkt_info - packet information
145 */ 142 */
146struct tcf_pkt_info 143struct tcf_pkt_info {
147{
148 unsigned char * ptr; 144 unsigned char * ptr;
149 int nexthdr; 145 int nexthdr;
150}; 146};
@@ -162,8 +158,7 @@ struct tcf_ematch_ops;
162 * @datalen: length of the ematch specific configuration data 158 * @datalen: length of the ematch specific configuration data
163 * @data: ematch specific data 159 * @data: ematch specific data
164 */ 160 */
165struct tcf_ematch 161struct tcf_ematch {
166{
167 struct tcf_ematch_ops * ops; 162 struct tcf_ematch_ops * ops;
168 unsigned long data; 163 unsigned long data;
169 unsigned int datalen; 164 unsigned int datalen;
@@ -211,8 +206,7 @@ static inline int tcf_em_early_end(struct tcf_ematch *em, int result)
211 * @hdr: ematch tree header supplied by userspace 206 * @hdr: ematch tree header supplied by userspace
212 * @matches: array of ematches 207 * @matches: array of ematches
213 */ 208 */
214struct tcf_ematch_tree 209struct tcf_ematch_tree {
215{
216 struct tcf_ematch_tree_hdr hdr; 210 struct tcf_ematch_tree_hdr hdr;
217 struct tcf_ematch * matches; 211 struct tcf_ematch * matches;
218 212
@@ -230,8 +224,7 @@ struct tcf_ematch_tree
230 * @owner: owner, must be set to THIS_MODULE 224 * @owner: owner, must be set to THIS_MODULE
231 * @link: link to previous/next ematch module (internal use) 225 * @link: link to previous/next ematch module (internal use)
232 */ 226 */
233struct tcf_ematch_ops 227struct tcf_ematch_ops {
234{
235 int kind; 228 int kind;
236 int datalen; 229 int datalen;
237 int (*change)(struct tcf_proto *, void *, 230 int (*change)(struct tcf_proto *, void *,
@@ -302,8 +295,7 @@ static inline int tcf_em_tree_match(struct sk_buff *skb,
302 295
303#else /* CONFIG_NET_EMATCH */ 296#else /* CONFIG_NET_EMATCH */
304 297
305struct tcf_ematch_tree 298struct tcf_ematch_tree {
306{
307}; 299};
308 300
309#define tcf_em_tree_validate(tp, tb, t) ((void)(t), 0) 301#define tcf_em_tree_validate(tp, tb, t) ((void)(t), 0)
@@ -351,9 +343,9 @@ tcf_match_indev(struct sk_buff *skb, char *indev)
351 struct net_device *dev; 343 struct net_device *dev;
352 344
353 if (indev[0]) { 345 if (indev[0]) {
354 if (!skb->iif) 346 if (!skb->skb_iif)
355 return 0; 347 return 0;
356 dev = __dev_get_by_index(dev_net(skb->dev), skb->iif); 348 dev = __dev_get_by_index(dev_net(skb->dev), skb->skb_iif);
357 if (!dev || strcmp(indev, dev->name)) 349 if (!dev || strcmp(indev, dev->name))
358 return 0; 350 return 0;
359 } 351 }
diff --git a/include/net/pkt_sched.h b/include/net/pkt_sched.h
index f911ec7598ef..2d567265363e 100644
--- a/include/net/pkt_sched.h
+++ b/include/net/pkt_sched.h
@@ -5,8 +5,7 @@
5#include <linux/ktime.h> 5#include <linux/ktime.h>
6#include <net/sch_generic.h> 6#include <net/sch_generic.h>
7 7
8struct qdisc_walker 8struct qdisc_walker {
9{
10 int stop; 9 int stop;
11 int skip; 10 int skip;
12 int count; 11 int count;
diff --git a/include/net/protocol.h b/include/net/protocol.h
index 60249e51b669..f1effdd3c265 100644
--- a/include/net/protocol.h
+++ b/include/net/protocol.h
@@ -47,8 +47,7 @@ struct net_protocol {
47}; 47};
48 48
49#if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE) 49#if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE)
50struct inet6_protocol 50struct inet6_protocol {
51{
52 int (*handler)(struct sk_buff *skb); 51 int (*handler)(struct sk_buff *skb);
53 52
54 void (*err_handler)(struct sk_buff *skb, 53 void (*err_handler)(struct sk_buff *skb,
@@ -83,10 +82,6 @@ struct inet_protosw {
83 struct proto *prot; 82 struct proto *prot;
84 const struct proto_ops *ops; 83 const struct proto_ops *ops;
85 84
86 int capability; /* Which (if any) capability do
87 * we need to use this socket
88 * interface?
89 */
90 char no_check; /* checksum on rcv/xmit/none? */ 85 char no_check; /* checksum on rcv/xmit/none? */
91 unsigned char flags; /* See INET_PROTOSW_* below. */ 86 unsigned char flags; /* See INET_PROTOSW_* below. */
92}; 87};
diff --git a/include/net/red.h b/include/net/red.h
index 3cf31d466a81..995108e54d9f 100644
--- a/include/net/red.h
+++ b/include/net/red.h
@@ -90,8 +90,7 @@
90#define RED_STAB_SIZE 256 90#define RED_STAB_SIZE 256
91#define RED_STAB_MASK (RED_STAB_SIZE - 1) 91#define RED_STAB_MASK (RED_STAB_SIZE - 1)
92 92
93struct red_stats 93struct red_stats {
94{
95 u32 prob_drop; /* Early probability drops */ 94 u32 prob_drop; /* Early probability drops */
96 u32 prob_mark; /* Early probability marks */ 95 u32 prob_mark; /* Early probability marks */
97 u32 forced_drop; /* Forced drops, qavg > max_thresh */ 96 u32 forced_drop; /* Forced drops, qavg > max_thresh */
@@ -101,8 +100,7 @@ struct red_stats
101 u32 backlog; 100 u32 backlog;
102}; 101};
103 102
104struct red_parms 103struct red_parms {
105{
106 /* Parameters */ 104 /* Parameters */
107 u32 qth_min; /* Min avg length threshold: A scaled */ 105 u32 qth_min; /* Min avg length threshold: A scaled */
108 u32 qth_max; /* Max avg length threshold: A scaled */ 106 u32 qth_max; /* Max avg length threshold: A scaled */
diff --git a/include/net/request_sock.h b/include/net/request_sock.h
index c7190846e128..c9b50ebd9ce9 100644
--- a/include/net/request_sock.h
+++ b/include/net/request_sock.h
@@ -27,13 +27,19 @@ struct sk_buff;
27struct dst_entry; 27struct dst_entry;
28struct proto; 28struct proto;
29 29
30/* empty to "strongly type" an otherwise void parameter.
31 */
32struct request_values {
33};
34
30struct request_sock_ops { 35struct request_sock_ops {
31 int family; 36 int family;
32 int obj_size; 37 int obj_size;
33 struct kmem_cache *slab; 38 struct kmem_cache *slab;
34 char *slab_name; 39 char *slab_name;
35 int (*rtx_syn_ack)(struct sock *sk, 40 int (*rtx_syn_ack)(struct sock *sk,
36 struct request_sock *req); 41 struct request_sock *req,
42 struct request_values *rvp);
37 void (*send_ack)(struct sock *sk, struct sk_buff *skb, 43 void (*send_ack)(struct sock *sk, struct sk_buff *skb,
38 struct request_sock *req); 44 struct request_sock *req);
39 void (*send_reset)(struct sock *sk, 45 void (*send_reset)(struct sock *sk,
diff --git a/include/net/route.h b/include/net/route.h
index 40f6346ef496..bce6dd68d27b 100644
--- a/include/net/route.h
+++ b/include/net/route.h
@@ -49,10 +49,8 @@
49 49
50struct fib_nh; 50struct fib_nh;
51struct inet_peer; 51struct inet_peer;
52struct rtable 52struct rtable {
53{ 53 union {
54 union
55 {
56 struct dst_entry dst; 54 struct dst_entry dst;
57 } u; 55 } u;
58 56
@@ -77,16 +75,14 @@ struct rtable
77 struct inet_peer *peer; /* long-living peer info */ 75 struct inet_peer *peer; /* long-living peer info */
78}; 76};
79 77
80struct ip_rt_acct 78struct ip_rt_acct {
81{
82 __u32 o_bytes; 79 __u32 o_bytes;
83 __u32 o_packets; 80 __u32 o_packets;
84 __u32 i_bytes; 81 __u32 i_bytes;
85 __u32 i_packets; 82 __u32 i_packets;
86}; 83};
87 84
88struct rt_cache_stat 85struct rt_cache_stat {
89{
90 unsigned int in_hit; 86 unsigned int in_hit;
91 unsigned int in_slow_tot; 87 unsigned int in_slow_tot;
92 unsigned int in_slow_mc; 88 unsigned int in_slow_mc;
@@ -112,6 +108,7 @@ extern int ip_rt_init(void);
112extern void ip_rt_redirect(__be32 old_gw, __be32 dst, __be32 new_gw, 108extern void ip_rt_redirect(__be32 old_gw, __be32 dst, __be32 new_gw,
113 __be32 src, struct net_device *dev); 109 __be32 src, struct net_device *dev);
114extern void rt_cache_flush(struct net *net, int how); 110extern void rt_cache_flush(struct net *net, int how);
111extern void rt_cache_flush_batch(void);
115extern int __ip_route_output_key(struct net *, struct rtable **, const struct flowi *flp); 112extern 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); 113extern 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); 114extern int ip_route_output_flow(struct net *, struct rtable **rp, struct flowi *flp, struct sock *sk, int flags);
diff --git a/include/net/rtnetlink.h b/include/net/rtnetlink.h
index c3aa044d3fc3..48d3efcb0880 100644
--- a/include/net/rtnetlink.h
+++ b/include/net/rtnetlink.h
@@ -55,13 +55,15 @@ struct rtnl_link_ops {
55 int (*validate)(struct nlattr *tb[], 55 int (*validate)(struct nlattr *tb[],
56 struct nlattr *data[]); 56 struct nlattr *data[]);
57 57
58 int (*newlink)(struct net_device *dev, 58 int (*newlink)(struct net *src_net,
59 struct net_device *dev,
59 struct nlattr *tb[], 60 struct nlattr *tb[],
60 struct nlattr *data[]); 61 struct nlattr *data[]);
61 int (*changelink)(struct net_device *dev, 62 int (*changelink)(struct net_device *dev,
62 struct nlattr *tb[], 63 struct nlattr *tb[],
63 struct nlattr *data[]); 64 struct nlattr *data[]);
64 void (*dellink)(struct net_device *dev); 65 void (*dellink)(struct net_device *dev,
66 struct list_head *head);
65 67
66 size_t (*get_size)(const struct net_device *dev); 68 size_t (*get_size)(const struct net_device *dev);
67 int (*fill_info)(struct sk_buff *skb, 69 int (*fill_info)(struct sk_buff *skb,
@@ -82,8 +84,9 @@ extern void rtnl_kill_links(struct net *net, struct rtnl_link_ops *ops);
82extern int rtnl_link_register(struct rtnl_link_ops *ops); 84extern int rtnl_link_register(struct rtnl_link_ops *ops);
83extern void rtnl_link_unregister(struct rtnl_link_ops *ops); 85extern void rtnl_link_unregister(struct rtnl_link_ops *ops);
84 86
85extern struct net_device *rtnl_create_link(struct net *net, char *ifname, 87extern struct net *rtnl_link_get_net(struct net *src_net, struct nlattr *tb[]);
86 const struct rtnl_link_ops *ops, struct nlattr *tb[]); 88extern struct net_device *rtnl_create_link(struct net *src_net, struct net *net,
89 char *ifname, const struct rtnl_link_ops *ops, struct nlattr *tb[]);
87extern const struct nla_policy ifla_policy[IFLA_MAX+1]; 90extern const struct nla_policy ifla_policy[IFLA_MAX+1];
88 91
89#define MODULE_ALIAS_RTNL_LINK(kind) MODULE_ALIAS("rtnl-link-" kind) 92#define MODULE_ALIAS_RTNL_LINK(kind) MODULE_ALIAS("rtnl-link-" kind)
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h
index c33180dd42b4..dad558bc06fa 100644
--- a/include/net/sch_generic.h
+++ b/include/net/sch_generic.h
@@ -15,16 +15,14 @@ struct qdisc_walker;
15struct tcf_walker; 15struct tcf_walker;
16struct module; 16struct module;
17 17
18struct qdisc_rate_table 18struct qdisc_rate_table {
19{
20 struct tc_ratespec rate; 19 struct tc_ratespec rate;
21 u32 data[256]; 20 u32 data[256];
22 struct qdisc_rate_table *next; 21 struct qdisc_rate_table *next;
23 int refcnt; 22 int refcnt;
24}; 23};
25 24
26enum qdisc_state_t 25enum qdisc_state_t {
27{
28 __QDISC_STATE_RUNNING, 26 __QDISC_STATE_RUNNING,
29 __QDISC_STATE_SCHED, 27 __QDISC_STATE_SCHED,
30 __QDISC_STATE_DEACTIVATED, 28 __QDISC_STATE_DEACTIVATED,
@@ -37,8 +35,7 @@ struct qdisc_size_table {
37 u16 data[]; 35 u16 data[];
38}; 36};
39 37
40struct Qdisc 38struct Qdisc {
41{
42 int (*enqueue)(struct sk_buff *skb, struct Qdisc *dev); 39 int (*enqueue)(struct sk_buff *skb, struct Qdisc *dev);
43 struct sk_buff * (*dequeue)(struct Qdisc *dev); 40 struct sk_buff * (*dequeue)(struct Qdisc *dev);
44 unsigned flags; 41 unsigned flags;
@@ -78,8 +75,7 @@ struct Qdisc
78 struct gnet_stats_queue qstats; 75 struct gnet_stats_queue qstats;
79}; 76};
80 77
81struct Qdisc_class_ops 78struct Qdisc_class_ops {
82{
83 /* Child qdisc manipulation */ 79 /* Child qdisc manipulation */
84 struct netdev_queue * (*select_queue)(struct Qdisc *, struct tcmsg *); 80 struct netdev_queue * (*select_queue)(struct Qdisc *, struct tcmsg *);
85 int (*graft)(struct Qdisc *, unsigned long cl, 81 int (*graft)(struct Qdisc *, unsigned long cl,
@@ -108,8 +104,7 @@ struct Qdisc_class_ops
108 struct gnet_dump *); 104 struct gnet_dump *);
109}; 105};
110 106
111struct Qdisc_ops 107struct Qdisc_ops {
112{
113 struct Qdisc_ops *next; 108 struct Qdisc_ops *next;
114 const struct Qdisc_class_ops *cl_ops; 109 const struct Qdisc_class_ops *cl_ops;
115 char id[IFNAMSIZ]; 110 char id[IFNAMSIZ];
@@ -133,14 +128,12 @@ struct Qdisc_ops
133}; 128};
134 129
135 130
136struct tcf_result 131struct tcf_result {
137{
138 unsigned long class; 132 unsigned long class;
139 u32 classid; 133 u32 classid;
140}; 134};
141 135
142struct tcf_proto_ops 136struct tcf_proto_ops {
143{
144 struct tcf_proto_ops *next; 137 struct tcf_proto_ops *next;
145 char kind[IFNAMSIZ]; 138 char kind[IFNAMSIZ];
146 139
@@ -164,8 +157,7 @@ struct tcf_proto_ops
164 struct module *owner; 157 struct module *owner;
165}; 158};
166 159
167struct tcf_proto 160struct tcf_proto {
168{
169 /* Fast access part */ 161 /* Fast access part */
170 struct tcf_proto *next; 162 struct tcf_proto *next;
171 void *root; 163 void *root;
@@ -261,14 +253,12 @@ extern struct Qdisc_ops noop_qdisc_ops;
261extern struct Qdisc_ops pfifo_fast_ops; 253extern struct Qdisc_ops pfifo_fast_ops;
262extern struct Qdisc_ops mq_qdisc_ops; 254extern struct Qdisc_ops mq_qdisc_ops;
263 255
264struct Qdisc_class_common 256struct Qdisc_class_common {
265{
266 u32 classid; 257 u32 classid;
267 struct hlist_node hnode; 258 struct hlist_node hnode;
268}; 259};
269 260
270struct Qdisc_class_hash 261struct Qdisc_class_hash {
271{
272 struct hlist_head *hash; 262 struct hlist_head *hash;
273 unsigned int hashsize; 263 unsigned int hashsize;
274 unsigned int hashmask; 264 unsigned int hashmask;
diff --git a/include/net/scm.h b/include/net/scm.h
index cf48c800e926..8360e47aa7e3 100644
--- a/include/net/scm.h
+++ b/include/net/scm.h
@@ -12,15 +12,13 @@
12 */ 12 */
13#define SCM_MAX_FD 255 13#define SCM_MAX_FD 255
14 14
15struct scm_fp_list 15struct scm_fp_list {
16{
17 struct list_head list; 16 struct list_head list;
18 int count; 17 int count;
19 struct file *fp[SCM_MAX_FD]; 18 struct file *fp[SCM_MAX_FD];
20}; 19};
21 20
22struct scm_cookie 21struct scm_cookie {
23{
24 struct ucred creds; /* Skb credentials */ 22 struct ucred creds; /* Skb credentials */
25 struct scm_fp_list *fp; /* Passed files */ 23 struct scm_fp_list *fp; /* Passed files */
26#ifdef CONFIG_SECURITY_NETWORK 24#ifdef CONFIG_SECURITY_NETWORK
@@ -88,8 +86,7 @@ static inline void scm_passec(struct socket *sock, struct msghdr *msg, struct sc
88static __inline__ void scm_recv(struct socket *sock, struct msghdr *msg, 86static __inline__ void scm_recv(struct socket *sock, struct msghdr *msg,
89 struct scm_cookie *scm, int flags) 87 struct scm_cookie *scm, int flags)
90{ 88{
91 if (!msg->msg_control) 89 if (!msg->msg_control) {
92 {
93 if (test_bit(SOCK_PASSCRED, &sock->flags) || scm->fp) 90 if (test_bit(SOCK_PASSCRED, &sock->flags) || scm->fp)
94 msg->msg_flags |= MSG_CTRUNC; 91 msg->msg_flags |= MSG_CTRUNC;
95 scm_destroy(scm); 92 scm_destroy(scm);
diff --git a/include/net/sctp/constants.h b/include/net/sctp/constants.h
index 58f714a3b670..63908840eef0 100644
--- a/include/net/sctp/constants.h
+++ b/include/net/sctp/constants.h
@@ -308,6 +308,10 @@ enum { SCTP_MAX_GABS = 16 };
308 308
309#define SCTP_DEFAULT_MINWINDOW 1500 /* default minimum rwnd size */ 309#define SCTP_DEFAULT_MINWINDOW 1500 /* default minimum rwnd size */
310#define SCTP_DEFAULT_MAXWINDOW 65535 /* default rwnd size */ 310#define SCTP_DEFAULT_MAXWINDOW 65535 /* default rwnd size */
311#define SCTP_DEFAULT_RWND_SHIFT 4 /* by default, update on 1/16 of
312 * rcvbuf, which is 1/8 of initial
313 * window
314 */
311#define SCTP_DEFAULT_MAXSEGMENT 1500 /* MTU size, this is the limit 315#define SCTP_DEFAULT_MAXSEGMENT 1500 /* MTU size, this is the limit
312 * to which we will raise the P-MTU. 316 * to which we will raise the P-MTU.
313 */ 317 */
diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h
index 8a6d5297de16..78740ec57d5d 100644
--- a/include/net/sctp/sctp.h
+++ b/include/net/sctp/sctp.h
@@ -227,8 +227,7 @@ DECLARE_SNMP_STAT(struct sctp_mib, sctp_statistics);
227#endif /* !TEST_FRAME */ 227#endif /* !TEST_FRAME */
228 228
229/* sctp mib definitions */ 229/* sctp mib definitions */
230enum 230enum {
231{
232 SCTP_MIB_NUM = 0, 231 SCTP_MIB_NUM = 0,
233 SCTP_MIB_CURRESTAB, /* CurrEstab */ 232 SCTP_MIB_CURRESTAB, /* CurrEstab */
234 SCTP_MIB_ACTIVEESTABS, /* ActiveEstabs */ 233 SCTP_MIB_ACTIVEESTABS, /* ActiveEstabs */
diff --git a/include/net/sctp/sm.h b/include/net/sctp/sm.h
index c1dd89365833..851c813adb3a 100644
--- a/include/net/sctp/sm.h
+++ b/include/net/sctp/sm.h
@@ -243,7 +243,8 @@ struct sctp_chunk *sctp_make_op_error(const struct sctp_association *,
243 const struct sctp_chunk *chunk, 243 const struct sctp_chunk *chunk,
244 __be16 cause_code, 244 __be16 cause_code,
245 const void *payload, 245 const void *payload,
246 size_t paylen); 246 size_t paylen,
247 size_t reserve_tail);
247 248
248struct sctp_chunk *sctp_make_asconf_update_ip(struct sctp_association *, 249struct sctp_chunk *sctp_make_asconf_update_ip(struct sctp_association *,
249 union sctp_addr *, 250 union sctp_addr *,
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h
index 0a474568b003..7571e32723bf 100644
--- a/include/net/sctp/structs.h
+++ b/include/net/sctp/structs.h
@@ -231,6 +231,11 @@ extern struct sctp_globals {
231 /* Flag to indicate whether computing and verifying checksum 231 /* Flag to indicate whether computing and verifying checksum
232 * is disabled. */ 232 * is disabled. */
233 int checksum_disable; 233 int checksum_disable;
234
235 /* Threshold for rwnd update SACKS. Receive buffer shifted this many
236 * bits is an indicator of when to send and window update SACK.
237 */
238 int rwnd_update_shift;
234} sctp_globals; 239} sctp_globals;
235 240
236#define sctp_rto_initial (sctp_globals.rto_initial) 241#define sctp_rto_initial (sctp_globals.rto_initial)
@@ -267,6 +272,7 @@ extern struct sctp_globals {
267#define sctp_prsctp_enable (sctp_globals.prsctp_enable) 272#define sctp_prsctp_enable (sctp_globals.prsctp_enable)
268#define sctp_auth_enable (sctp_globals.auth_enable) 273#define sctp_auth_enable (sctp_globals.auth_enable)
269#define sctp_checksum_disable (sctp_globals.checksum_disable) 274#define sctp_checksum_disable (sctp_globals.checksum_disable)
275#define sctp_rwnd_upd_shift (sctp_globals.rwnd_update_shift)
270 276
271/* SCTP Socket type: UDP or TCP style. */ 277/* SCTP Socket type: UDP or TCP style. */
272typedef enum { 278typedef enum {
@@ -935,6 +941,8 @@ struct sctp_transport {
935 /* Data that has been sent, but not acknowledged. */ 941 /* Data that has been sent, but not acknowledged. */
936 __u32 flight_size; 942 __u32 flight_size;
937 943
944 __u32 burst_limited; /* Holds old cwnd when max.burst is applied */
945
938 /* TSN marking the fast recovery exit point */ 946 /* TSN marking the fast recovery exit point */
939 __u32 fast_recovery_exit; 947 __u32 fast_recovery_exit;
940 948
@@ -943,12 +951,6 @@ struct sctp_transport {
943 /* Source address. */ 951 /* Source address. */
944 union sctp_addr saddr; 952 union sctp_addr saddr;
945 953
946 /* When was the last time(in jiffies) that a data packet was sent on
947 * this transport? This is used to adjust the cwnd when the transport
948 * becomes inactive.
949 */
950 unsigned long last_time_used;
951
952 /* Heartbeat interval: The endpoint sends out a Heartbeat chunk to 954 /* Heartbeat interval: The endpoint sends out a Heartbeat chunk to
953 * the destination address every heartbeat interval. 955 * the destination address every heartbeat interval.
954 */ 956 */
@@ -1069,6 +1071,8 @@ void sctp_transport_put(struct sctp_transport *);
1069void sctp_transport_update_rto(struct sctp_transport *, __u32); 1071void sctp_transport_update_rto(struct sctp_transport *, __u32);
1070void sctp_transport_raise_cwnd(struct sctp_transport *, __u32, __u32); 1072void sctp_transport_raise_cwnd(struct sctp_transport *, __u32, __u32);
1071void sctp_transport_lower_cwnd(struct sctp_transport *, sctp_lower_cwnd_t); 1073void sctp_transport_lower_cwnd(struct sctp_transport *, sctp_lower_cwnd_t);
1074void sctp_transport_burst_limited(struct sctp_transport *);
1075void sctp_transport_burst_reset(struct sctp_transport *);
1072unsigned long sctp_transport_timeout(struct sctp_transport *); 1076unsigned long sctp_transport_timeout(struct sctp_transport *);
1073void sctp_transport_reset(struct sctp_transport *); 1077void sctp_transport_reset(struct sctp_transport *);
1074void sctp_transport_update_pmtu(struct sctp_transport *, u32); 1078void sctp_transport_update_pmtu(struct sctp_transport *, u32);
diff --git a/include/net/sctp/user.h b/include/net/sctp/user.h
index be2334aaf52e..2b2769c5ca9f 100644
--- a/include/net/sctp/user.h
+++ b/include/net/sctp/user.h
@@ -60,96 +60,49 @@ typedef __s32 sctp_assoc_t;
60/* The following symbols come from the Sockets API Extensions for 60/* The following symbols come from the Sockets API Extensions for
61 * SCTP <draft-ietf-tsvwg-sctpsocket-07.txt>. 61 * SCTP <draft-ietf-tsvwg-sctpsocket-07.txt>.
62 */ 62 */
63enum sctp_optname { 63#define SCTP_RTOINFO 0
64 SCTP_RTOINFO, 64#define SCTP_ASSOCINFO 1
65#define SCTP_RTOINFO SCTP_RTOINFO 65#define SCTP_INITMSG 2
66 SCTP_ASSOCINFO, 66#define SCTP_NODELAY 3 /* Get/set nodelay option. */
67#define SCTP_ASSOCINFO SCTP_ASSOCINFO 67#define SCTP_AUTOCLOSE 4
68 SCTP_INITMSG, 68#define SCTP_SET_PEER_PRIMARY_ADDR 5
69#define SCTP_INITMSG SCTP_INITMSG 69#define SCTP_PRIMARY_ADDR 6
70 SCTP_NODELAY, /* Get/set nodelay option. */ 70#define SCTP_ADAPTATION_LAYER 7
71#define SCTP_NODELAY SCTP_NODELAY 71#define SCTP_DISABLE_FRAGMENTS 8
72 SCTP_AUTOCLOSE, 72#define SCTP_PEER_ADDR_PARAMS 9
73#define SCTP_AUTOCLOSE SCTP_AUTOCLOSE 73#define SCTP_DEFAULT_SEND_PARAM 10
74 SCTP_SET_PEER_PRIMARY_ADDR, 74#define SCTP_EVENTS 11
75#define SCTP_SET_PEER_PRIMARY_ADDR SCTP_SET_PEER_PRIMARY_ADDR 75#define SCTP_I_WANT_MAPPED_V4_ADDR 12 /* Turn on/off mapped v4 addresses */
76 SCTP_PRIMARY_ADDR, 76#define SCTP_MAXSEG 13 /* Get/set maximum fragment. */
77#define SCTP_PRIMARY_ADDR SCTP_PRIMARY_ADDR 77#define SCTP_STATUS 14
78 SCTP_ADAPTATION_LAYER, 78#define SCTP_GET_PEER_ADDR_INFO 15
79#define SCTP_ADAPTATION_LAYER SCTP_ADAPTATION_LAYER 79#define SCTP_DELAYED_ACK_TIME 16
80 SCTP_DISABLE_FRAGMENTS, 80#define SCTP_DELAYED_ACK SCTP_DELAYED_ACK_TIME
81#define SCTP_DISABLE_FRAGMENTS SCTP_DISABLE_FRAGMENTS 81#define SCTP_CONTEXT 17
82 SCTP_PEER_ADDR_PARAMS, 82#define SCTP_FRAGMENT_INTERLEAVE 18
83#define SCTP_PEER_ADDR_PARAMS SCTP_PEER_ADDR_PARAMS 83#define SCTP_PARTIAL_DELIVERY_POINT 19 /* Set/Get partial delivery point */
84 SCTP_DEFAULT_SEND_PARAM, 84#define SCTP_MAX_BURST 20 /* Set/Get max burst */
85#define SCTP_DEFAULT_SEND_PARAM SCTP_DEFAULT_SEND_PARAM 85#define SCTP_AUTH_CHUNK 21 /* Set only: add a chunk type to authenticate */
86 SCTP_EVENTS, 86#define SCTP_HMAC_IDENT 22
87#define SCTP_EVENTS SCTP_EVENTS 87#define SCTP_AUTH_KEY 23
88 SCTP_I_WANT_MAPPED_V4_ADDR, /* Turn on/off mapped v4 addresses */ 88#define SCTP_AUTH_ACTIVE_KEY 24
89#define SCTP_I_WANT_MAPPED_V4_ADDR SCTP_I_WANT_MAPPED_V4_ADDR 89#define SCTP_AUTH_DELETE_KEY 25
90 SCTP_MAXSEG, /* Get/set maximum fragment. */ 90#define SCTP_PEER_AUTH_CHUNKS 26 /* Read only */
91#define SCTP_MAXSEG SCTP_MAXSEG 91#define SCTP_LOCAL_AUTH_CHUNKS 27 /* Read only */
92 SCTP_STATUS, 92#define SCTP_GET_ASSOC_NUMBER 28 /* Read only */
93#define SCTP_STATUS SCTP_STATUS 93
94 SCTP_GET_PEER_ADDR_INFO, 94/* Internal Socket Options. Some of the sctp library functions are
95#define SCTP_GET_PEER_ADDR_INFO SCTP_GET_PEER_ADDR_INFO 95 * implemented using these socket options.
96 SCTP_DELAYED_ACK, 96 */
97#define SCTP_DELAYED_ACK_TIME SCTP_DELAYED_ACK 97#define SCTP_SOCKOPT_BINDX_ADD 100 /* BINDX requests for adding addrs */
98#define SCTP_DELAYED_ACK SCTP_DELAYED_ACK 98#define SCTP_SOCKOPT_BINDX_REM 101 /* BINDX requests for removing addrs. */
99 SCTP_CONTEXT, /* Receive Context */ 99#define SCTP_SOCKOPT_PEELOFF 102 /* peel off association. */
100#define SCTP_CONTEXT SCTP_CONTEXT 100/* Options 104-106 are deprecated and removed. Do not use this space */
101 SCTP_FRAGMENT_INTERLEAVE, 101#define SCTP_SOCKOPT_CONNECTX_OLD 107 /* CONNECTX old requests. */
102#define SCTP_FRAGMENT_INTERLEAVE SCTP_FRAGMENT_INTERLEAVE 102#define SCTP_GET_PEER_ADDRS 108 /* Get all peer addresss. */
103 SCTP_PARTIAL_DELIVERY_POINT, /* Set/Get partial delivery point */ 103#define SCTP_GET_LOCAL_ADDRS 109 /* Get all local addresss. */
104#define SCTP_PARTIAL_DELIVERY_POINT SCTP_PARTIAL_DELIVERY_POINT 104#define SCTP_SOCKOPT_CONNECTX 110 /* CONNECTX requests. */
105 SCTP_MAX_BURST, /* Set/Get max burst */ 105#define SCTP_SOCKOPT_CONNECTX3 111 /* CONNECTX requests (updated) */
106#define SCTP_MAX_BURST SCTP_MAX_BURST
107 SCTP_AUTH_CHUNK, /* Set only: add a chunk type to authenticat */
108#define SCTP_AUTH_CHUNK SCTP_AUTH_CHUNK
109 SCTP_HMAC_IDENT,
110#define SCTP_HMAC_IDENT SCTP_HMAC_IDENT
111 SCTP_AUTH_KEY,
112#define SCTP_AUTH_KEY SCTP_AUTH_KEY
113 SCTP_AUTH_ACTIVE_KEY,
114#define SCTP_AUTH_ACTIVE_KEY SCTP_AUTH_ACTIVE_KEY
115 SCTP_AUTH_DELETE_KEY,
116#define SCTP_AUTH_DELETE_KEY SCTP_AUTH_DELETE_KEY
117 SCTP_PEER_AUTH_CHUNKS, /* Read only */
118#define SCTP_PEER_AUTH_CHUNKS SCTP_PEER_AUTH_CHUNKS
119 SCTP_LOCAL_AUTH_CHUNKS, /* Read only */
120#define SCTP_LOCAL_AUTH_CHUNKS SCTP_LOCAL_AUTH_CHUNKS
121 SCTP_GET_ASSOC_NUMBER, /* Read only */
122#define SCTP_GET_ASSOC_NUMBER SCTP_GET_ASSOC_NUMBER
123
124
125 /* Internal Socket Options. Some of the sctp library functions are
126 * implemented using these socket options.
127 */
128 SCTP_SOCKOPT_BINDX_ADD = 100,/* BINDX requests for adding addresses. */
129#define SCTP_SOCKOPT_BINDX_ADD SCTP_SOCKOPT_BINDX_ADD
130 SCTP_SOCKOPT_BINDX_REM, /* BINDX requests for removing addresses. */
131#define SCTP_SOCKOPT_BINDX_REM SCTP_SOCKOPT_BINDX_REM
132 SCTP_SOCKOPT_PEELOFF, /* peel off association. */
133#define SCTP_SOCKOPT_PEELOFF SCTP_SOCKOPT_PEELOFF
134 SCTP_GET_PEER_ADDRS_NUM_OLD, /* Get number of peer addresss. */
135#define SCTP_GET_PEER_ADDRS_NUM_OLD SCTP_GET_PEER_ADDRS_NUM_OLD
136 SCTP_GET_PEER_ADDRS_OLD, /* Get all peer addresss. */
137#define SCTP_GET_PEER_ADDRS_OLD SCTP_GET_PEER_ADDRS_OLD
138 SCTP_GET_LOCAL_ADDRS_NUM_OLD, /* Get number of local addresss. */
139#define SCTP_GET_LOCAL_ADDRS_NUM_OLD SCTP_GET_LOCAL_ADDRS_NUM_OLD
140 SCTP_GET_LOCAL_ADDRS_OLD, /* Get all local addresss. */
141#define SCTP_GET_LOCAL_ADDRS_OLD SCTP_GET_LOCAL_ADDRS_OLD
142 SCTP_SOCKOPT_CONNECTX_OLD, /* CONNECTX old requests. */
143#define SCTP_SOCKOPT_CONNECTX_OLD SCTP_SOCKOPT_CONNECTX_OLD
144 SCTP_GET_PEER_ADDRS, /* Get all peer addresss. */
145#define SCTP_GET_PEER_ADDRS SCTP_GET_PEER_ADDRS
146 SCTP_GET_LOCAL_ADDRS, /* Get all local addresss. */
147#define SCTP_GET_LOCAL_ADDRS SCTP_GET_LOCAL_ADDRS
148 SCTP_SOCKOPT_CONNECTX, /* CONNECTX requests. */
149#define SCTP_SOCKOPT_CONNECTX SCTP_SOCKOPT_CONNECTX
150 SCTP_SOCKOPT_CONNECTX3, /* CONNECTX requests. (new implementation) */
151#define SCTP_SOCKOPT_CONNECTX3 SCTP_SOCKOPT_CONNECTX3
152};
153 106
154/* 107/*
155 * 5.2.1 SCTP Initiation Structure (SCTP_INIT) 108 * 5.2.1 SCTP Initiation Structure (SCTP_INIT)
@@ -206,6 +159,7 @@ enum sctp_sinfo_flags {
206 SCTP_UNORDERED = 1, /* Send/receive message unordered. */ 159 SCTP_UNORDERED = 1, /* Send/receive message unordered. */
207 SCTP_ADDR_OVER = 2, /* Override the primary destination. */ 160 SCTP_ADDR_OVER = 2, /* Override the primary destination. */
208 SCTP_ABORT=4, /* Send an ABORT message to the peer. */ 161 SCTP_ABORT=4, /* Send an ABORT message to the peer. */
162 SCTP_SACK_IMMEDIATELY = 8, /* SACK should be sent without delay */
209 SCTP_EOF=MSG_FIN, /* Initiate graceful shutdown process. */ 163 SCTP_EOF=MSG_FIN, /* Initiate graceful shutdown process. */
210}; 164};
211 165
diff --git a/include/net/sock.h b/include/net/sock.h
index 9f96394f694e..3f1a4804bb3f 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -105,14 +105,17 @@ struct net;
105/** 105/**
106 * struct sock_common - minimal network layer representation of sockets 106 * struct sock_common - minimal network layer representation of sockets
107 * @skc_node: main hash linkage for various protocol lookup tables 107 * @skc_node: main hash linkage for various protocol lookup tables
108 * @skc_nulls_node: main hash linkage for UDP/UDP-Lite protocol 108 * @skc_nulls_node: main hash linkage for TCP/UDP/UDP-Lite protocol
109 * @skc_refcnt: reference count 109 * @skc_refcnt: reference count
110 * @skc_tx_queue_mapping: tx queue number for this connection
110 * @skc_hash: hash value used with various protocol lookup tables 111 * @skc_hash: hash value used with various protocol lookup tables
112 * @skc_u16hashes: two u16 hash values used by UDP lookup tables
111 * @skc_family: network address family 113 * @skc_family: network address family
112 * @skc_state: Connection state 114 * @skc_state: Connection state
113 * @skc_reuse: %SO_REUSEADDR setting 115 * @skc_reuse: %SO_REUSEADDR setting
114 * @skc_bound_dev_if: bound device index if != 0 116 * @skc_bound_dev_if: bound device index if != 0
115 * @skc_bind_node: bind hash linkage for various protocol lookup tables 117 * @skc_bind_node: bind hash linkage for various protocol lookup tables
118 * @skc_portaddr_node: second hash linkage for UDP/UDP-Lite protocol
116 * @skc_prot: protocol handlers inside a network family 119 * @skc_prot: protocol handlers inside a network family
117 * @skc_net: reference to the network namespace of this socket 120 * @skc_net: reference to the network namespace of this socket
118 * 121 *
@@ -128,13 +131,20 @@ struct sock_common {
128 struct hlist_nulls_node skc_nulls_node; 131 struct hlist_nulls_node skc_nulls_node;
129 }; 132 };
130 atomic_t skc_refcnt; 133 atomic_t skc_refcnt;
134 int skc_tx_queue_mapping;
131 135
132 unsigned int skc_hash; 136 union {
137 unsigned int skc_hash;
138 __u16 skc_u16hashes[2];
139 };
133 unsigned short skc_family; 140 unsigned short skc_family;
134 volatile unsigned char skc_state; 141 volatile unsigned char skc_state;
135 unsigned char skc_reuse; 142 unsigned char skc_reuse;
136 int skc_bound_dev_if; 143 int skc_bound_dev_if;
137 struct hlist_node skc_bind_node; 144 union {
145 struct hlist_node skc_bind_node;
146 struct hlist_nulls_node skc_portaddr_node;
147 };
138 struct proto *skc_prot; 148 struct proto *skc_prot;
139#ifdef CONFIG_NET_NS 149#ifdef CONFIG_NET_NS
140 struct net *skc_net; 150 struct net *skc_net;
@@ -215,6 +225,7 @@ struct sock {
215#define sk_node __sk_common.skc_node 225#define sk_node __sk_common.skc_node
216#define sk_nulls_node __sk_common.skc_nulls_node 226#define sk_nulls_node __sk_common.skc_nulls_node
217#define sk_refcnt __sk_common.skc_refcnt 227#define sk_refcnt __sk_common.skc_refcnt
228#define sk_tx_queue_mapping __sk_common.skc_tx_queue_mapping
218 229
219#define sk_copy_start __sk_common.skc_hash 230#define sk_copy_start __sk_common.skc_hash
220#define sk_hash __sk_common.skc_hash 231#define sk_hash __sk_common.skc_hash
@@ -504,6 +515,8 @@ enum sock_flags {
504 SOCK_TIMESTAMPING_SOFTWARE, /* %SOF_TIMESTAMPING_SOFTWARE */ 515 SOCK_TIMESTAMPING_SOFTWARE, /* %SOF_TIMESTAMPING_SOFTWARE */
505 SOCK_TIMESTAMPING_RAW_HARDWARE, /* %SOF_TIMESTAMPING_RAW_HARDWARE */ 516 SOCK_TIMESTAMPING_RAW_HARDWARE, /* %SOF_TIMESTAMPING_RAW_HARDWARE */
506 SOCK_TIMESTAMPING_SYS_HARDWARE, /* %SOF_TIMESTAMPING_SYS_HARDWARE */ 517 SOCK_TIMESTAMPING_SYS_HARDWARE, /* %SOF_TIMESTAMPING_SYS_HARDWARE */
518 SOCK_FASYNC, /* fasync() active */
519 SOCK_RXQ_OVFL,
507}; 520};
508 521
509static inline void sock_copy_flags(struct sock *nsk, struct sock *osk) 522static inline void sock_copy_flags(struct sock *nsk, struct sock *osk)
@@ -1092,8 +1105,29 @@ static inline void sock_put(struct sock *sk)
1092extern int sk_receive_skb(struct sock *sk, struct sk_buff *skb, 1105extern int sk_receive_skb(struct sock *sk, struct sk_buff *skb,
1093 const int nested); 1106 const int nested);
1094 1107
1108static inline void sk_tx_queue_set(struct sock *sk, int tx_queue)
1109{
1110 sk->sk_tx_queue_mapping = tx_queue;
1111}
1112
1113static inline void sk_tx_queue_clear(struct sock *sk)
1114{
1115 sk->sk_tx_queue_mapping = -1;
1116}
1117
1118static inline int sk_tx_queue_get(const struct sock *sk)
1119{
1120 return sk->sk_tx_queue_mapping;
1121}
1122
1123static inline bool sk_tx_queue_recorded(const struct sock *sk)
1124{
1125 return (sk && sk->sk_tx_queue_mapping >= 0);
1126}
1127
1095static inline void sk_set_socket(struct sock *sk, struct socket *sock) 1128static inline void sk_set_socket(struct sock *sk, struct socket *sock)
1096{ 1129{
1130 sk_tx_queue_clear(sk);
1097 sk->sk_socket = sock; 1131 sk->sk_socket = sock;
1098} 1132}
1099 1133
@@ -1150,6 +1184,7 @@ __sk_dst_set(struct sock *sk, struct dst_entry *dst)
1150{ 1184{
1151 struct dst_entry *old_dst; 1185 struct dst_entry *old_dst;
1152 1186
1187 sk_tx_queue_clear(sk);
1153 old_dst = sk->sk_dst_cache; 1188 old_dst = sk->sk_dst_cache;
1154 sk->sk_dst_cache = dst; 1189 sk->sk_dst_cache = dst;
1155 dst_release(old_dst); 1190 dst_release(old_dst);
@@ -1168,6 +1203,7 @@ __sk_dst_reset(struct sock *sk)
1168{ 1203{
1169 struct dst_entry *old_dst; 1204 struct dst_entry *old_dst;
1170 1205
1206 sk_tx_queue_clear(sk);
1171 old_dst = sk->sk_dst_cache; 1207 old_dst = sk->sk_dst_cache;
1172 sk->sk_dst_cache = NULL; 1208 sk->sk_dst_cache = NULL;
1173 dst_release(old_dst); 1209 dst_release(old_dst);
@@ -1396,7 +1432,7 @@ static inline unsigned long sock_wspace(struct sock *sk)
1396 1432
1397static inline void sk_wake_async(struct sock *sk, int how, int band) 1433static inline void sk_wake_async(struct sock *sk, int how, int band)
1398{ 1434{
1399 if (sk->sk_socket && sk->sk_socket->fasync_list) 1435 if (sock_flag(sk, SOCK_FASYNC))
1400 sock_wake_async(sk->sk_socket, how, band); 1436 sock_wake_async(sk->sk_socket, how, band);
1401} 1437}
1402 1438
@@ -1492,6 +1528,8 @@ sock_recv_timestamp(struct msghdr *msg, struct sock *sk, struct sk_buff *skb)
1492 sk->sk_stamp = kt; 1528 sk->sk_stamp = kt;
1493} 1529}
1494 1530
1531extern void sock_recv_ts_and_drops(struct msghdr *msg, struct sock *sk, struct sk_buff *skb);
1532
1495/** 1533/**
1496 * sock_tx_timestamp - checks whether the outgoing packet is to be time stamped 1534 * sock_tx_timestamp - checks whether the outgoing packet is to be time stamped
1497 * @msg: outgoing packet 1535 * @msg: outgoing packet
diff --git a/include/net/tc_act/tc_skbedit.h b/include/net/tc_act/tc_skbedit.h
index 6abb3ed3ebf7..e103fe02f375 100644
--- a/include/net/tc_act/tc_skbedit.h
+++ b/include/net/tc_act/tc_skbedit.h
@@ -26,7 +26,9 @@ struct tcf_skbedit {
26 struct tcf_common common; 26 struct tcf_common common;
27 u32 flags; 27 u32 flags;
28 u32 priority; 28 u32 priority;
29 u32 mark;
29 u16 queue_mapping; 30 u16 queue_mapping;
31 /* XXX: 16-bit pad here? */
30}; 32};
31#define to_skbedit(pc) \ 33#define to_skbedit(pc) \
32 container_of(pc, struct tcf_skbedit, common) 34 container_of(pc, struct tcf_skbedit, common)
diff --git a/include/net/tcp.h b/include/net/tcp.h
index 03a49c703377..e2d2ca2509be 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -30,6 +30,7 @@
30#include <linux/dmaengine.h> 30#include <linux/dmaengine.h>
31#include <linux/crypto.h> 31#include <linux/crypto.h>
32#include <linux/cryptohash.h> 32#include <linux/cryptohash.h>
33#include <linux/kref.h>
33 34
34#include <net/inet_connection_sock.h> 35#include <net/inet_connection_sock.h>
35#include <net/inet_timewait_sock.h> 36#include <net/inet_timewait_sock.h>
@@ -62,9 +63,6 @@ extern void tcp_time_wait(struct sock *sk, int state, int timeo);
62/* Minimal accepted MSS. It is (60+60+8) - (20+20). */ 63/* Minimal accepted MSS. It is (60+60+8) - (20+20). */
63#define TCP_MIN_MSS 88U 64#define TCP_MIN_MSS 88U
64 65
65/* Minimal RCV_MSS. */
66#define TCP_MIN_RCVMSS 536U
67
68/* The least MTU to use for probing */ 66/* The least MTU to use for probing */
69#define TCP_BASE_MSS 512 67#define TCP_BASE_MSS 512
70 68
@@ -167,6 +165,7 @@ extern void tcp_time_wait(struct sock *sk, int state, int timeo);
167#define TCPOPT_SACK 5 /* SACK Block */ 165#define TCPOPT_SACK 5 /* SACK Block */
168#define TCPOPT_TIMESTAMP 8 /* Better RTT estimations/PAWS */ 166#define TCPOPT_TIMESTAMP 8 /* Better RTT estimations/PAWS */
169#define TCPOPT_MD5SIG 19 /* MD5 Signature (RFC2385) */ 167#define TCPOPT_MD5SIG 19 /* MD5 Signature (RFC2385) */
168#define TCPOPT_COOKIE 253 /* Cookie extension (experimental) */
170 169
171/* 170/*
172 * TCP option lengths 171 * TCP option lengths
@@ -177,6 +176,10 @@ extern void tcp_time_wait(struct sock *sk, int state, int timeo);
177#define TCPOLEN_SACK_PERM 2 176#define TCPOLEN_SACK_PERM 2
178#define TCPOLEN_TIMESTAMP 10 177#define TCPOLEN_TIMESTAMP 10
179#define TCPOLEN_MD5SIG 18 178#define TCPOLEN_MD5SIG 18
179#define TCPOLEN_COOKIE_BASE 2 /* Cookie-less header extension */
180#define TCPOLEN_COOKIE_PAIR 3 /* Cookie pair header extension */
181#define TCPOLEN_COOKIE_MIN (TCPOLEN_COOKIE_BASE+TCP_COOKIE_MIN)
182#define TCPOLEN_COOKIE_MAX (TCPOLEN_COOKIE_BASE+TCP_COOKIE_MAX)
180 183
181/* But this is what stacks really send out. */ 184/* But this is what stacks really send out. */
182#define TCPOLEN_TSTAMP_ALIGNED 12 185#define TCPOLEN_TSTAMP_ALIGNED 12
@@ -237,6 +240,7 @@ extern int sysctl_tcp_base_mss;
237extern int sysctl_tcp_workaround_signed_windows; 240extern int sysctl_tcp_workaround_signed_windows;
238extern int sysctl_tcp_slow_start_after_idle; 241extern int sysctl_tcp_slow_start_after_idle;
239extern int sysctl_tcp_max_ssthresh; 242extern int sysctl_tcp_max_ssthresh;
243extern int sysctl_tcp_cookie_size;
240 244
241extern atomic_t tcp_memory_allocated; 245extern atomic_t tcp_memory_allocated;
242extern struct percpu_counter tcp_sockets_allocated; 246extern struct percpu_counter tcp_sockets_allocated;
@@ -343,11 +347,6 @@ static inline void tcp_dec_quickack_mode(struct sock *sk,
343 347
344extern void tcp_enter_quickack_mode(struct sock *sk); 348extern void tcp_enter_quickack_mode(struct sock *sk);
345 349
346static inline void tcp_clear_options(struct tcp_options_received *rx_opt)
347{
348 rx_opt->tstamp_ok = rx_opt->sack_ok = rx_opt->wscale_ok = rx_opt->snd_wscale = 0;
349}
350
351#define TCP_ECN_OK 1 350#define TCP_ECN_OK 1
352#define TCP_ECN_QUEUE_CWR 2 351#define TCP_ECN_QUEUE_CWR 2
353#define TCP_ECN_DEMAND_CWR 4 352#define TCP_ECN_DEMAND_CWR 4
@@ -359,8 +358,7 @@ TCP_ECN_create_request(struct request_sock *req, struct tcphdr *th)
359 inet_rsk(req)->ecn_ok = 1; 358 inet_rsk(req)->ecn_ok = 1;
360} 359}
361 360
362enum tcp_tw_status 361enum tcp_tw_status {
363{
364 TCP_TW_SUCCESS = 0, 362 TCP_TW_SUCCESS = 0,
365 TCP_TW_RST = 1, 363 TCP_TW_RST = 1,
366 TCP_TW_ACK = 2, 364 TCP_TW_ACK = 2,
@@ -409,7 +407,9 @@ extern int tcp_recvmsg(struct kiocb *iocb, struct sock *sk,
409 407
410extern void tcp_parse_options(struct sk_buff *skb, 408extern void tcp_parse_options(struct sk_buff *skb,
411 struct tcp_options_received *opt_rx, 409 struct tcp_options_received *opt_rx,
412 int estab); 410 u8 **hvpp,
411 int estab,
412 struct dst_entry *dst);
413 413
414extern u8 *tcp_parse_md5sig_option(struct tcphdr *th); 414extern u8 *tcp_parse_md5sig_option(struct tcphdr *th);
415 415
@@ -443,7 +443,8 @@ extern int tcp_connect(struct sock *sk);
443 443
444extern struct sk_buff * tcp_make_synack(struct sock *sk, 444extern struct sk_buff * tcp_make_synack(struct sock *sk,
445 struct dst_entry *dst, 445 struct dst_entry *dst,
446 struct request_sock *req); 446 struct request_sock *req,
447 struct request_values *rvp);
447 448
448extern int tcp_disconnect(struct sock *sk, int flags); 449extern int tcp_disconnect(struct sock *sk, int flags);
449 450
@@ -1228,6 +1229,7 @@ static inline void tcp_write_queue_purge(struct sock *sk)
1228 while ((skb = __skb_dequeue(&sk->sk_write_queue)) != NULL) 1229 while ((skb = __skb_dequeue(&sk->sk_write_queue)) != NULL)
1229 sk_wmem_free_skb(sk, skb); 1230 sk_wmem_free_skb(sk, skb);
1230 sk_mem_reclaim(sk); 1231 sk_mem_reclaim(sk);
1232 tcp_clear_all_retrans_hints(tcp_sk(sk));
1231} 1233}
1232 1234
1233static inline struct sk_buff *tcp_write_queue_head(struct sock *sk) 1235static inline struct sk_buff *tcp_write_queue_head(struct sock *sk)
@@ -1480,6 +1482,91 @@ struct tcp_request_sock_ops {
1480#endif 1482#endif
1481}; 1483};
1482 1484
1485/* Using SHA1 for now, define some constants.
1486 */
1487#define COOKIE_DIGEST_WORDS (SHA_DIGEST_WORDS)
1488#define COOKIE_MESSAGE_WORDS (SHA_MESSAGE_BYTES / 4)
1489#define COOKIE_WORKSPACE_WORDS (COOKIE_DIGEST_WORDS + COOKIE_MESSAGE_WORDS)
1490
1491extern int tcp_cookie_generator(u32 *bakery);
1492
1493/**
1494 * struct tcp_cookie_values - each socket needs extra space for the
1495 * cookies, together with (optional) space for any SYN data.
1496 *
1497 * A tcp_sock contains a pointer to the current value, and this is
1498 * cloned to the tcp_timewait_sock.
1499 *
1500 * @cookie_pair: variable data from the option exchange.
1501 *
1502 * @cookie_desired: user specified tcpct_cookie_desired. Zero
1503 * indicates default (sysctl_tcp_cookie_size).
1504 * After cookie sent, remembers size of cookie.
1505 * Range 0, TCP_COOKIE_MIN to TCP_COOKIE_MAX.
1506 *
1507 * @s_data_desired: user specified tcpct_s_data_desired. When the
1508 * constant payload is specified (@s_data_constant),
1509 * holds its length instead.
1510 * Range 0 to TCP_MSS_DESIRED.
1511 *
1512 * @s_data_payload: constant data that is to be included in the
1513 * payload of SYN or SYNACK segments when the
1514 * cookie option is present.
1515 */
1516struct tcp_cookie_values {
1517 struct kref kref;
1518 u8 cookie_pair[TCP_COOKIE_PAIR_SIZE];
1519 u8 cookie_pair_size;
1520 u8 cookie_desired;
1521 u16 s_data_desired:11,
1522 s_data_constant:1,
1523 s_data_in:1,
1524 s_data_out:1,
1525 s_data_unused:2;
1526 u8 s_data_payload[0];
1527};
1528
1529static inline void tcp_cookie_values_release(struct kref *kref)
1530{
1531 kfree(container_of(kref, struct tcp_cookie_values, kref));
1532}
1533
1534/* The length of constant payload data. Note that s_data_desired is
1535 * overloaded, depending on s_data_constant: either the length of constant
1536 * data (returned here) or the limit on variable data.
1537 */
1538static inline int tcp_s_data_size(const struct tcp_sock *tp)
1539{
1540 return (tp->cookie_values != NULL && tp->cookie_values->s_data_constant)
1541 ? tp->cookie_values->s_data_desired
1542 : 0;
1543}
1544
1545/**
1546 * struct tcp_extend_values - tcp_ipv?.c to tcp_output.c workspace.
1547 *
1548 * As tcp_request_sock has already been extended in other places, the
1549 * only remaining method is to pass stack values along as function
1550 * parameters. These parameters are not needed after sending SYNACK.
1551 *
1552 * @cookie_bakery: cryptographic secret and message workspace.
1553 *
1554 * @cookie_plus: bytes in authenticator/cookie option, copied from
1555 * struct tcp_options_received (above).
1556 */
1557struct tcp_extend_values {
1558 struct request_values rv;
1559 u32 cookie_bakery[COOKIE_WORKSPACE_WORDS];
1560 u8 cookie_plus:6,
1561 cookie_out_never:1,
1562 cookie_in_always:1;
1563};
1564
1565static inline struct tcp_extend_values *tcp_xv(struct request_values *rvp)
1566{
1567 return (struct tcp_extend_values *)rvp;
1568}
1569
1483extern void tcp_v4_init(void); 1570extern void tcp_v4_init(void);
1484extern void tcp_init(void); 1571extern void tcp_init(void);
1485 1572
diff --git a/include/net/udp.h b/include/net/udp.h
index f98abd2ce709..5348d80b25bb 100644
--- a/include/net/udp.h
+++ b/include/net/udp.h
@@ -50,16 +50,49 @@ struct udp_skb_cb {
50}; 50};
51#define UDP_SKB_CB(__skb) ((struct udp_skb_cb *)((__skb)->cb)) 51#define UDP_SKB_CB(__skb) ((struct udp_skb_cb *)((__skb)->cb))
52 52
53/**
54 * struct udp_hslot - UDP hash slot
55 *
56 * @head: head of list of sockets
57 * @count: number of sockets in 'head' list
58 * @lock: spinlock protecting changes to head/count
59 */
53struct udp_hslot { 60struct udp_hslot {
54 struct hlist_nulls_head head; 61 struct hlist_nulls_head head;
62 int count;
55 spinlock_t lock; 63 spinlock_t lock;
56} __attribute__((aligned(2 * sizeof(long)))); 64} __attribute__((aligned(2 * sizeof(long))));
65
66/**
67 * struct udp_table - UDP table
68 *
69 * @hash: hash table, sockets are hashed on (local port)
70 * @hash2: hash table, sockets are hashed on (local port, local address)
71 * @mask: number of slots in hash tables, minus 1
72 * @log: log2(number of slots in hash table)
73 */
57struct udp_table { 74struct udp_table {
58 struct udp_hslot hash[UDP_HTABLE_SIZE]; 75 struct udp_hslot *hash;
76 struct udp_hslot *hash2;
77 unsigned int mask;
78 unsigned int log;
59}; 79};
60extern struct udp_table udp_table; 80extern struct udp_table udp_table;
61extern void udp_table_init(struct udp_table *); 81extern void udp_table_init(struct udp_table *, const char *);
62 82static inline struct udp_hslot *udp_hashslot(struct udp_table *table,
83 struct net *net, unsigned num)
84{
85 return &table->hash[udp_hashfn(net, num, table->mask)];
86}
87/*
88 * For secondary hash, net_hash_mix() is performed before calling
89 * udp_hashslot2(), this explains difference with udp_hashslot()
90 */
91static inline struct udp_hslot *udp_hashslot2(struct udp_table *table,
92 unsigned int hash)
93{
94 return &table->hash2[hash & table->mask];
95}
63 96
64/* Note: this must match 'valbool' in sock_setsockopt */ 97/* Note: this must match 'valbool' in sock_setsockopt */
65#define UDP_CSUM_NOXMIT 1 98#define UDP_CSUM_NOXMIT 1
@@ -125,7 +158,8 @@ static inline void udp_lib_close(struct sock *sk, long timeout)
125} 158}
126 159
127extern int udp_lib_get_port(struct sock *sk, unsigned short snum, 160extern int udp_lib_get_port(struct sock *sk, unsigned short snum,
128 int (*)(const struct sock*,const struct sock*)); 161 int (*)(const struct sock *,const struct sock *),
162 unsigned int hash2_nulladdr);
129 163
130/* net/ipv4/udp.c */ 164/* net/ipv4/udp.c */
131extern int udp_get_port(struct sock *sk, unsigned short snum, 165extern int udp_get_port(struct sock *sk, unsigned short snum,
diff --git a/include/net/wext.h b/include/net/wext.h
index 3f2b94de2cfa..4f6e7423174c 100644
--- a/include/net/wext.h
+++ b/include/net/wext.h
@@ -1,29 +1,19 @@
1#ifndef __NET_WEXT_H 1#ifndef __NET_WEXT_H
2#define __NET_WEXT_H 2#define __NET_WEXT_H
3 3
4/* 4#include <net/iw_handler.h>
5 * wireless extensions interface to the core code
6 */
7 5
8struct net; 6struct net;
9 7
10#ifdef CONFIG_WIRELESS_EXT 8#ifdef CONFIG_WEXT_CORE
11extern int wext_proc_init(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, 9extern int wext_handle_ioctl(struct net *net, struct ifreq *ifr, unsigned int cmd,
14 void __user *arg); 10 void __user *arg);
15extern int compat_wext_handle_ioctl(struct net *net, unsigned int cmd, 11extern int compat_wext_handle_ioctl(struct net *net, unsigned int cmd,
16 unsigned long arg); 12 unsigned long arg);
13
17extern struct iw_statistics *get_wireless_stats(struct net_device *dev); 14extern struct iw_statistics *get_wireless_stats(struct net_device *dev);
15extern int call_commit_handler(struct net_device *dev);
18#else 16#else
19static inline int wext_proc_init(struct net *net)
20{
21 return 0;
22}
23static inline void wext_proc_exit(struct net *net)
24{
25 return;
26}
27static inline int wext_handle_ioctl(struct net *net, struct ifreq *ifr, unsigned int cmd, 17static inline int wext_handle_ioctl(struct net *net, struct ifreq *ifr, unsigned int cmd,
28 void __user *arg) 18 void __user *arg)
29{ 19{
@@ -36,4 +26,35 @@ static inline int compat_wext_handle_ioctl(struct net *net, unsigned int cmd,
36} 26}
37#endif 27#endif
38 28
29#ifdef CONFIG_WEXT_PROC
30extern int wext_proc_init(struct net *net);
31extern void wext_proc_exit(struct net *net);
32#else
33static inline int wext_proc_init(struct net *net)
34{
35 return 0;
36}
37static inline void wext_proc_exit(struct net *net)
38{
39 return;
40}
41#endif
42
43#ifdef CONFIG_WEXT_PRIV
44int ioctl_private_call(struct net_device *dev, struct iwreq *iwr,
45 unsigned int cmd, struct iw_request_info *info,
46 iw_handler handler);
47int compat_private_call(struct net_device *dev, struct iwreq *iwr,
48 unsigned int cmd, struct iw_request_info *info,
49 iw_handler handler);
50int iw_handler_get_private(struct net_device * dev,
51 struct iw_request_info * info,
52 union iwreq_data * wrqu,
53 char * extra);
54#else
55#define ioctl_private_call NULL
56#define compat_private_call NULL
57#endif
58
59
39#endif /* __NET_WEXT_H */ 60#endif /* __NET_WEXT_H */
diff --git a/include/net/wimax.h b/include/net/wimax.h
index 2af7bf839f23..d69c4a7a1267 100644
--- a/include/net/wimax.h
+++ b/include/net/wimax.h
@@ -195,6 +195,12 @@
195 * defining the `struct nla_policy` for each message, it has to have 195 * defining the `struct nla_policy` for each message, it has to have
196 * an array size of WIMAX_GNL_ATTR_MAX+1. 196 * an array size of WIMAX_GNL_ATTR_MAX+1.
197 * 197 *
198 * The op_*() function pointers will not be called if the wimax_dev is
199 * in a state <= %WIMAX_ST_UNINITIALIZED. The exception is:
200 *
201 * - op_reset: can be called at any time after wimax_dev_add() has
202 * been called.
203 *
198 * THE PIPE INTERFACE: 204 * THE PIPE INTERFACE:
199 * 205 *
200 * This interface is kept intentionally simple. The driver can send 206 * This interface is kept intentionally simple. The driver can send
diff --git a/include/net/wpan-phy.h b/include/net/wpan-phy.h
index 547b1e271ac9..85926231c07a 100644
--- a/include/net/wpan-phy.h
+++ b/include/net/wpan-phy.h
@@ -34,20 +34,32 @@ struct wpan_phy {
34 */ 34 */
35 u8 current_channel; 35 u8 current_channel;
36 u8 current_page; 36 u8 current_page;
37 u32 channels_supported; 37 u32 channels_supported[32];
38 u8 transmit_power; 38 u8 transmit_power;
39 u8 cca_mode; 39 u8 cca_mode;
40 40
41 struct device dev; 41 struct device dev;
42 int idx; 42 int idx;
43 43
44 struct net_device *(*add_iface)(struct wpan_phy *phy,
45 const char *name);
46 void (*del_iface)(struct wpan_phy *phy, struct net_device *dev);
47
44 char priv[0] __attribute__((__aligned__(NETDEV_ALIGN))); 48 char priv[0] __attribute__((__aligned__(NETDEV_ALIGN)));
45}; 49};
46 50
51#define to_phy(_dev) container_of(_dev, struct wpan_phy, dev)
52
47struct wpan_phy *wpan_phy_alloc(size_t priv_size); 53struct wpan_phy *wpan_phy_alloc(size_t priv_size);
48int wpan_phy_register(struct device *parent, struct wpan_phy *phy); 54static inline void wpan_phy_set_dev(struct wpan_phy *phy, struct device *dev)
55{
56 phy->dev.parent = dev;
57}
58int wpan_phy_register(struct wpan_phy *phy);
49void wpan_phy_unregister(struct wpan_phy *phy); 59void wpan_phy_unregister(struct wpan_phy *phy);
50void wpan_phy_free(struct wpan_phy *phy); 60void wpan_phy_free(struct wpan_phy *phy);
61/* Same semantics as for class_for_each_device */
62int wpan_phy_for_each(int (*fn)(struct wpan_phy *phy, void *data), void *data);
51 63
52static inline void *wpan_phy_priv(struct wpan_phy *phy) 64static inline void *wpan_phy_priv(struct wpan_phy *phy)
53{ 65{
@@ -56,6 +68,12 @@ static inline void *wpan_phy_priv(struct wpan_phy *phy)
56} 68}
57 69
58struct wpan_phy *wpan_phy_find(const char *str); 70struct wpan_phy *wpan_phy_find(const char *str);
71
72static inline void wpan_phy_put(struct wpan_phy *phy)
73{
74 put_device(&phy->dev);
75}
76
59static inline const char *wpan_phy_name(struct wpan_phy *phy) 77static inline const char *wpan_phy_name(struct wpan_phy *phy)
60{ 78{
61 return dev_name(&phy->dev); 79 return dev_name(&phy->dev);
diff --git a/include/net/x25.h b/include/net/x25.h
index 2cda04011568..9baa07dc7d17 100644
--- a/include/net/x25.h
+++ b/include/net/x25.h
@@ -287,8 +287,14 @@ extern unsigned long x25_display_timer(struct sock *);
287extern void x25_check_rbuf(struct sock *); 287extern void x25_check_rbuf(struct sock *);
288 288
289/* sysctl_net_x25.c */ 289/* sysctl_net_x25.c */
290#ifdef CONFIG_SYSCTL
290extern void x25_register_sysctl(void); 291extern void x25_register_sysctl(void);
291extern void x25_unregister_sysctl(void); 292extern void x25_unregister_sysctl(void);
293#else
294static inline void x25_register_sysctl(void) {};
295static inline void x25_unregister_sysctl(void) {};
296#endif /* CONFIG_SYSCTL */
297
292struct x25_skb_cb { 298struct x25_skb_cb {
293 unsigned flags; 299 unsigned flags;
294}; 300};
diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index 223e90a44824..6d85861ab990 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -19,6 +19,9 @@
19#include <net/route.h> 19#include <net/route.h>
20#include <net/ipv6.h> 20#include <net/ipv6.h>
21#include <net/ip6_fib.h> 21#include <net/ip6_fib.h>
22
23#include <linux/interrupt.h>
24
22#ifdef CONFIG_XFRM_STATISTICS 25#ifdef CONFIG_XFRM_STATISTICS
23#include <net/snmp.h> 26#include <net/snmp.h>
24#endif 27#endif
@@ -121,8 +124,7 @@ struct xfrm_state_walk {
121}; 124};
122 125
123/* Full description of state of transformer. */ 126/* Full description of state of transformer. */
124struct xfrm_state 127struct xfrm_state {
125{
126#ifdef CONFIG_NET_NS 128#ifdef CONFIG_NET_NS
127 struct net *xs_net; 129 struct net *xs_net;
128#endif 130#endif
@@ -160,7 +162,7 @@ struct xfrm_state
160 struct xfrm_lifetime_cfg lft; 162 struct xfrm_lifetime_cfg lft;
161 163
162 /* Data for transformer */ 164 /* Data for transformer */
163 struct xfrm_algo *aalg; 165 struct xfrm_algo_auth *aalg;
164 struct xfrm_algo *ealg; 166 struct xfrm_algo *ealg;
165 struct xfrm_algo *calg; 167 struct xfrm_algo *calg;
166 struct xfrm_algo_aead *aead; 168 struct xfrm_algo_aead *aead;
@@ -199,7 +201,7 @@ struct xfrm_state
199 struct xfrm_stats stats; 201 struct xfrm_stats stats;
200 202
201 struct xfrm_lifetime_cur curlft; 203 struct xfrm_lifetime_cur curlft;
202 struct timer_list timer; 204 struct tasklet_hrtimer mtimer;
203 205
204 /* Last used time */ 206 /* Last used time */
205 unsigned long lastused; 207 unsigned long lastused;
@@ -237,8 +239,7 @@ enum {
237}; 239};
238 240
239/* callback structure passed from either netlink or pfkey */ 241/* callback structure passed from either netlink or pfkey */
240struct km_event 242struct km_event {
241{
242 union { 243 union {
243 u32 hard; 244 u32 hard;
244 u32 proto; 245 u32 proto;
@@ -313,8 +314,7 @@ extern int xfrm_state_unregister_afinfo(struct xfrm_state_afinfo *afinfo);
313 314
314extern void xfrm_state_delete_tunnel(struct xfrm_state *x); 315extern void xfrm_state_delete_tunnel(struct xfrm_state *x);
315 316
316struct xfrm_type 317struct xfrm_type {
317{
318 char *description; 318 char *description;
319 struct module *owner; 319 struct module *owner;
320 __u8 proto; 320 __u8 proto;
@@ -420,8 +420,7 @@ static inline struct xfrm_mode *xfrm_ip2inner_mode(struct xfrm_state *x, int ipp
420 return x->inner_mode_iaf; 420 return x->inner_mode_iaf;
421} 421}
422 422
423struct xfrm_tmpl 423struct xfrm_tmpl {
424{
425/* id in template is interpreted as: 424/* id in template is interpreted as:
426 * daddr - destination of tunnel, may be zero for transport mode. 425 * daddr - destination of tunnel, may be zero for transport mode.
427 * spi - zero to acquire spi. Not zero if spi is static, then 426 * spi - zero to acquire spi. Not zero if spi is static, then
@@ -468,8 +467,7 @@ struct xfrm_policy_walk {
468 u32 seq; 467 u32 seq;
469}; 468};
470 469
471struct xfrm_policy 470struct xfrm_policy {
472{
473#ifdef CONFIG_NET_NS 471#ifdef CONFIG_NET_NS
474 struct net *xp_net; 472 struct net *xp_net;
475#endif 473#endif
@@ -538,8 +536,7 @@ struct xfrm_migrate {
538/* default seq threshold size */ 536/* default seq threshold size */
539#define XFRM_AE_SEQT_SIZE 2 537#define XFRM_AE_SEQT_SIZE 2
540 538
541struct xfrm_mgr 539struct xfrm_mgr {
542{
543 struct list_head list; 540 struct list_head list;
544 char *id; 541 char *id;
545 int (*notify)(struct xfrm_state *x, struct km_event *c); 542 int (*notify)(struct xfrm_state *x, struct km_event *c);
@@ -626,8 +623,7 @@ struct xfrm_spi_skb_cb {
626#define XFRM_SPI_SKB_CB(__skb) ((struct xfrm_spi_skb_cb *)&((__skb)->cb[0])) 623#define XFRM_SPI_SKB_CB(__skb) ((struct xfrm_spi_skb_cb *)&((__skb)->cb[0]))
627 624
628/* Audit Information */ 625/* Audit Information */
629struct xfrm_audit 626struct xfrm_audit {
630{
631 u32 secid; 627 u32 secid;
632 uid_t loginuid; 628 uid_t loginuid;
633 u32 sessionid; 629 u32 sessionid;
@@ -871,8 +867,7 @@ static inline int xfrm_sec_ctx_match(struct xfrm_sec_ctx *s1, struct xfrm_sec_ct
871 * bundles differing by session id. All the bundles grow from a parent 867 * bundles differing by session id. All the bundles grow from a parent
872 * policy rule. 868 * policy rule.
873 */ 869 */
874struct xfrm_dst 870struct xfrm_dst {
875{
876 union { 871 union {
877 struct dst_entry dst; 872 struct dst_entry dst;
878 struct rtable rt; 873 struct rtable rt;
@@ -907,8 +902,7 @@ static inline void xfrm_dst_destroy(struct xfrm_dst *xdst)
907 902
908extern void xfrm_dst_ifdown(struct dst_entry *dst, struct net_device *dev); 903extern void xfrm_dst_ifdown(struct dst_entry *dst, struct net_device *dev);
909 904
910struct sec_path 905struct sec_path {
911{
912 atomic_t refcnt; 906 atomic_t refcnt;
913 int len; 907 int len;
914 struct xfrm_state *xvec[XFRM_MAX_DEPTH]; 908 struct xfrm_state *xvec[XFRM_MAX_DEPTH];
@@ -1500,9 +1494,6 @@ struct scatterlist;
1500typedef int (icv_update_fn_t)(struct hash_desc *, struct scatterlist *, 1494typedef int (icv_update_fn_t)(struct hash_desc *, struct scatterlist *,
1501 unsigned int); 1495 unsigned int);
1502 1496
1503extern int skb_icv_walk(const struct sk_buff *skb, struct hash_desc *tfm,
1504 int offset, int len, icv_update_fn_t icv_update);
1505
1506static inline int xfrm_addr_cmp(xfrm_address_t *a, xfrm_address_t *b, 1497static inline int xfrm_addr_cmp(xfrm_address_t *a, xfrm_address_t *b,
1507 int family) 1498 int family)
1508{ 1499{
@@ -1541,12 +1532,22 @@ static inline int xfrm_alg_len(struct xfrm_algo *alg)
1541 return sizeof(*alg) + ((alg->alg_key_len + 7) / 8); 1532 return sizeof(*alg) + ((alg->alg_key_len + 7) / 8);
1542} 1533}
1543 1534
1535static inline int xfrm_alg_auth_len(struct xfrm_algo_auth *alg)
1536{
1537 return sizeof(*alg) + ((alg->alg_key_len + 7) / 8);
1538}
1539
1544#ifdef CONFIG_XFRM_MIGRATE 1540#ifdef CONFIG_XFRM_MIGRATE
1545static inline struct xfrm_algo *xfrm_algo_clone(struct xfrm_algo *orig) 1541static inline struct xfrm_algo *xfrm_algo_clone(struct xfrm_algo *orig)
1546{ 1542{
1547 return kmemdup(orig, xfrm_alg_len(orig), GFP_KERNEL); 1543 return kmemdup(orig, xfrm_alg_len(orig), GFP_KERNEL);
1548} 1544}
1549 1545
1546static inline struct xfrm_algo_auth *xfrm_algo_auth_clone(struct xfrm_algo_auth *orig)
1547{
1548 return kmemdup(orig, xfrm_alg_auth_len(orig), GFP_KERNEL);
1549}
1550
1550static inline void xfrm_states_put(struct xfrm_state **states, int n) 1551static inline void xfrm_states_put(struct xfrm_state **states, int n)
1551{ 1552{
1552 int i; 1553 int i;
diff --git a/include/sound/Kbuild b/include/sound/Kbuild
index fd054a344324..e9dd9369ecb9 100644
--- a/include/sound/Kbuild
+++ b/include/sound/Kbuild
@@ -2,7 +2,6 @@ header-y += asound_fm.h
2header-y += hdsp.h 2header-y += hdsp.h
3header-y += hdspm.h 3header-y += hdspm.h
4header-y += sfnt_info.h 4header-y += sfnt_info.h
5header-y += sscape_ioctl.h
6 5
7unifdef-y += asequencer.h 6unifdef-y += asequencer.h
8unifdef-y += asound.h 7unifdef-y += asound.h
diff --git a/include/sound/aci.h b/include/sound/aci.h
new file mode 100644
index 000000000000..ee639d355ef0
--- /dev/null
+++ b/include/sound/aci.h
@@ -0,0 +1,90 @@
1#ifndef _ACI_H_
2#define _ACI_H_
3
4#define ACI_REG_COMMAND 0 /* write register offset */
5#define ACI_REG_STATUS 1 /* read register offset */
6#define ACI_REG_BUSY 2 /* busy register offset */
7#define ACI_REG_RDS 2 /* PCM20: RDS register offset */
8#define ACI_MINTIME 500 /* ACI time out limit */
9
10#define ACI_SET_MUTE 0x0d
11#define ACI_SET_POWERAMP 0x0f
12#define ACI_SET_TUNERMUTE 0xa3
13#define ACI_SET_TUNERMONO 0xa4
14#define ACI_SET_IDE 0xd0
15#define ACI_SET_WSS 0xd1
16#define ACI_SET_SOLOMODE 0xd2
17#define ACI_SET_PREAMP 0x03
18#define ACI_GET_PREAMP 0x21
19#define ACI_WRITE_TUNE 0xa7
20#define ACI_READ_TUNERSTEREO 0xa8
21#define ACI_READ_TUNERSTATION 0xa9
22#define ACI_READ_VERSION 0xf1
23#define ACI_READ_IDCODE 0xf2
24#define ACI_INIT 0xff
25#define ACI_STATUS 0xf0
26#define ACI_S_GENERAL 0x00
27#define ACI_ERROR_OP 0xdf
28
29/* ACI Mixer */
30
31/* These are the values for the right channel GET registers.
32 Add an offset of 0x01 for the left channel register.
33 (left=right+0x01) */
34
35#define ACI_GET_MASTER 0x03
36#define ACI_GET_MIC 0x05
37#define ACI_GET_LINE 0x07
38#define ACI_GET_CD 0x09
39#define ACI_GET_SYNTH 0x0b
40#define ACI_GET_PCM 0x0d
41#define ACI_GET_LINE1 0x10 /* Radio on PCM20 */
42#define ACI_GET_LINE2 0x12
43
44#define ACI_GET_EQ1 0x22 /* from Bass ... */
45#define ACI_GET_EQ2 0x24
46#define ACI_GET_EQ3 0x26
47#define ACI_GET_EQ4 0x28
48#define ACI_GET_EQ5 0x2a
49#define ACI_GET_EQ6 0x2c
50#define ACI_GET_EQ7 0x2e /* ... to Treble */
51
52/* And these are the values for the right channel SET registers.
53 For left channel access you have to add an offset of 0x08.
54 MASTER is an exception, which needs an offset of 0x01 */
55
56#define ACI_SET_MASTER 0x00
57#define ACI_SET_MIC 0x30
58#define ACI_SET_LINE 0x31
59#define ACI_SET_CD 0x34
60#define ACI_SET_SYNTH 0x33
61#define ACI_SET_PCM 0x32
62#define ACI_SET_LINE1 0x35 /* Radio on PCM20 */
63#define ACI_SET_LINE2 0x36
64
65#define ACI_SET_EQ1 0x40 /* from Bass ... */
66#define ACI_SET_EQ2 0x41
67#define ACI_SET_EQ3 0x42
68#define ACI_SET_EQ4 0x43
69#define ACI_SET_EQ5 0x44
70#define ACI_SET_EQ6 0x45
71#define ACI_SET_EQ7 0x46 /* ... to Treble */
72
73struct snd_miro_aci {
74 unsigned long aci_port;
75 int aci_vendor;
76 int aci_product;
77 int aci_version;
78 int aci_amp;
79 int aci_preamp;
80 int aci_solomode;
81
82 struct mutex aci_mutex;
83};
84
85int snd_aci_cmd(struct snd_miro_aci *aci, int write1, int write2, int write3);
86
87struct snd_miro_aci *snd_aci_get_aci(void);
88
89#endif /* _ACI_H_ */
90
diff --git a/include/sound/ak4113.h b/include/sound/ak4113.h
new file mode 100644
index 000000000000..8988edae1609
--- /dev/null
+++ b/include/sound/ak4113.h
@@ -0,0 +1,321 @@
1#ifndef __SOUND_AK4113_H
2#define __SOUND_AK4113_H
3
4/*
5 * Routines for Asahi Kasei AK4113
6 * Copyright (c) by Jaroslav Kysela <perex@perex.cz>,
7 * Copyright (c) by Pavel Hofman <pavel.hofman@ivitera.com>,
8 *
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 *
24 */
25
26/* AK4113 registers */
27/* power down */
28#define AK4113_REG_PWRDN 0x00
29/* format control */
30#define AK4113_REG_FORMAT 0x01
31/* input/output control */
32#define AK4113_REG_IO0 0x02
33/* input/output control */
34#define AK4113_REG_IO1 0x03
35/* interrupt0 mask */
36#define AK4113_REG_INT0_MASK 0x04
37/* interrupt1 mask */
38#define AK4113_REG_INT1_MASK 0x05
39/* DAT mask & DTS select */
40#define AK4113_REG_DATDTS 0x06
41/* receiver status 0 */
42#define AK4113_REG_RCS0 0x07
43/* receiver status 1 */
44#define AK4113_REG_RCS1 0x08
45/* receiver status 2 */
46#define AK4113_REG_RCS2 0x09
47/* RX channel status byte 0 */
48#define AK4113_REG_RXCSB0 0x0a
49/* RX channel status byte 1 */
50#define AK4113_REG_RXCSB1 0x0b
51/* RX channel status byte 2 */
52#define AK4113_REG_RXCSB2 0x0c
53/* RX channel status byte 3 */
54#define AK4113_REG_RXCSB3 0x0d
55/* RX channel status byte 4 */
56#define AK4113_REG_RXCSB4 0x0e
57/* burst preamble Pc byte 0 */
58#define AK4113_REG_Pc0 0x0f
59/* burst preamble Pc byte 1 */
60#define AK4113_REG_Pc1 0x10
61/* burst preamble Pd byte 0 */
62#define AK4113_REG_Pd0 0x11
63/* burst preamble Pd byte 1 */
64#define AK4113_REG_Pd1 0x12
65/* Q-subcode address + control */
66#define AK4113_REG_QSUB_ADDR 0x13
67/* Q-subcode track */
68#define AK4113_REG_QSUB_TRACK 0x14
69/* Q-subcode index */
70#define AK4113_REG_QSUB_INDEX 0x15
71/* Q-subcode minute */
72#define AK4113_REG_QSUB_MINUTE 0x16
73/* Q-subcode second */
74#define AK4113_REG_QSUB_SECOND 0x17
75/* Q-subcode frame */
76#define AK4113_REG_QSUB_FRAME 0x18
77/* Q-subcode zero */
78#define AK4113_REG_QSUB_ZERO 0x19
79/* Q-subcode absolute minute */
80#define AK4113_REG_QSUB_ABSMIN 0x1a
81/* Q-subcode absolute second */
82#define AK4113_REG_QSUB_ABSSEC 0x1b
83/* Q-subcode absolute frame */
84#define AK4113_REG_QSUB_ABSFRM 0x1c
85
86/* sizes */
87#define AK4113_REG_RXCSB_SIZE ((AK4113_REG_RXCSB4-AK4113_REG_RXCSB0)+1)
88#define AK4113_REG_QSUB_SIZE ((AK4113_REG_QSUB_ABSFRM-AK4113_REG_QSUB_ADDR)\
89 +1)
90
91#define AK4113_WRITABLE_REGS (AK4113_REG_DATDTS + 1)
92
93/* AK4113_REG_PWRDN bits */
94/* Channel Status Select */
95#define AK4113_CS12 (1<<7)
96/* Block Start & C/U Output Mode */
97#define AK4113_BCU (1<<6)
98/* Master Clock Operation Select */
99#define AK4113_CM1 (1<<5)
100/* Master Clock Operation Select */
101#define AK4113_CM0 (1<<4)
102/* Master Clock Frequency Select */
103#define AK4113_OCKS1 (1<<3)
104/* Master Clock Frequency Select */
105#define AK4113_OCKS0 (1<<2)
106/* 0 = power down, 1 = normal operation */
107#define AK4113_PWN (1<<1)
108/* 0 = reset & initialize (except thisregister), 1 = normal operation */
109#define AK4113_RST (1<<0)
110
111/* AK4113_REQ_FORMAT bits */
112/* V/TX Output select: 0 = Validity Flag Output, 1 = TX */
113#define AK4113_VTX (1<<7)
114/* Audio Data Control */
115#define AK4113_DIF2 (1<<6)
116/* Audio Data Control */
117#define AK4113_DIF1 (1<<5)
118/* Audio Data Control */
119#define AK4113_DIF0 (1<<4)
120/* Deemphasis Autodetect Enable (1 = enable) */
121#define AK4113_DEAU (1<<3)
122/* 32kHz-48kHz Deemphasis Control */
123#define AK4113_DEM1 (1<<2)
124/* 32kHz-48kHz Deemphasis Control */
125#define AK4113_DEM0 (1<<1)
126#define AK4113_DEM_OFF (AK4113_DEM0)
127#define AK4113_DEM_44KHZ (0)
128#define AK4113_DEM_48KHZ (AK4113_DEM1)
129#define AK4113_DEM_32KHZ (AK4113_DEM0|AK4113_DEM1)
130/* STDO: 16-bit, right justified */
131#define AK4113_DIF_16R (0)
132/* STDO: 18-bit, right justified */
133#define AK4113_DIF_18R (AK4113_DIF0)
134/* STDO: 20-bit, right justified */
135#define AK4113_DIF_20R (AK4113_DIF1)
136/* STDO: 24-bit, right justified */
137#define AK4113_DIF_24R (AK4113_DIF1|AK4113_DIF0)
138/* STDO: 24-bit, left justified */
139#define AK4113_DIF_24L (AK4113_DIF2)
140/* STDO: I2S */
141#define AK4113_DIF_24I2S (AK4113_DIF2|AK4113_DIF0)
142/* STDO: 24-bit, left justified; LRCLK, BICK = Input */
143#define AK4113_DIF_I24L (AK4113_DIF2|AK4113_DIF1)
144/* STDO: I2S; LRCLK, BICK = Input */
145#define AK4113_DIF_I24I2S (AK4113_DIF2|AK4113_DIF1|AK4113_DIF0)
146
147/* AK4113_REG_IO0 */
148/* XTL1=0,XTL0=0 -> 11.2896Mhz; XTL1=0,XTL0=1 -> 12.288Mhz */
149#define AK4113_XTL1 (1<<6)
150/* XTL1=1,XTL0=0 -> 24.576Mhz; XTL1=1,XTL0=1 -> use channel status */
151#define AK4113_XTL0 (1<<5)
152/* Block Start Signal Output: 0 = U-bit, 1 = C-bit (req. BCU = 1) */
153#define AK4113_UCE (1<<4)
154/* TX Output Enable (1 = enable) */
155#define AK4113_TXE (1<<3)
156/* Output Through Data Selector for TX pin */
157#define AK4113_OPS2 (1<<2)
158/* Output Through Data Selector for TX pin */
159#define AK4113_OPS1 (1<<1)
160/* Output Through Data Selector for TX pin */
161#define AK4113_OPS0 (1<<0)
162/* 11.2896 MHz ref. Xtal freq. */
163#define AK4113_XTL_11_2896M (0)
164/* 12.288 MHz ref. Xtal freq. */
165#define AK4113_XTL_12_288M (AK4113_XTL0)
166/* 24.576 MHz ref. Xtal freq. */
167#define AK4113_XTL_24_576M (AK4113_XTL1)
168
169/* AK4113_REG_IO1 */
170/* Interrupt 0 pin Hold */
171#define AK4113_EFH1 (1<<7)
172/* Interrupt 0 pin Hold */
173#define AK4113_EFH0 (1<<6)
174#define AK4113_EFH_512LRCLK (0)
175#define AK4113_EFH_1024LRCLK (AK4113_EFH0)
176#define AK4113_EFH_2048LRCLK (AK4113_EFH1)
177#define AK4113_EFH_4096LRCLK (AK4113_EFH1|AK4113_EFH0)
178/* PLL Lock Time: 0 = 384/fs, 1 = 1/fs */
179#define AK4113_FAST (1<<5)
180/* MCKO2 Output Select: 0 = CMx/OCKSx, 1 = Xtal */
181#define AK4113_XMCK (1<<4)
182/* MCKO2 Output Freq. Select: 0 = x1, 1 = x0.5 (req. XMCK = 1) */
183#define AK4113_DIV (1<<3)
184/* Input Recovery Data Select */
185#define AK4113_IPS2 (1<<2)
186/* Input Recovery Data Select */
187#define AK4113_IPS1 (1<<1)
188/* Input Recovery Data Select */
189#define AK4113_IPS0 (1<<0)
190#define AK4113_IPS(x) ((x)&7)
191
192/* AK4113_REG_INT0_MASK && AK4113_REG_INT1_MASK*/
193/* mask enable for QINT bit */
194#define AK4113_MQI (1<<7)
195/* mask enable for AUTO bit */
196#define AK4113_MAUT (1<<6)
197/* mask enable for CINT bit */
198#define AK4113_MCIT (1<<5)
199/* mask enable for UNLOCK bit */
200#define AK4113_MULK (1<<4)
201/* mask enable for V bit */
202#define AK4113_V (1<<3)
203/* mask enable for STC bit */
204#define AK4113_STC (1<<2)
205/* mask enable for AUDN bit */
206#define AK4113_MAN (1<<1)
207/* mask enable for PAR bit */
208#define AK4113_MPR (1<<0)
209
210/* AK4113_REG_DATDTS */
211/* DAT Start ID Counter */
212#define AK4113_DCNT (1<<4)
213/* DTS-CD 16-bit Sync Word Detect */
214#define AK4113_DTS16 (1<<3)
215/* DTS-CD 14-bit Sync Word Detect */
216#define AK4113_DTS14 (1<<2)
217/* mask enable for DAT bit (if 1, no INT1 effect */
218#define AK4113_MDAT1 (1<<1)
219/* mask enable for DAT bit (if 1, no INT0 effect */
220#define AK4113_MDAT0 (1<<0)
221
222/* AK4113_REG_RCS0 */
223/* Q-subcode buffer interrupt, 0 = no change, 1 = changed */
224#define AK4113_QINT (1<<7)
225/* Non-PCM or DTS stream auto detection, 0 = no detect, 1 = detect */
226#define AK4113_AUTO (1<<6)
227/* channel status buffer interrupt, 0 = no change, 1 = change */
228#define AK4113_CINT (1<<5)
229/* PLL lock status, 0 = lock, 1 = unlock */
230#define AK4113_UNLCK (1<<4)
231/* Validity bit, 0 = valid, 1 = invalid */
232#define AK4113_V (1<<3)
233/* sampling frequency or Pre-emphasis change, 0 = no detect, 1 = detect */
234#define AK4113_STC (1<<2)
235/* audio bit output, 0 = audio, 1 = non-audio */
236#define AK4113_AUDION (1<<1)
237/* parity error or biphase error status, 0 = no error, 1 = error */
238#define AK4113_PAR (1<<0)
239
240/* AK4113_REG_RCS1 */
241/* sampling frequency detection */
242#define AK4113_FS3 (1<<7)
243#define AK4113_FS2 (1<<6)
244#define AK4113_FS1 (1<<5)
245#define AK4113_FS0 (1<<4)
246/* Pre-emphasis detect, 0 = OFF, 1 = ON */
247#define AK4113_PEM (1<<3)
248/* DAT Start ID Detect, 0 = no detect, 1 = detect */
249#define AK4113_DAT (1<<2)
250/* DTS-CD bit audio stream detect, 0 = no detect, 1 = detect */
251#define AK4113_DTSCD (1<<1)
252/* Non-PCM bit stream detection, 0 = no detect, 1 = detect */
253#define AK4113_NPCM (1<<0)
254#define AK4113_FS_8000HZ (AK4113_FS3|AK4113_FS0)
255#define AK4113_FS_11025HZ (AK4113_FS2|AK4113_FS0)
256#define AK4113_FS_16000HZ (AK4113_FS2|AK4113_FS1|AK4113_FS0)
257#define AK4113_FS_22050HZ (AK4113_FS2)
258#define AK4113_FS_24000HZ (AK4113_FS2|AK4113_FS1)
259#define AK4113_FS_32000HZ (AK4113_FS1|AK4113_FS0)
260#define AK4113_FS_44100HZ (0)
261#define AK4113_FS_48000HZ (AK4113_FS1)
262#define AK4113_FS_64000HZ (AK4113_FS3|AK4113_FS1|AK4113_FS0)
263#define AK4113_FS_88200HZ (AK4113_FS3)
264#define AK4113_FS_96000HZ (AK4113_FS3|AK4113_FS1)
265#define AK4113_FS_176400HZ (AK4113_FS3|AK4113_FS2)
266#define AK4113_FS_192000HZ (AK4113_FS3|AK4113_FS2|AK4113_FS1)
267
268/* AK4113_REG_RCS2 */
269/* CRC for Q-subcode, 0 = no error, 1 = error */
270#define AK4113_QCRC (1<<1)
271/* CRC for channel status, 0 = no error, 1 = error */
272#define AK4113_CCRC (1<<0)
273
274/* flags for snd_ak4113_check_rate_and_errors() */
275#define AK4113_CHECK_NO_STAT (1<<0) /* no statistics */
276#define AK4113_CHECK_NO_RATE (1<<1) /* no rate check */
277
278#define AK4113_CONTROLS 13
279
280typedef void (ak4113_write_t)(void *private_data, unsigned char addr,
281 unsigned char data);
282typedef unsigned char (ak4113_read_t)(void *private_data, unsigned char addr);
283
284struct ak4113 {
285 struct snd_card *card;
286 ak4113_write_t *write;
287 ak4113_read_t *read;
288 void *private_data;
289 unsigned int init:1;
290 spinlock_t lock;
291 unsigned char regmap[AK4113_WRITABLE_REGS];
292 struct snd_kcontrol *kctls[AK4113_CONTROLS];
293 struct snd_pcm_substream *substream;
294 unsigned long parity_errors;
295 unsigned long v_bit_errors;
296 unsigned long qcrc_errors;
297 unsigned long ccrc_errors;
298 unsigned char rcs0;
299 unsigned char rcs1;
300 unsigned char rcs2;
301 struct delayed_work work;
302 unsigned int check_flags;
303 void *change_callback_private;
304 void (*change_callback)(struct ak4113 *ak4113, unsigned char c0,
305 unsigned char c1);
306};
307
308int snd_ak4113_create(struct snd_card *card, ak4113_read_t *read,
309 ak4113_write_t *write,
310 const unsigned char pgm[AK4113_WRITABLE_REGS],
311 void *private_data, struct ak4113 **r_ak4113);
312void snd_ak4113_reg_write(struct ak4113 *ak4113, unsigned char reg,
313 unsigned char mask, unsigned char val);
314void snd_ak4113_reinit(struct ak4113 *ak4113);
315int snd_ak4113_build(struct ak4113 *ak4113,
316 struct snd_pcm_substream *capture_substream);
317int snd_ak4113_external_rate(struct ak4113 *ak4113);
318int snd_ak4113_check_rate_and_errors(struct ak4113 *ak4113, unsigned int flags);
319
320#endif /* __SOUND_AK4113_H */
321
diff --git a/include/sound/ak4114.h b/include/sound/ak4114.h
index d293d36a66b8..3ce69fd92523 100644
--- a/include/sound/ak4114.h
+++ b/include/sound/ak4114.h
@@ -95,13 +95,13 @@
95 95
96/* AK4114_REG_IO0 */ 96/* AK4114_REG_IO0 */
97#define AK4114_TX1E (1<<7) /* TX1 Output Enable (1 = enable) */ 97#define AK4114_TX1E (1<<7) /* TX1 Output Enable (1 = enable) */
98#define AK4114_OPS12 (1<<2) /* Output Though Data Selector for TX1 pin */ 98#define AK4114_OPS12 (1<<6) /* Output Data Selector for TX1 pin */
99#define AK4114_OPS11 (1<<1) /* Output Though Data Selector for TX1 pin */ 99#define AK4114_OPS11 (1<<5) /* Output Data Selector for TX1 pin */
100#define AK4114_OPS10 (1<<0) /* Output Though Data Selector for TX1 pin */ 100#define AK4114_OPS10 (1<<4) /* Output Data Selector for TX1 pin */
101#define AK4114_TX0E (1<<3) /* TX0 Output Enable (1 = enable) */ 101#define AK4114_TX0E (1<<3) /* TX0 Output Enable (1 = enable) */
102#define AK4114_OPS02 (1<<2) /* Output Though Data Selector for TX0 pin */ 102#define AK4114_OPS02 (1<<2) /* Output Data Selector for TX0 pin */
103#define AK4114_OPS01 (1<<1) /* Output Though Data Selector for TX0 pin */ 103#define AK4114_OPS01 (1<<1) /* Output Data Selector for TX0 pin */
104#define AK4114_OPS00 (1<<0) /* Output Though Data Selector for TX0 pin */ 104#define AK4114_OPS00 (1<<0) /* Output Data Selector for TX0 pin */
105 105
106/* AK4114_REG_IO1 */ 106/* AK4114_REG_IO1 */
107#define AK4114_EFH1 (1<<7) /* Interrupt 0 pin Hold */ 107#define AK4114_EFH1 (1<<7) /* Interrupt 0 pin Hold */
diff --git a/include/sound/ak4xxx-adda.h b/include/sound/ak4xxx-adda.h
index 891cf1aea8b1..030b87c2f6d4 100644
--- a/include/sound/ak4xxx-adda.h
+++ b/include/sound/ak4xxx-adda.h
@@ -68,7 +68,7 @@ struct snd_akm4xxx {
68 enum { 68 enum {
69 SND_AK4524, SND_AK4528, SND_AK4529, 69 SND_AK4524, SND_AK4528, SND_AK4529,
70 SND_AK4355, SND_AK4358, SND_AK4381, 70 SND_AK4355, SND_AK4358, SND_AK4381,
71 SND_AK5365 71 SND_AK5365, SND_AK4620,
72 } type; 72 } type;
73 73
74 /* (array) information of combined codecs */ 74 /* (array) information of combined codecs */
@@ -76,6 +76,9 @@ struct snd_akm4xxx {
76 const struct snd_akm4xxx_adc_channel *adc_info; 76 const struct snd_akm4xxx_adc_channel *adc_info;
77 77
78 struct snd_ak4xxx_ops ops; 78 struct snd_ak4xxx_ops ops;
79 unsigned int num_chips;
80 unsigned int total_regs;
81 const char *name;
79}; 82};
80 83
81void snd_akm4xxx_write(struct snd_akm4xxx *ak, int chip, unsigned char reg, 84void snd_akm4xxx_write(struct snd_akm4xxx *ak, int chip, unsigned char reg,
diff --git a/include/sound/control.h b/include/sound/control.h
index ef96f07aa03b..112374dc0c58 100644
--- a/include/sound/control.h
+++ b/include/sound/control.h
@@ -56,7 +56,6 @@ struct snd_kcontrol_new {
56 56
57struct snd_kcontrol_volatile { 57struct snd_kcontrol_volatile {
58 struct snd_ctl_file *owner; /* locked */ 58 struct snd_ctl_file *owner; /* locked */
59 pid_t owner_pid;
60 unsigned int access; /* access rights */ 59 unsigned int access; /* access rights */
61}; 60};
62 61
@@ -87,10 +86,12 @@ struct snd_kctl_event {
87 86
88#define snd_kctl_event(n) list_entry(n, struct snd_kctl_event, list) 87#define snd_kctl_event(n) list_entry(n, struct snd_kctl_event, list)
89 88
89struct pid;
90
90struct snd_ctl_file { 91struct snd_ctl_file {
91 struct list_head list; /* list of all control files */ 92 struct list_head list; /* list of all control files */
92 struct snd_card *card; 93 struct snd_card *card;
93 pid_t pid; 94 struct pid *pid;
94 int prefer_pcm_subdevice; 95 int prefer_pcm_subdevice;
95 int prefer_rawmidi_subdevice; 96 int prefer_rawmidi_subdevice;
96 wait_queue_head_t change_sleep; 97 wait_queue_head_t change_sleep;
diff --git a/include/sound/cs4231-regs.h b/include/sound/cs4231-regs.h
index 92647532c454..66d28c2cb53d 100644
--- a/include/sound/cs4231-regs.h
+++ b/include/sound/cs4231-regs.h
@@ -70,7 +70,6 @@
70#define AD1845_PWR_DOWN 0x1b /* power down control */ 70#define AD1845_PWR_DOWN 0x1b /* power down control */
71#define CS4235_LEFT_MASTER 0x1b /* left master output control */ 71#define CS4235_LEFT_MASTER 0x1b /* left master output control */
72#define CS4231_REC_FORMAT 0x1c /* clock and data format - record - bits 7-0 MCE */ 72#define CS4231_REC_FORMAT 0x1c /* clock and data format - record - bits 7-0 MCE */
73#define CS4231_PLY_VAR_FREQ 0x1d /* playback variable frequency */
74#define AD1845_CLOCK 0x1d /* crystal clock select and total power down */ 73#define AD1845_CLOCK 0x1d /* crystal clock select and total power down */
75#define CS4235_RIGHT_MASTER 0x1d /* right master output control */ 74#define CS4235_RIGHT_MASTER 0x1d /* right master output control */
76#define CS4231_REC_UPR_CNT 0x1e /* record upper count */ 75#define CS4231_REC_UPR_CNT 0x1e /* record upper count */
diff --git a/include/sound/pcm.h b/include/sound/pcm.h
index de6d981de5d6..c83a4a79f16b 100644
--- a/include/sound/pcm.h
+++ b/include/sound/pcm.h
@@ -348,6 +348,8 @@ struct snd_pcm_group { /* keep linked substreams */
348 int count; 348 int count;
349}; 349};
350 350
351struct pid;
352
351struct snd_pcm_substream { 353struct snd_pcm_substream {
352 struct snd_pcm *pcm; 354 struct snd_pcm *pcm;
353 struct snd_pcm_str *pstr; 355 struct snd_pcm_str *pstr;
@@ -379,6 +381,7 @@ struct snd_pcm_substream {
379 atomic_t mmap_count; 381 atomic_t mmap_count;
380 unsigned int f_flags; 382 unsigned int f_flags;
381 void (*pcm_release)(struct snd_pcm_substream *); 383 void (*pcm_release)(struct snd_pcm_substream *);
384 struct pid *pid;
382#if defined(CONFIG_SND_PCM_OSS) || defined(CONFIG_SND_PCM_OSS_MODULE) 385#if defined(CONFIG_SND_PCM_OSS) || defined(CONFIG_SND_PCM_OSS_MODULE)
383 /* -- OSS things -- */ 386 /* -- OSS things -- */
384 struct snd_pcm_oss_substream oss; 387 struct snd_pcm_oss_substream oss;
diff --git a/include/sound/rawmidi.h b/include/sound/rawmidi.h
index c23c26585700..2480e7d10dcf 100644
--- a/include/sound/rawmidi.h
+++ b/include/sound/rawmidi.h
@@ -46,6 +46,7 @@
46struct snd_rawmidi; 46struct snd_rawmidi;
47struct snd_rawmidi_substream; 47struct snd_rawmidi_substream;
48struct snd_seq_port_info; 48struct snd_seq_port_info;
49struct pid;
49 50
50struct snd_rawmidi_ops { 51struct snd_rawmidi_ops {
51 int (*open) (struct snd_rawmidi_substream * substream); 52 int (*open) (struct snd_rawmidi_substream * substream);
@@ -97,6 +98,7 @@ struct snd_rawmidi_substream {
97 struct snd_rawmidi_str *pstr; 98 struct snd_rawmidi_str *pstr;
98 char name[32]; 99 char name[32];
99 struct snd_rawmidi_runtime *runtime; 100 struct snd_rawmidi_runtime *runtime;
101 struct pid *pid;
100 /* hardware layer */ 102 /* hardware layer */
101 struct snd_rawmidi_ops *ops; 103 struct snd_rawmidi_ops *ops;
102}; 104};
diff --git a/include/sound/sh_dac_audio.h b/include/sound/sh_dac_audio.h
new file mode 100644
index 000000000000..f5deaf1ddb9f
--- /dev/null
+++ b/include/sound/sh_dac_audio.h
@@ -0,0 +1,21 @@
1/*
2 * SH_DAC specific configuration, for the dac_audio platform_device
3 *
4 * Copyright (C) 2009 Rafael Ignacio Zurita <rizurita@yahoo.com>
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License version 2 as published
8 * by the Free Software Foundation.
9 */
10
11#ifndef __INCLUDE_SH_DAC_AUDIO_H
12#define __INCLUDE_SH_DAC_AUDIO_H
13
14struct dac_audio_pdata {
15 int buffer_size;
16 int channel;
17 void (*start)(struct dac_audio_pdata *pd);
18 void (*stop)(struct dac_audio_pdata *pd);
19};
20
21#endif /* __INCLUDE_SH_DAC_AUDIO_H */
diff --git a/include/sound/soc-dai.h b/include/sound/soc-dai.h
index 97ca9af414dc..ca24e7f7a3f5 100644
--- a/include/sound/soc-dai.h
+++ b/include/sound/soc-dai.h
@@ -30,6 +30,7 @@ struct snd_pcm_substream;
30#define SND_SOC_DAIFMT_DSP_A 3 /* L data MSB after FRM LRC */ 30#define SND_SOC_DAIFMT_DSP_A 3 /* L data MSB after FRM LRC */
31#define SND_SOC_DAIFMT_DSP_B 4 /* L data MSB during FRM LRC */ 31#define SND_SOC_DAIFMT_DSP_B 4 /* L data MSB during FRM LRC */
32#define SND_SOC_DAIFMT_AC97 5 /* AC97 */ 32#define SND_SOC_DAIFMT_AC97 5 /* AC97 */
33#define SND_SOC_DAIFMT_PDM 6 /* Pulse density modulation */
33 34
34/* left and right justified also known as MSB and LSB respectively */ 35/* left and right justified also known as MSB and LSB respectively */
35#define SND_SOC_DAIFMT_MSB SND_SOC_DAIFMT_LEFT_J 36#define SND_SOC_DAIFMT_MSB SND_SOC_DAIFMT_LEFT_J
@@ -106,7 +107,7 @@ int snd_soc_dai_set_clkdiv(struct snd_soc_dai *dai,
106 int div_id, int div); 107 int div_id, int div);
107 108
108int snd_soc_dai_set_pll(struct snd_soc_dai *dai, 109int snd_soc_dai_set_pll(struct snd_soc_dai *dai,
109 int pll_id, unsigned int freq_in, unsigned int freq_out); 110 int pll_id, int source, unsigned int freq_in, unsigned int freq_out);
110 111
111/* Digital Audio interface formatting */ 112/* Digital Audio interface formatting */
112int snd_soc_dai_set_fmt(struct snd_soc_dai *dai, unsigned int fmt); 113int snd_soc_dai_set_fmt(struct snd_soc_dai *dai, unsigned int fmt);
@@ -114,6 +115,10 @@ int snd_soc_dai_set_fmt(struct snd_soc_dai *dai, unsigned int fmt);
114int snd_soc_dai_set_tdm_slot(struct snd_soc_dai *dai, 115int snd_soc_dai_set_tdm_slot(struct snd_soc_dai *dai,
115 unsigned int tx_mask, unsigned int rx_mask, int slots, int slot_width); 116 unsigned int tx_mask, unsigned int rx_mask, int slots, int slot_width);
116 117
118int snd_soc_dai_set_channel_map(struct snd_soc_dai *dai,
119 unsigned int tx_num, unsigned int *tx_slot,
120 unsigned int rx_num, unsigned int *rx_slot);
121
117int snd_soc_dai_set_tristate(struct snd_soc_dai *dai, int tristate); 122int snd_soc_dai_set_tristate(struct snd_soc_dai *dai, int tristate);
118 123
119/* Digital Audio Interface mute */ 124/* Digital Audio Interface mute */
@@ -136,8 +141,8 @@ struct snd_soc_dai_ops {
136 */ 141 */
137 int (*set_sysclk)(struct snd_soc_dai *dai, 142 int (*set_sysclk)(struct snd_soc_dai *dai,
138 int clk_id, unsigned int freq, int dir); 143 int clk_id, unsigned int freq, int dir);
139 int (*set_pll)(struct snd_soc_dai *dai, 144 int (*set_pll)(struct snd_soc_dai *dai, int pll_id, int source,
140 int pll_id, unsigned int freq_in, unsigned int freq_out); 145 unsigned int freq_in, unsigned int freq_out);
141 int (*set_clkdiv)(struct snd_soc_dai *dai, int div_id, int div); 146 int (*set_clkdiv)(struct snd_soc_dai *dai, int div_id, int div);
142 147
143 /* 148 /*
@@ -148,6 +153,9 @@ struct snd_soc_dai_ops {
148 int (*set_tdm_slot)(struct snd_soc_dai *dai, 153 int (*set_tdm_slot)(struct snd_soc_dai *dai,
149 unsigned int tx_mask, unsigned int rx_mask, 154 unsigned int tx_mask, unsigned int rx_mask,
150 int slots, int slot_width); 155 int slots, int slot_width);
156 int (*set_channel_map)(struct snd_soc_dai *dai,
157 unsigned int tx_num, unsigned int *tx_slot,
158 unsigned int rx_num, unsigned int *rx_slot);
151 int (*set_tristate)(struct snd_soc_dai *dai, int tristate); 159 int (*set_tristate)(struct snd_soc_dai *dai, int tristate);
152 160
153 /* 161 /*
diff --git a/include/sound/soc-dapm.h b/include/sound/soc-dapm.h
index c1410e3191e3..c5c95e1da65b 100644
--- a/include/sound/soc-dapm.h
+++ b/include/sound/soc-dapm.h
@@ -206,6 +206,12 @@
206 .get = snd_soc_dapm_get_enum_double, \ 206 .get = snd_soc_dapm_get_enum_double, \
207 .put = snd_soc_dapm_put_enum_double, \ 207 .put = snd_soc_dapm_put_enum_double, \
208 .private_value = (unsigned long)&xenum } 208 .private_value = (unsigned long)&xenum }
209#define SOC_DAPM_ENUM_VIRT(xname, xenum) \
210{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
211 .info = snd_soc_info_enum_double, \
212 .get = snd_soc_dapm_get_enum_virt, \
213 .put = snd_soc_dapm_put_enum_virt, \
214 .private_value = (unsigned long)&xenum }
209#define SOC_DAPM_VALUE_ENUM(xname, xenum) \ 215#define SOC_DAPM_VALUE_ENUM(xname, xenum) \
210{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ 216{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
211 .info = snd_soc_info_enum_double, \ 217 .info = snd_soc_info_enum_double, \
@@ -260,6 +266,10 @@ int snd_soc_dapm_get_enum_double(struct snd_kcontrol *kcontrol,
260 struct snd_ctl_elem_value *ucontrol); 266 struct snd_ctl_elem_value *ucontrol);
261int snd_soc_dapm_put_enum_double(struct snd_kcontrol *kcontrol, 267int snd_soc_dapm_put_enum_double(struct snd_kcontrol *kcontrol,
262 struct snd_ctl_elem_value *ucontrol); 268 struct snd_ctl_elem_value *ucontrol);
269int snd_soc_dapm_get_enum_virt(struct snd_kcontrol *kcontrol,
270 struct snd_ctl_elem_value *ucontrol);
271int snd_soc_dapm_put_enum_virt(struct snd_kcontrol *kcontrol,
272 struct snd_ctl_elem_value *ucontrol);
263int snd_soc_dapm_get_value_enum_double(struct snd_kcontrol *kcontrol, 273int snd_soc_dapm_get_value_enum_double(struct snd_kcontrol *kcontrol,
264 struct snd_ctl_elem_value *ucontrol); 274 struct snd_ctl_elem_value *ucontrol);
265int snd_soc_dapm_put_value_enum_double(struct snd_kcontrol *kcontrol, 275int snd_soc_dapm_put_value_enum_double(struct snd_kcontrol *kcontrol,
@@ -333,6 +343,10 @@ struct snd_soc_dapm_route {
333 const char *sink; 343 const char *sink;
334 const char *control; 344 const char *control;
335 const char *source; 345 const char *source;
346
347 /* Note: currently only supported for links where source is a supply */
348 int (*connected)(struct snd_soc_dapm_widget *source,
349 struct snd_soc_dapm_widget *sink);
336}; 350};
337 351
338/* dapm audio path between two widgets */ 352/* dapm audio path between two widgets */
@@ -349,6 +363,9 @@ struct snd_soc_dapm_path {
349 u32 connect:1; /* source and sink widgets are connected */ 363 u32 connect:1; /* source and sink widgets are connected */
350 u32 walked:1; /* path has been walked */ 364 u32 walked:1; /* path has been walked */
351 365
366 int (*connected)(struct snd_soc_dapm_widget *source,
367 struct snd_soc_dapm_widget *sink);
368
352 struct list_head list_source; 369 struct list_head list_source;
353 struct list_head list_sink; 370 struct list_head list_sink;
354 struct list_head list; 371 struct list_head list;
diff --git a/include/sound/soc.h b/include/sound/soc.h
index 475cb7ed6bec..0d7718f9280d 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -223,15 +223,15 @@ int snd_soc_codec_set_cache_io(struct snd_soc_codec *codec,
223 int addr_bits, int data_bits, 223 int addr_bits, int data_bits,
224 enum snd_soc_control_type control); 224 enum snd_soc_control_type control);
225 225
226#ifdef CONFIG_PM
227int snd_soc_suspend_device(struct device *dev);
228int snd_soc_resume_device(struct device *dev);
229#endif
230
231/* pcm <-> DAI connect */ 226/* pcm <-> DAI connect */
232void snd_soc_free_pcms(struct snd_soc_device *socdev); 227void snd_soc_free_pcms(struct snd_soc_device *socdev);
233int snd_soc_new_pcms(struct snd_soc_device *socdev, int idx, const char *xid); 228int snd_soc_new_pcms(struct snd_soc_device *socdev, int idx, const char *xid);
234int snd_soc_init_card(struct snd_soc_device *socdev); 229
230/* Utility functions to get clock rates from various things */
231int snd_soc_calc_frame_size(int sample_size, int channels, int tdm_slots);
232int snd_soc_params_to_frame_size(struct snd_pcm_hw_params *params);
233int snd_soc_calc_bclk(int fs, int sample_size, int channels, int tdm_slots);
234int snd_soc_params_to_bclk(struct snd_pcm_hw_params *parms);
235 235
236/* set runtime hw params */ 236/* set runtime hw params */
237int snd_soc_set_runtime_hwparams(struct snd_pcm_substream *substream, 237int snd_soc_set_runtime_hwparams(struct snd_pcm_substream *substream,
@@ -333,6 +333,8 @@ struct snd_soc_jack_gpio {
333 int debounce_time; 333 int debounce_time;
334 struct snd_soc_jack *jack; 334 struct snd_soc_jack *jack;
335 struct work_struct work; 335 struct work_struct work;
336
337 int (*jack_status_check)(void);
336}; 338};
337#endif 339#endif
338 340
@@ -413,6 +415,7 @@ struct snd_soc_codec {
413 unsigned int num_dai; 415 unsigned int num_dai;
414 416
415#ifdef CONFIG_DEBUG_FS 417#ifdef CONFIG_DEBUG_FS
418 struct dentry *debugfs_codec_root;
416 struct dentry *debugfs_reg; 419 struct dentry *debugfs_reg;
417 struct dentry *debugfs_pop_time; 420 struct dentry *debugfs_pop_time;
418 struct dentry *debugfs_dapm; 421 struct dentry *debugfs_dapm;
diff --git a/include/sound/sscape_ioctl.h b/include/sound/sscape_ioctl.h
deleted file mode 100644
index 0d8885969c64..000000000000
--- a/include/sound/sscape_ioctl.h
+++ /dev/null
@@ -1,21 +0,0 @@
1#ifndef SSCAPE_IOCTL_H
2#define SSCAPE_IOCTL_H
3
4
5struct sscape_bootblock
6{
7 unsigned char code[256];
8 unsigned version;
9};
10
11#define SSCAPE_MICROCODE_SIZE 65536
12
13struct sscape_microcode
14{
15 unsigned char __user *code;
16};
17
18#define SND_SSCAPE_LOAD_BOOTB _IOWR('P', 100, struct sscape_bootblock)
19#define SND_SSCAPE_LOAD_MCODE _IOW ('P', 101, struct sscape_microcode)
20
21#endif
diff --git a/include/sound/tlv320dac33-plat.h b/include/sound/tlv320dac33-plat.h
new file mode 100644
index 000000000000..5858d06a7ffa
--- /dev/null
+++ b/include/sound/tlv320dac33-plat.h
@@ -0,0 +1,20 @@
1/*
2 * Platform header for Texas Instruments TLV320DAC33 codec driver
3 *
4 * Author: Peter Ujfalusi <peter.ujfalusi@nokia.com>
5 *
6 * Copyright: (C) 2009 Nokia Corporation
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 */
12
13#ifndef __TLV320DAC33_PLAT_H
14#define __TLV320DAC33_PLAT_H
15
16struct tlv320dac33_platform_data {
17 int power_gpio;
18};
19
20#endif /* __TLV320DAC33_PLAT_H */
diff --git a/include/sound/tpa6130a2-plat.h b/include/sound/tpa6130a2-plat.h
new file mode 100644
index 000000000000..e8c901e749d8
--- /dev/null
+++ b/include/sound/tpa6130a2-plat.h
@@ -0,0 +1,30 @@
1/*
2 * TPA6130A2 driver platform header
3 *
4 * Copyright (C) Nokia Corporation
5 *
6 * Written by Peter Ujfalusi <peter.ujfalusi@nokia.com>
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * version 2 as published by the Free Software Foundation.
11 *
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20 * 02110-1301 USA
21 */
22
23#ifndef TPA6130A2_PLAT_H
24#define TPA6130A2_PLAT_H
25
26struct tpa6130a2_platform_data {
27 int power_gpio;
28};
29
30#endif
diff --git a/include/sound/wss.h b/include/sound/wss.h
index 6d65f322f1d5..fd01f22825cd 100644
--- a/include/sound/wss.h
+++ b/include/sound/wss.h
@@ -154,7 +154,6 @@ int snd_wss_create(struct snd_card *card,
154 unsigned short hardware, 154 unsigned short hardware,
155 unsigned short hwshare, 155 unsigned short hwshare,
156 struct snd_wss **rchip); 156 struct snd_wss **rchip);
157int snd_wss_free(struct snd_wss *chip);
158int snd_wss_pcm(struct snd_wss *chip, int device, struct snd_pcm **rpcm); 157int snd_wss_pcm(struct snd_wss *chip, int device, struct snd_pcm **rpcm);
159int snd_wss_timer(struct snd_wss *chip, int device, struct snd_timer **rtimer); 158int snd_wss_timer(struct snd_wss *chip, int device, struct snd_timer **rtimer);
160int snd_wss_mixer(struct snd_wss *chip); 159int snd_wss_mixer(struct snd_wss *chip);