diff options
Diffstat (limited to 'include/linux')
79 files changed, 1672 insertions, 527 deletions
diff --git a/include/linux/Kbuild b/include/linux/Kbuild index ad99ce9f9169..27b9350052b4 100644 --- a/include/linux/Kbuild +++ b/include/linux/Kbuild | |||
@@ -1,4 +1,5 @@ | |||
1 | header-y += byteorder/ | 1 | header-y += byteorder/ |
2 | header-y += can/ | ||
2 | header-y += dvb/ | 3 | header-y += dvb/ |
3 | header-y += hdlc/ | 4 | header-y += hdlc/ |
4 | header-y += isdn/ | 5 | header-y += isdn/ |
@@ -40,6 +41,7 @@ header-y += baycom.h | |||
40 | header-y += bfs_fs.h | 41 | header-y += bfs_fs.h |
41 | header-y += blkpg.h | 42 | header-y += blkpg.h |
42 | header-y += bpqether.h | 43 | header-y += bpqether.h |
44 | header-y += can.h | ||
43 | header-y += cdk.h | 45 | header-y += cdk.h |
44 | header-y += chio.h | 46 | header-y += chio.h |
45 | header-y += coda_psdev.h | 47 | header-y += coda_psdev.h |
@@ -228,7 +230,6 @@ unifdef-y += if_ltalk.h | |||
228 | unifdef-y += if_link.h | 230 | unifdef-y += if_link.h |
229 | unifdef-y += if_pppol2tp.h | 231 | unifdef-y += if_pppol2tp.h |
230 | unifdef-y += if_pppox.h | 232 | unifdef-y += if_pppox.h |
231 | unifdef-y += if_shaper.h | ||
232 | unifdef-y += if_tr.h | 233 | unifdef-y += if_tr.h |
233 | unifdef-y += if_tun.h | 234 | unifdef-y += if_tun.h |
234 | unifdef-y += if_vlan.h | 235 | unifdef-y += if_vlan.h |
diff --git a/include/linux/atmbr2684.h b/include/linux/atmbr2684.h index 969fb6c9e1cc..52bf72affbba 100644 --- a/include/linux/atmbr2684.h +++ b/include/linux/atmbr2684.h | |||
@@ -14,6 +14,9 @@ | |||
14 | #define BR2684_MEDIA_FDDI (3) | 14 | #define BR2684_MEDIA_FDDI (3) |
15 | #define BR2684_MEDIA_802_6 (4) /* 802.6 */ | 15 | #define BR2684_MEDIA_802_6 (4) /* 802.6 */ |
16 | 16 | ||
17 | /* used only at device creation: */ | ||
18 | #define BR2684_FLAG_ROUTED (1<<16) /* payload is routed, not bridged */ | ||
19 | |||
17 | /* | 20 | /* |
18 | * Is there FCS inbound on this VC? This currently isn't supported. | 21 | * Is there FCS inbound on this VC? This currently isn't supported. |
19 | */ | 22 | */ |
@@ -36,15 +39,22 @@ | |||
36 | #define BR2684_ENCAPS_AUTODETECT (2) /* Unsuported */ | 39 | #define BR2684_ENCAPS_AUTODETECT (2) /* Unsuported */ |
37 | 40 | ||
38 | /* | 41 | /* |
42 | * Is this VC bridged or routed? | ||
43 | */ | ||
44 | |||
45 | #define BR2684_PAYLOAD_ROUTED (0) | ||
46 | #define BR2684_PAYLOAD_BRIDGED (1) | ||
47 | |||
48 | /* | ||
39 | * This is for the ATM_NEWBACKENDIF call - these are like socket families: | 49 | * This is for the ATM_NEWBACKENDIF call - these are like socket families: |
40 | * the first element of the structure is the backend number and the rest | 50 | * the first element of the structure is the backend number and the rest |
41 | * is per-backend specific | 51 | * is per-backend specific |
42 | */ | 52 | */ |
43 | struct atm_newif_br2684 { | 53 | struct atm_newif_br2684 { |
44 | atm_backend_t backend_num; /* ATM_BACKEND_BR2684 */ | 54 | atm_backend_t backend_num; /* ATM_BACKEND_BR2684 */ |
45 | int media; /* BR2684_MEDIA_* */ | 55 | int media; /* BR2684_MEDIA_*, flags in upper bits */ |
46 | char ifname[IFNAMSIZ]; | 56 | char ifname[IFNAMSIZ]; |
47 | int mtu; | 57 | int mtu; |
48 | }; | 58 | }; |
49 | 59 | ||
50 | /* | 60 | /* |
@@ -55,10 +65,10 @@ struct atm_newif_br2684 { | |||
55 | #define BR2684_FIND_BYNUM (1) | 65 | #define BR2684_FIND_BYNUM (1) |
56 | #define BR2684_FIND_BYIFNAME (2) | 66 | #define BR2684_FIND_BYIFNAME (2) |
57 | struct br2684_if_spec { | 67 | struct br2684_if_spec { |
58 | int method; /* BR2684_FIND_* */ | 68 | int method; /* BR2684_FIND_* */ |
59 | union { | 69 | union { |
60 | char ifname[IFNAMSIZ]; | 70 | char ifname[IFNAMSIZ]; |
61 | int devnum; | 71 | int devnum; |
62 | } spec; | 72 | } spec; |
63 | }; | 73 | }; |
64 | 74 | ||
@@ -68,16 +78,16 @@ struct br2684_if_spec { | |||
68 | * is per-backend specific | 78 | * is per-backend specific |
69 | */ | 79 | */ |
70 | struct atm_backend_br2684 { | 80 | struct atm_backend_br2684 { |
71 | atm_backend_t backend_num; /* ATM_BACKEND_BR2684 */ | 81 | atm_backend_t backend_num; /* ATM_BACKEND_BR2684 */ |
72 | struct br2684_if_spec ifspec; | 82 | struct br2684_if_spec ifspec; |
73 | int fcs_in; /* BR2684_FCSIN_* */ | 83 | int fcs_in; /* BR2684_FCSIN_* */ |
74 | int fcs_out; /* BR2684_FCSOUT_* */ | 84 | int fcs_out; /* BR2684_FCSOUT_* */ |
75 | int fcs_auto; /* 1: fcs_{in,out} disabled if no FCS rx'ed */ | 85 | int fcs_auto; /* 1: fcs_{in,out} disabled if no FCS rx'ed */ |
76 | int encaps; /* BR2684_ENCAPS_* */ | 86 | int encaps; /* BR2684_ENCAPS_* */ |
77 | int has_vpiid; /* 1: use vpn_id - Unsupported */ | 87 | int has_vpiid; /* 1: use vpn_id - Unsupported */ |
78 | __u8 vpn_id[7]; | 88 | __u8 vpn_id[7]; |
79 | int send_padding; /* unsupported */ | 89 | int send_padding; /* unsupported */ |
80 | int min_size; /* we will pad smaller packets than this */ | 90 | int min_size; /* we will pad smaller packets than this */ |
81 | }; | 91 | }; |
82 | 92 | ||
83 | /* | 93 | /* |
@@ -86,8 +96,8 @@ struct atm_backend_br2684 { | |||
86 | * efficient per-if in/out filters, this support will be removed | 96 | * efficient per-if in/out filters, this support will be removed |
87 | */ | 97 | */ |
88 | struct br2684_filter { | 98 | struct br2684_filter { |
89 | __be32 prefix; /* network byte order */ | 99 | __be32 prefix; /* network byte order */ |
90 | __be32 netmask; /* 0 = disable filter */ | 100 | __be32 netmask; /* 0 = disable filter */ |
91 | }; | 101 | }; |
92 | 102 | ||
93 | struct br2684_filter_set { | 103 | struct br2684_filter_set { |
@@ -95,6 +105,11 @@ struct br2684_filter_set { | |||
95 | struct br2684_filter filter; | 105 | struct br2684_filter filter; |
96 | }; | 106 | }; |
97 | 107 | ||
108 | enum br2684_payload { | ||
109 | p_routed = BR2684_PAYLOAD_ROUTED, | ||
110 | p_bridged = BR2684_PAYLOAD_BRIDGED, | ||
111 | }; | ||
112 | |||
98 | #define BR2684_SETFILT _IOW( 'a', ATMIOC_BACKEND + 0, \ | 113 | #define BR2684_SETFILT _IOW( 'a', ATMIOC_BACKEND + 0, \ |
99 | struct br2684_filter_set) | 114 | struct br2684_filter_set) |
100 | 115 | ||
diff --git a/include/linux/atmdev.h b/include/linux/atmdev.h index 2096e5c72827..a3d07c29d16c 100644 --- a/include/linux/atmdev.h +++ b/include/linux/atmdev.h | |||
@@ -359,7 +359,7 @@ struct atm_dev { | |||
359 | struct proc_dir_entry *proc_entry; /* proc entry */ | 359 | struct proc_dir_entry *proc_entry; /* proc entry */ |
360 | char *proc_name; /* proc entry name */ | 360 | char *proc_name; /* proc entry name */ |
361 | #endif | 361 | #endif |
362 | struct class_device class_dev; /* sysfs class device */ | 362 | struct device class_dev; /* sysfs device */ |
363 | struct list_head dev_list; /* linkage */ | 363 | struct list_head dev_list; /* linkage */ |
364 | }; | 364 | }; |
365 | 365 | ||
@@ -461,7 +461,7 @@ static inline void atm_dev_put(struct atm_dev *dev) | |||
461 | BUG_ON(!test_bit(ATM_DF_REMOVED, &dev->flags)); | 461 | BUG_ON(!test_bit(ATM_DF_REMOVED, &dev->flags)); |
462 | if (dev->ops->dev_close) | 462 | if (dev->ops->dev_close) |
463 | dev->ops->dev_close(dev); | 463 | dev->ops->dev_close(dev); |
464 | class_device_put(&dev->class_dev); | 464 | put_device(&dev->class_dev); |
465 | } | 465 | } |
466 | } | 466 | } |
467 | 467 | ||
diff --git a/include/linux/can.h b/include/linux/can.h new file mode 100644 index 000000000000..d18333302cbd --- /dev/null +++ b/include/linux/can.h | |||
@@ -0,0 +1,111 @@ | |||
1 | /* | ||
2 | * linux/can.h | ||
3 | * | ||
4 | * Definitions for CAN network layer (socket addr / CAN frame / CAN filter) | ||
5 | * | ||
6 | * Authors: Oliver Hartkopp <oliver.hartkopp@volkswagen.de> | ||
7 | * Urs Thuermann <urs.thuermann@volkswagen.de> | ||
8 | * Copyright (c) 2002-2007 Volkswagen Group Electronic Research | ||
9 | * All rights reserved. | ||
10 | * | ||
11 | * Send feedback to <socketcan-users@lists.berlios.de> | ||
12 | * | ||
13 | */ | ||
14 | |||
15 | #ifndef CAN_H | ||
16 | #define CAN_H | ||
17 | |||
18 | #include <linux/types.h> | ||
19 | #include <linux/socket.h> | ||
20 | |||
21 | /* controller area network (CAN) kernel definitions */ | ||
22 | |||
23 | /* special address description flags for the CAN_ID */ | ||
24 | #define CAN_EFF_FLAG 0x80000000U /* EFF/SFF is set in the MSB */ | ||
25 | #define CAN_RTR_FLAG 0x40000000U /* remote transmission request */ | ||
26 | #define CAN_ERR_FLAG 0x20000000U /* error frame */ | ||
27 | |||
28 | /* valid bits in CAN ID for frame formats */ | ||
29 | #define CAN_SFF_MASK 0x000007FFU /* standard frame format (SFF) */ | ||
30 | #define CAN_EFF_MASK 0x1FFFFFFFU /* extended frame format (EFF) */ | ||
31 | #define CAN_ERR_MASK 0x1FFFFFFFU /* omit EFF, RTR, ERR flags */ | ||
32 | |||
33 | /* | ||
34 | * Controller Area Network Identifier structure | ||
35 | * | ||
36 | * bit 0-28 : CAN identifier (11/29 bit) | ||
37 | * bit 29 : error frame flag (0 = data frame, 1 = error frame) | ||
38 | * bit 30 : remote transmission request flag (1 = rtr frame) | ||
39 | * bit 31 : frame format flag (0 = standard 11 bit, 1 = extended 29 bit) | ||
40 | */ | ||
41 | typedef __u32 canid_t; | ||
42 | |||
43 | /* | ||
44 | * Controller Area Network Error Frame Mask structure | ||
45 | * | ||
46 | * bit 0-28 : error class mask (see include/linux/can/error.h) | ||
47 | * bit 29-31 : set to zero | ||
48 | */ | ||
49 | typedef __u32 can_err_mask_t; | ||
50 | |||
51 | /** | ||
52 | * struct can_frame - basic CAN frame structure | ||
53 | * @can_id: the CAN ID of the frame and CAN_*_FLAG flags, see above. | ||
54 | * @can_dlc: the data length field of the CAN frame | ||
55 | * @data: the CAN frame payload. | ||
56 | */ | ||
57 | struct can_frame { | ||
58 | canid_t can_id; /* 32 bit CAN_ID + EFF/RTR/ERR flags */ | ||
59 | __u8 can_dlc; /* data length code: 0 .. 8 */ | ||
60 | __u8 data[8] __attribute__((aligned(8))); | ||
61 | }; | ||
62 | |||
63 | /* particular protocols of the protocol family PF_CAN */ | ||
64 | #define CAN_RAW 1 /* RAW sockets */ | ||
65 | #define CAN_BCM 2 /* Broadcast Manager */ | ||
66 | #define CAN_TP16 3 /* VAG Transport Protocol v1.6 */ | ||
67 | #define CAN_TP20 4 /* VAG Transport Protocol v2.0 */ | ||
68 | #define CAN_MCNET 5 /* Bosch MCNet */ | ||
69 | #define CAN_ISOTP 6 /* ISO 15765-2 Transport Protocol */ | ||
70 | #define CAN_NPROTO 7 | ||
71 | |||
72 | #define SOL_CAN_BASE 100 | ||
73 | |||
74 | /** | ||
75 | * struct sockaddr_can - the sockaddr structure for CAN sockets | ||
76 | * @can_family: address family number AF_CAN. | ||
77 | * @can_ifindex: CAN network interface index. | ||
78 | * @can_addr: protocol specific address information | ||
79 | */ | ||
80 | struct sockaddr_can { | ||
81 | sa_family_t can_family; | ||
82 | int can_ifindex; | ||
83 | union { | ||
84 | /* transport protocol class address information (e.g. ISOTP) */ | ||
85 | struct { canid_t rx_id, tx_id; } tp; | ||
86 | |||
87 | /* reserved for future CAN protocols address information */ | ||
88 | } can_addr; | ||
89 | }; | ||
90 | |||
91 | /** | ||
92 | * struct can_filter - CAN ID based filter in can_register(). | ||
93 | * @can_id: relevant bits of CAN ID which are not masked out. | ||
94 | * @can_mask: CAN mask (see description) | ||
95 | * | ||
96 | * Description: | ||
97 | * A filter matches, when | ||
98 | * | ||
99 | * <received_can_id> & mask == can_id & mask | ||
100 | * | ||
101 | * The filter can be inverted (CAN_INV_FILTER bit set in can_id) or it can | ||
102 | * filter for error frames (CAN_ERR_FLAG bit set in mask). | ||
103 | */ | ||
104 | struct can_filter { | ||
105 | canid_t can_id; | ||
106 | canid_t can_mask; | ||
107 | }; | ||
108 | |||
109 | #define CAN_INV_FILTER 0x20000000U /* to be set in can_filter.can_id */ | ||
110 | |||
111 | #endif /* CAN_H */ | ||
diff --git a/include/linux/can/Kbuild b/include/linux/can/Kbuild new file mode 100644 index 000000000000..eff898aac02b --- /dev/null +++ b/include/linux/can/Kbuild | |||
@@ -0,0 +1,3 @@ | |||
1 | header-y += raw.h | ||
2 | header-y += bcm.h | ||
3 | header-y += error.h | ||
diff --git a/include/linux/can/bcm.h b/include/linux/can/bcm.h new file mode 100644 index 000000000000..7f293273c444 --- /dev/null +++ b/include/linux/can/bcm.h | |||
@@ -0,0 +1,65 @@ | |||
1 | /* | ||
2 | * linux/can/bcm.h | ||
3 | * | ||
4 | * Definitions for CAN Broadcast Manager (BCM) | ||
5 | * | ||
6 | * Author: Oliver Hartkopp <oliver.hartkopp@volkswagen.de> | ||
7 | * Copyright (c) 2002-2007 Volkswagen Group Electronic Research | ||
8 | * All rights reserved. | ||
9 | * | ||
10 | * Send feedback to <socketcan-users@lists.berlios.de> | ||
11 | * | ||
12 | */ | ||
13 | |||
14 | #ifndef CAN_BCM_H | ||
15 | #define CAN_BCM_H | ||
16 | |||
17 | /** | ||
18 | * struct bcm_msg_head - head of messages to/from the broadcast manager | ||
19 | * @opcode: opcode, see enum below. | ||
20 | * @flags: special flags, see below. | ||
21 | * @count: number of frames to send before changing interval. | ||
22 | * @ival1: interval for the first @count frames. | ||
23 | * @ival2: interval for the following frames. | ||
24 | * @can_id: CAN ID of frames to be sent or received. | ||
25 | * @nframes: number of frames appended to the message head. | ||
26 | * @frames: array of CAN frames. | ||
27 | */ | ||
28 | struct bcm_msg_head { | ||
29 | __u32 opcode; | ||
30 | __u32 flags; | ||
31 | __u32 count; | ||
32 | struct timeval ival1, ival2; | ||
33 | canid_t can_id; | ||
34 | __u32 nframes; | ||
35 | struct can_frame frames[0]; | ||
36 | }; | ||
37 | |||
38 | enum { | ||
39 | TX_SETUP = 1, /* create (cyclic) transmission task */ | ||
40 | TX_DELETE, /* remove (cyclic) transmission task */ | ||
41 | TX_READ, /* read properties of (cyclic) transmission task */ | ||
42 | TX_SEND, /* send one CAN frame */ | ||
43 | RX_SETUP, /* create RX content filter subscription */ | ||
44 | RX_DELETE, /* remove RX content filter subscription */ | ||
45 | RX_READ, /* read properties of RX content filter subscription */ | ||
46 | TX_STATUS, /* reply to TX_READ request */ | ||
47 | TX_EXPIRED, /* notification on performed transmissions (count=0) */ | ||
48 | RX_STATUS, /* reply to RX_READ request */ | ||
49 | RX_TIMEOUT, /* cyclic message is absent */ | ||
50 | RX_CHANGED /* updated CAN frame (detected content change) */ | ||
51 | }; | ||
52 | |||
53 | #define SETTIMER 0x0001 | ||
54 | #define STARTTIMER 0x0002 | ||
55 | #define TX_COUNTEVT 0x0004 | ||
56 | #define TX_ANNOUNCE 0x0008 | ||
57 | #define TX_CP_CAN_ID 0x0010 | ||
58 | #define RX_FILTER_ID 0x0020 | ||
59 | #define RX_CHECK_DLC 0x0040 | ||
60 | #define RX_NO_AUTOTIMER 0x0080 | ||
61 | #define RX_ANNOUNCE_RESUME 0x0100 | ||
62 | #define TX_RESET_MULTI_IDX 0x0200 | ||
63 | #define RX_RTR_FRAME 0x0400 | ||
64 | |||
65 | #endif /* CAN_BCM_H */ | ||
diff --git a/include/linux/can/core.h b/include/linux/can/core.h new file mode 100644 index 000000000000..e9ca210ffa5b --- /dev/null +++ b/include/linux/can/core.h | |||
@@ -0,0 +1,64 @@ | |||
1 | /* | ||
2 | * linux/can/core.h | ||
3 | * | ||
4 | * Protoypes and definitions for CAN protocol modules using the PF_CAN core | ||
5 | * | ||
6 | * Authors: Oliver Hartkopp <oliver.hartkopp@volkswagen.de> | ||
7 | * Urs Thuermann <urs.thuermann@volkswagen.de> | ||
8 | * Copyright (c) 2002-2007 Volkswagen Group Electronic Research | ||
9 | * All rights reserved. | ||
10 | * | ||
11 | * Send feedback to <socketcan-users@lists.berlios.de> | ||
12 | * | ||
13 | */ | ||
14 | |||
15 | #ifndef CAN_CORE_H | ||
16 | #define CAN_CORE_H | ||
17 | |||
18 | #include <linux/can.h> | ||
19 | #include <linux/skbuff.h> | ||
20 | #include <linux/netdevice.h> | ||
21 | |||
22 | #define CAN_VERSION "20071116" | ||
23 | |||
24 | /* increment this number each time you change some user-space interface */ | ||
25 | #define CAN_ABI_VERSION "8" | ||
26 | |||
27 | #define CAN_VERSION_STRING "rev " CAN_VERSION " abi " CAN_ABI_VERSION | ||
28 | |||
29 | #define DNAME(dev) ((dev) ? (dev)->name : "any") | ||
30 | |||
31 | /** | ||
32 | * struct can_proto - CAN protocol structure | ||
33 | * @type: type argument in socket() syscall, e.g. SOCK_DGRAM. | ||
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. | ||
37 | * @prot: pointer to struct proto structure. | ||
38 | */ | ||
39 | struct can_proto { | ||
40 | int type; | ||
41 | int protocol; | ||
42 | int capability; | ||
43 | struct proto_ops *ops; | ||
44 | struct proto *prot; | ||
45 | }; | ||
46 | |||
47 | /* function prototypes for the CAN networklayer core (af_can.c) */ | ||
48 | |||
49 | extern int can_proto_register(struct can_proto *cp); | ||
50 | extern void can_proto_unregister(struct can_proto *cp); | ||
51 | |||
52 | extern int can_rx_register(struct net_device *dev, canid_t can_id, | ||
53 | canid_t mask, | ||
54 | void (*func)(struct sk_buff *, void *), | ||
55 | void *data, char *ident); | ||
56 | |||
57 | extern void can_rx_unregister(struct net_device *dev, canid_t can_id, | ||
58 | canid_t mask, | ||
59 | void (*func)(struct sk_buff *, void *), | ||
60 | void *data); | ||
61 | |||
62 | extern int can_send(struct sk_buff *skb, int loop); | ||
63 | |||
64 | #endif /* CAN_CORE_H */ | ||
diff --git a/include/linux/can/error.h b/include/linux/can/error.h new file mode 100644 index 000000000000..d4127fd9e681 --- /dev/null +++ b/include/linux/can/error.h | |||
@@ -0,0 +1,93 @@ | |||
1 | /* | ||
2 | * linux/can/error.h | ||
3 | * | ||
4 | * Definitions of the CAN error frame to be filtered and passed to the user. | ||
5 | * | ||
6 | * Author: Oliver Hartkopp <oliver.hartkopp@volkswagen.de> | ||
7 | * Copyright (c) 2002-2007 Volkswagen Group Electronic Research | ||
8 | * All rights reserved. | ||
9 | * | ||
10 | * Send feedback to <socketcan-users@lists.berlios.de> | ||
11 | * | ||
12 | */ | ||
13 | |||
14 | #ifndef CAN_ERROR_H | ||
15 | #define CAN_ERROR_H | ||
16 | |||
17 | #define CAN_ERR_DLC 8 /* dlc for error frames */ | ||
18 | |||
19 | /* error class (mask) in can_id */ | ||
20 | #define CAN_ERR_TX_TIMEOUT 0x00000001U /* TX timeout (by netdevice driver) */ | ||
21 | #define CAN_ERR_LOSTARB 0x00000002U /* lost arbitration / data[0] */ | ||
22 | #define CAN_ERR_CRTL 0x00000004U /* controller problems / data[1] */ | ||
23 | #define CAN_ERR_PROT 0x00000008U /* protocol violations / data[2..3] */ | ||
24 | #define CAN_ERR_TRX 0x00000010U /* transceiver status / data[4] */ | ||
25 | #define CAN_ERR_ACK 0x00000020U /* received no ACK on transmission */ | ||
26 | #define CAN_ERR_BUSOFF 0x00000040U /* bus off */ | ||
27 | #define CAN_ERR_BUSERROR 0x00000080U /* bus error (may flood!) */ | ||
28 | #define CAN_ERR_RESTARTED 0x00000100U /* controller restarted */ | ||
29 | |||
30 | /* arbitration lost in bit ... / data[0] */ | ||
31 | #define CAN_ERR_LOSTARB_UNSPEC 0x00 /* unspecified */ | ||
32 | /* else bit number in bitstream */ | ||
33 | |||
34 | /* error status of CAN-controller / data[1] */ | ||
35 | #define CAN_ERR_CRTL_UNSPEC 0x00 /* unspecified */ | ||
36 | #define CAN_ERR_CRTL_RX_OVERFLOW 0x01 /* RX buffer overflow */ | ||
37 | #define CAN_ERR_CRTL_TX_OVERFLOW 0x02 /* TX buffer overflow */ | ||
38 | #define CAN_ERR_CRTL_RX_WARNING 0x04 /* reached warning level for RX errors */ | ||
39 | #define CAN_ERR_CRTL_TX_WARNING 0x08 /* reached warning level for TX errors */ | ||
40 | #define CAN_ERR_CRTL_RX_PASSIVE 0x10 /* reached error passive status RX */ | ||
41 | #define CAN_ERR_CRTL_TX_PASSIVE 0x20 /* reached error passive status TX */ | ||
42 | /* (at least one error counter exceeds */ | ||
43 | /* the protocol-defined level of 127) */ | ||
44 | |||
45 | /* error in CAN protocol (type) / data[2] */ | ||
46 | #define CAN_ERR_PROT_UNSPEC 0x00 /* unspecified */ | ||
47 | #define CAN_ERR_PROT_BIT 0x01 /* single bit error */ | ||
48 | #define CAN_ERR_PROT_FORM 0x02 /* frame format error */ | ||
49 | #define CAN_ERR_PROT_STUFF 0x04 /* bit stuffing error */ | ||
50 | #define CAN_ERR_PROT_BIT0 0x08 /* unable to send dominant bit */ | ||
51 | #define CAN_ERR_PROT_BIT1 0x10 /* unable to send recessive bit */ | ||
52 | #define CAN_ERR_PROT_OVERLOAD 0x20 /* bus overload */ | ||
53 | #define CAN_ERR_PROT_ACTIVE 0x40 /* active error announcement */ | ||
54 | #define CAN_ERR_PROT_TX 0x80 /* error occured on transmission */ | ||
55 | |||
56 | /* error in CAN protocol (location) / data[3] */ | ||
57 | #define CAN_ERR_PROT_LOC_UNSPEC 0x00 /* unspecified */ | ||
58 | #define CAN_ERR_PROT_LOC_SOF 0x03 /* start of frame */ | ||
59 | #define CAN_ERR_PROT_LOC_ID28_21 0x02 /* ID bits 28 - 21 (SFF: 10 - 3) */ | ||
60 | #define CAN_ERR_PROT_LOC_ID20_18 0x06 /* ID bits 20 - 18 (SFF: 2 - 0 )*/ | ||
61 | #define CAN_ERR_PROT_LOC_SRTR 0x04 /* substitute RTR (SFF: RTR) */ | ||
62 | #define CAN_ERR_PROT_LOC_IDE 0x05 /* identifier extension */ | ||
63 | #define CAN_ERR_PROT_LOC_ID17_13 0x07 /* ID bits 17-13 */ | ||
64 | #define CAN_ERR_PROT_LOC_ID12_05 0x0F /* ID bits 12-5 */ | ||
65 | #define CAN_ERR_PROT_LOC_ID04_00 0x0E /* ID bits 4-0 */ | ||
66 | #define CAN_ERR_PROT_LOC_RTR 0x0C /* RTR */ | ||
67 | #define CAN_ERR_PROT_LOC_RES1 0x0D /* reserved bit 1 */ | ||
68 | #define CAN_ERR_PROT_LOC_RES0 0x09 /* reserved bit 0 */ | ||
69 | #define CAN_ERR_PROT_LOC_DLC 0x0B /* data length code */ | ||
70 | #define CAN_ERR_PROT_LOC_DATA 0x0A /* data section */ | ||
71 | #define CAN_ERR_PROT_LOC_CRC_SEQ 0x08 /* CRC sequence */ | ||
72 | #define CAN_ERR_PROT_LOC_CRC_DEL 0x18 /* CRC delimiter */ | ||
73 | #define CAN_ERR_PROT_LOC_ACK 0x19 /* ACK slot */ | ||
74 | #define CAN_ERR_PROT_LOC_ACK_DEL 0x1B /* ACK delimiter */ | ||
75 | #define CAN_ERR_PROT_LOC_EOF 0x1A /* end of frame */ | ||
76 | #define CAN_ERR_PROT_LOC_INTERM 0x12 /* intermission */ | ||
77 | |||
78 | /* error status of CAN-transceiver / data[4] */ | ||
79 | /* CANH CANL */ | ||
80 | #define CAN_ERR_TRX_UNSPEC 0x00 /* 0000 0000 */ | ||
81 | #define CAN_ERR_TRX_CANH_NO_WIRE 0x04 /* 0000 0100 */ | ||
82 | #define CAN_ERR_TRX_CANH_SHORT_TO_BAT 0x05 /* 0000 0101 */ | ||
83 | #define CAN_ERR_TRX_CANH_SHORT_TO_VCC 0x06 /* 0000 0110 */ | ||
84 | #define CAN_ERR_TRX_CANH_SHORT_TO_GND 0x07 /* 0000 0111 */ | ||
85 | #define CAN_ERR_TRX_CANL_NO_WIRE 0x40 /* 0100 0000 */ | ||
86 | #define CAN_ERR_TRX_CANL_SHORT_TO_BAT 0x50 /* 0101 0000 */ | ||
87 | #define CAN_ERR_TRX_CANL_SHORT_TO_VCC 0x60 /* 0110 0000 */ | ||
88 | #define CAN_ERR_TRX_CANL_SHORT_TO_GND 0x70 /* 0111 0000 */ | ||
89 | #define CAN_ERR_TRX_CANL_SHORT_TO_CANH 0x80 /* 1000 0000 */ | ||
90 | |||
91 | /* controller specific additional information / data[5..7] */ | ||
92 | |||
93 | #endif /* CAN_ERROR_H */ | ||
diff --git a/include/linux/can/raw.h b/include/linux/can/raw.h new file mode 100644 index 000000000000..b2a0f87492c5 --- /dev/null +++ b/include/linux/can/raw.h | |||
@@ -0,0 +1,31 @@ | |||
1 | /* | ||
2 | * linux/can/raw.h | ||
3 | * | ||
4 | * Definitions for raw CAN sockets | ||
5 | * | ||
6 | * Authors: Oliver Hartkopp <oliver.hartkopp@volkswagen.de> | ||
7 | * Urs Thuermann <urs.thuermann@volkswagen.de> | ||
8 | * Copyright (c) 2002-2007 Volkswagen Group Electronic Research | ||
9 | * All rights reserved. | ||
10 | * | ||
11 | * Send feedback to <socketcan-users@lists.berlios.de> | ||
12 | * | ||
13 | */ | ||
14 | |||
15 | #ifndef CAN_RAW_H | ||
16 | #define CAN_RAW_H | ||
17 | |||
18 | #include <linux/can.h> | ||
19 | |||
20 | #define SOL_CAN_RAW (SOL_CAN_BASE + CAN_RAW) | ||
21 | |||
22 | /* for socket options affecting the socket (not the global system) */ | ||
23 | |||
24 | enum { | ||
25 | CAN_RAW_FILTER = 1, /* set 0 .. n can_filter(s) */ | ||
26 | CAN_RAW_ERR_FILTER, /* set filter for error frames */ | ||
27 | CAN_RAW_LOOPBACK, /* local loopback (default:on) */ | ||
28 | CAN_RAW_RECV_OWN_MSGS /* receive my own msgs (default:off) */ | ||
29 | }; | ||
30 | |||
31 | #endif | ||
diff --git a/include/linux/connector.h b/include/linux/connector.h index 13fc4541bf23..da6dd957f908 100644 --- a/include/linux/connector.h +++ b/include/linux/connector.h | |||
@@ -112,7 +112,6 @@ struct cn_queue_dev { | |||
112 | struct list_head queue_list; | 112 | struct list_head queue_list; |
113 | spinlock_t queue_lock; | 113 | spinlock_t queue_lock; |
114 | 114 | ||
115 | int netlink_groups; | ||
116 | struct sock *nls; | 115 | struct sock *nls; |
117 | }; | 116 | }; |
118 | 117 | ||
@@ -133,15 +132,13 @@ struct cn_callback_data { | |||
133 | 132 | ||
134 | struct cn_callback_entry { | 133 | struct cn_callback_entry { |
135 | struct list_head callback_entry; | 134 | struct list_head callback_entry; |
136 | struct cn_callback *cb; | ||
137 | struct work_struct work; | 135 | struct work_struct work; |
138 | struct cn_queue_dev *pdev; | 136 | struct cn_queue_dev *pdev; |
139 | 137 | ||
140 | struct cn_callback_id id; | 138 | struct cn_callback_id id; |
141 | struct cn_callback_data data; | 139 | struct cn_callback_data data; |
142 | 140 | ||
143 | int seq, group; | 141 | u32 seq, group; |
144 | struct sock *nls; | ||
145 | }; | 142 | }; |
146 | 143 | ||
147 | struct cn_ctl_entry { | 144 | struct cn_ctl_entry { |
diff --git a/include/linux/dccp.h b/include/linux/dccp.h index 333c3ea82a5d..484e45c7c89a 100644 --- a/include/linux/dccp.h +++ b/include/linux/dccp.h | |||
@@ -205,6 +205,7 @@ struct dccp_so_feat { | |||
205 | #define DCCP_SOCKOPT_CHANGE_L 3 | 205 | #define DCCP_SOCKOPT_CHANGE_L 3 |
206 | #define DCCP_SOCKOPT_CHANGE_R 4 | 206 | #define DCCP_SOCKOPT_CHANGE_R 4 |
207 | #define DCCP_SOCKOPT_GET_CUR_MPS 5 | 207 | #define DCCP_SOCKOPT_GET_CUR_MPS 5 |
208 | #define DCCP_SOCKOPT_SERVER_TIMEWAIT 6 | ||
208 | #define DCCP_SOCKOPT_SEND_CSCOV 10 | 209 | #define DCCP_SOCKOPT_SEND_CSCOV 10 |
209 | #define DCCP_SOCKOPT_RECV_CSCOV 11 | 210 | #define DCCP_SOCKOPT_RECV_CSCOV 11 |
210 | #define DCCP_SOCKOPT_CCID_RX_INFO 128 | 211 | #define DCCP_SOCKOPT_CCID_RX_INFO 128 |
@@ -227,37 +228,50 @@ struct dccp_so_feat { | |||
227 | #include <net/tcp_states.h> | 228 | #include <net/tcp_states.h> |
228 | 229 | ||
229 | enum dccp_state { | 230 | enum dccp_state { |
230 | DCCP_OPEN = TCP_ESTABLISHED, | 231 | DCCP_OPEN = TCP_ESTABLISHED, |
231 | DCCP_REQUESTING = TCP_SYN_SENT, | 232 | DCCP_REQUESTING = TCP_SYN_SENT, |
232 | DCCP_PARTOPEN = TCP_FIN_WAIT1, /* FIXME: | 233 | DCCP_LISTEN = TCP_LISTEN, |
233 | This mapping is horrible, but TCP has | 234 | DCCP_RESPOND = TCP_SYN_RECV, |
234 | no matching state for DCCP_PARTOPEN, | 235 | /* |
235 | as TCP_SYN_RECV is already used by | 236 | * States involved in closing a DCCP connection: |
236 | DCCP_RESPOND, why don't stop using TCP | 237 | * 1) ACTIVE_CLOSEREQ is entered by a server sending a CloseReq. |
237 | mapping of states? OK, now we don't use | 238 | * |
238 | sk_stream_sendmsg anymore, so doesn't | 239 | * 2) CLOSING can have three different meanings (RFC 4340, 8.3): |
239 | seem to exist any reason for us to | 240 | * a. Client has performed active-close, has sent a Close to the server |
240 | do the TCP mapping here */ | 241 | * from state OPEN or PARTOPEN, and is waiting for the final Reset |
241 | DCCP_LISTEN = TCP_LISTEN, | 242 | * (in this case, SOCK_DONE == 1). |
242 | DCCP_RESPOND = TCP_SYN_RECV, | 243 | * b. Client is asked to perform passive-close, by receiving a CloseReq |
243 | DCCP_CLOSING = TCP_CLOSING, | 244 | * in (PART)OPEN state. It sends a Close and waits for final Reset |
244 | DCCP_TIME_WAIT = TCP_TIME_WAIT, | 245 | * (in this case, SOCK_DONE == 0). |
245 | DCCP_CLOSED = TCP_CLOSE, | 246 | * c. Server performs an active-close as in (a), keeps TIMEWAIT state. |
246 | DCCP_MAX_STATES = TCP_MAX_STATES, | 247 | * |
248 | * 3) The following intermediate states are employed to give passively | ||
249 | * closing nodes a chance to process their unread data: | ||
250 | * - PASSIVE_CLOSE (from OPEN => CLOSED) and | ||
251 | * - PASSIVE_CLOSEREQ (from (PART)OPEN to CLOSING; case (b) above). | ||
252 | */ | ||
253 | DCCP_ACTIVE_CLOSEREQ = TCP_FIN_WAIT1, | ||
254 | DCCP_PASSIVE_CLOSE = TCP_CLOSE_WAIT, /* any node receiving a Close */ | ||
255 | DCCP_CLOSING = TCP_CLOSING, | ||
256 | DCCP_TIME_WAIT = TCP_TIME_WAIT, | ||
257 | DCCP_CLOSED = TCP_CLOSE, | ||
258 | DCCP_PARTOPEN = TCP_MAX_STATES, | ||
259 | DCCP_PASSIVE_CLOSEREQ, /* clients receiving CloseReq */ | ||
260 | DCCP_MAX_STATES | ||
247 | }; | 261 | }; |
248 | 262 | ||
249 | #define DCCP_STATE_MASK 0xf | 263 | #define DCCP_STATE_MASK 0x1f |
250 | #define DCCP_ACTION_FIN (1<<7) | ||
251 | 264 | ||
252 | enum { | 265 | enum { |
253 | DCCPF_OPEN = TCPF_ESTABLISHED, | 266 | DCCPF_OPEN = TCPF_ESTABLISHED, |
254 | DCCPF_REQUESTING = TCPF_SYN_SENT, | 267 | DCCPF_REQUESTING = TCPF_SYN_SENT, |
255 | DCCPF_PARTOPEN = TCPF_FIN_WAIT1, | 268 | DCCPF_LISTEN = TCPF_LISTEN, |
256 | DCCPF_LISTEN = TCPF_LISTEN, | 269 | DCCPF_RESPOND = TCPF_SYN_RECV, |
257 | DCCPF_RESPOND = TCPF_SYN_RECV, | 270 | DCCPF_ACTIVE_CLOSEREQ = TCPF_FIN_WAIT1, |
258 | DCCPF_CLOSING = TCPF_CLOSING, | 271 | DCCPF_CLOSING = TCPF_CLOSING, |
259 | DCCPF_TIME_WAIT = TCPF_TIME_WAIT, | 272 | DCCPF_TIME_WAIT = TCPF_TIME_WAIT, |
260 | DCCPF_CLOSED = TCPF_CLOSE, | 273 | DCCPF_CLOSED = TCPF_CLOSE, |
274 | DCCPF_PARTOPEN = (1 << DCCP_PARTOPEN), | ||
261 | }; | 275 | }; |
262 | 276 | ||
263 | static inline struct dccp_hdr *dccp_hdr(const struct sk_buff *skb) | 277 | static inline struct dccp_hdr *dccp_hdr(const struct sk_buff *skb) |
@@ -393,13 +407,23 @@ struct dccp_opt_pend { | |||
393 | 407 | ||
394 | extern void dccp_minisock_init(struct dccp_minisock *dmsk); | 408 | extern void dccp_minisock_init(struct dccp_minisock *dmsk); |
395 | 409 | ||
396 | extern int dccp_parse_options(struct sock *sk, struct sk_buff *skb); | 410 | /** |
397 | 411 | * struct dccp_request_sock - represent DCCP-specific connection request | |
412 | * @dreq_inet_rsk: structure inherited from | ||
413 | * @dreq_iss: initial sequence number sent on the Response (RFC 4340, 7.1) | ||
414 | * @dreq_isr: initial sequence number received on the Request | ||
415 | * @dreq_service: service code present on the Request (there is just one) | ||
416 | * The following two fields are analogous to the ones in dccp_sock: | ||
417 | * @dreq_timestamp_echo: last received timestamp to echo (13.1) | ||
418 | * @dreq_timestamp_echo: the time of receiving the last @dreq_timestamp_echo | ||
419 | */ | ||
398 | struct dccp_request_sock { | 420 | struct dccp_request_sock { |
399 | struct inet_request_sock dreq_inet_rsk; | 421 | struct inet_request_sock dreq_inet_rsk; |
400 | __u64 dreq_iss; | 422 | __u64 dreq_iss; |
401 | __u64 dreq_isr; | 423 | __u64 dreq_isr; |
402 | __be32 dreq_service; | 424 | __be32 dreq_service; |
425 | __u32 dreq_timestamp_echo; | ||
426 | __u32 dreq_timestamp_time; | ||
403 | }; | 427 | }; |
404 | 428 | ||
405 | static inline struct dccp_request_sock *dccp_rsk(const struct request_sock *req) | 429 | static inline struct dccp_request_sock *dccp_rsk(const struct request_sock *req) |
@@ -409,6 +433,9 @@ static inline struct dccp_request_sock *dccp_rsk(const struct request_sock *req) | |||
409 | 433 | ||
410 | extern struct inet_timewait_death_row dccp_death_row; | 434 | extern struct inet_timewait_death_row dccp_death_row; |
411 | 435 | ||
436 | extern int dccp_parse_options(struct sock *sk, struct dccp_request_sock *dreq, | ||
437 | struct sk_buff *skb); | ||
438 | |||
412 | struct dccp_options_received { | 439 | struct dccp_options_received { |
413 | u32 dccpor_ndp; /* only 24 bits */ | 440 | u32 dccpor_ndp; /* only 24 bits */ |
414 | u32 dccpor_timestamp; | 441 | u32 dccpor_timestamp; |
@@ -462,8 +489,8 @@ struct dccp_ackvec; | |||
462 | * @dccps_gar - greatest valid ack number received on a non-Sync; initialized to %dccps_iss | 489 | * @dccps_gar - greatest valid ack number received on a non-Sync; initialized to %dccps_iss |
463 | * @dccps_service - first (passive sock) or unique (active sock) service code | 490 | * @dccps_service - first (passive sock) or unique (active sock) service code |
464 | * @dccps_service_list - second .. last service code on passive socket | 491 | * @dccps_service_list - second .. last service code on passive socket |
465 | * @dccps_timestamp_time - time of latest TIMESTAMP option | ||
466 | * @dccps_timestamp_echo - latest timestamp received on a TIMESTAMP option | 492 | * @dccps_timestamp_echo - latest timestamp received on a TIMESTAMP option |
493 | * @dccps_timestamp_time - time of receiving latest @dccps_timestamp_echo | ||
467 | * @dccps_l_ack_ratio - feature-local Ack Ratio | 494 | * @dccps_l_ack_ratio - feature-local Ack Ratio |
468 | * @dccps_r_ack_ratio - feature-remote Ack Ratio | 495 | * @dccps_r_ack_ratio - feature-remote Ack Ratio |
469 | * @dccps_pcslen - sender partial checksum coverage (via sockopt) | 496 | * @dccps_pcslen - sender partial checksum coverage (via sockopt) |
@@ -479,6 +506,7 @@ struct dccp_ackvec; | |||
479 | * @dccps_role - role of this sock, one of %dccp_role | 506 | * @dccps_role - role of this sock, one of %dccp_role |
480 | * @dccps_hc_rx_insert_options - receiver wants to add options when acking | 507 | * @dccps_hc_rx_insert_options - receiver wants to add options when acking |
481 | * @dccps_hc_tx_insert_options - sender wants to add options when sending | 508 | * @dccps_hc_tx_insert_options - sender wants to add options when sending |
509 | * @dccps_server_timewait - server holds timewait state on close (RFC 4340, 8.3) | ||
482 | * @dccps_xmit_timer - timer for when CCID is not ready to send | 510 | * @dccps_xmit_timer - timer for when CCID is not ready to send |
483 | * @dccps_syn_rtt - RTT sample from Request/Response exchange (in usecs) | 511 | * @dccps_syn_rtt - RTT sample from Request/Response exchange (in usecs) |
484 | */ | 512 | */ |
@@ -498,8 +526,8 @@ struct dccp_sock { | |||
498 | __u64 dccps_gar; | 526 | __u64 dccps_gar; |
499 | __be32 dccps_service; | 527 | __be32 dccps_service; |
500 | struct dccp_service_list *dccps_service_list; | 528 | struct dccp_service_list *dccps_service_list; |
501 | ktime_t dccps_timestamp_time; | ||
502 | __u32 dccps_timestamp_echo; | 529 | __u32 dccps_timestamp_echo; |
530 | __u32 dccps_timestamp_time; | ||
503 | __u16 dccps_l_ack_ratio; | 531 | __u16 dccps_l_ack_ratio; |
504 | __u16 dccps_r_ack_ratio; | 532 | __u16 dccps_r_ack_ratio; |
505 | __u16 dccps_pcslen; | 533 | __u16 dccps_pcslen; |
@@ -515,6 +543,7 @@ struct dccp_sock { | |||
515 | enum dccp_role dccps_role:2; | 543 | enum dccp_role dccps_role:2; |
516 | __u8 dccps_hc_rx_insert_options:1; | 544 | __u8 dccps_hc_rx_insert_options:1; |
517 | __u8 dccps_hc_tx_insert_options:1; | 545 | __u8 dccps_hc_tx_insert_options:1; |
546 | __u8 dccps_server_timewait:1; | ||
518 | struct timer_list dccps_xmit_timer; | 547 | struct timer_list dccps_xmit_timer; |
519 | }; | 548 | }; |
520 | 549 | ||
diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h index 30621c27159f..5de6d911cdf7 100644 --- a/include/linux/ieee80211.h +++ b/include/linux/ieee80211.h | |||
@@ -54,6 +54,8 @@ | |||
54 | #define IEEE80211_STYPE_ACTION 0x00D0 | 54 | #define IEEE80211_STYPE_ACTION 0x00D0 |
55 | 55 | ||
56 | /* control */ | 56 | /* control */ |
57 | #define IEEE80211_STYPE_BACK_REQ 0x0080 | ||
58 | #define IEEE80211_STYPE_BACK 0x0090 | ||
57 | #define IEEE80211_STYPE_PSPOLL 0x00A0 | 59 | #define IEEE80211_STYPE_PSPOLL 0x00A0 |
58 | #define IEEE80211_STYPE_RTS 0x00B0 | 60 | #define IEEE80211_STYPE_RTS 0x00B0 |
59 | #define IEEE80211_STYPE_CTS 0x00C0 | 61 | #define IEEE80211_STYPE_CTS 0x00C0 |
@@ -81,18 +83,18 @@ | |||
81 | 83 | ||
82 | 84 | ||
83 | /* miscellaneous IEEE 802.11 constants */ | 85 | /* miscellaneous IEEE 802.11 constants */ |
84 | #define IEEE80211_MAX_FRAG_THRESHOLD 2346 | 86 | #define IEEE80211_MAX_FRAG_THRESHOLD 2352 |
85 | #define IEEE80211_MAX_RTS_THRESHOLD 2347 | 87 | #define IEEE80211_MAX_RTS_THRESHOLD 2353 |
86 | #define IEEE80211_MAX_AID 2007 | 88 | #define IEEE80211_MAX_AID 2007 |
87 | #define IEEE80211_MAX_TIM_LEN 251 | 89 | #define IEEE80211_MAX_TIM_LEN 251 |
88 | #define IEEE80211_MAX_DATA_LEN 2304 | ||
89 | /* Maximum size for the MA-UNITDATA primitive, 802.11 standard section | 90 | /* Maximum size for the MA-UNITDATA primitive, 802.11 standard section |
90 | 6.2.1.1.2. | 91 | 6.2.1.1.2. |
91 | 92 | ||
92 | The figure in section 7.1.2 suggests a body size of up to 2312 | 93 | 802.11e clarifies the figure in section 7.1.2. The frame body is |
93 | bytes is allowed, which is a bit confusing, I suspect this | 94 | up to 2304 octets long (maximum MSDU size) plus any crypt overhead. */ |
94 | represents the 2304 bytes of real data, plus a possible 8 bytes of | 95 | #define IEEE80211_MAX_DATA_LEN 2304 |
95 | WEP IV and ICV. (this interpretation suggested by Ramiro Barreiro) */ | 96 | /* 30 byte 4 addr hdr, 2 byte QoS, 2304 byte MSDU, 12 byte crypt, 4 byte FCS */ |
97 | #define IEEE80211_MAX_FRAME_LEN 2352 | ||
96 | 98 | ||
97 | #define IEEE80211_MAX_SSID_LEN 32 | 99 | #define IEEE80211_MAX_SSID_LEN 32 |
98 | 100 | ||
@@ -185,6 +187,25 @@ struct ieee80211_mgmt { | |||
185 | u8 new_chan; | 187 | u8 new_chan; |
186 | u8 switch_count; | 188 | u8 switch_count; |
187 | } __attribute__((packed)) chan_switch; | 189 | } __attribute__((packed)) chan_switch; |
190 | struct{ | ||
191 | u8 action_code; | ||
192 | u8 dialog_token; | ||
193 | __le16 capab; | ||
194 | __le16 timeout; | ||
195 | __le16 start_seq_num; | ||
196 | } __attribute__((packed)) addba_req; | ||
197 | struct{ | ||
198 | u8 action_code; | ||
199 | u8 dialog_token; | ||
200 | __le16 status; | ||
201 | __le16 capab; | ||
202 | __le16 timeout; | ||
203 | } __attribute__((packed)) addba_resp; | ||
204 | struct{ | ||
205 | u8 action_code; | ||
206 | __le16 params; | ||
207 | __le16 reason_code; | ||
208 | } __attribute__((packed)) delba; | ||
188 | } u; | 209 | } u; |
189 | } __attribute__ ((packed)) action; | 210 | } __attribute__ ((packed)) action; |
190 | } u; | 211 | } u; |
@@ -205,6 +226,66 @@ struct ieee80211_cts { | |||
205 | u8 ra[6]; | 226 | u8 ra[6]; |
206 | } __attribute__ ((packed)); | 227 | } __attribute__ ((packed)); |
207 | 228 | ||
229 | /** | ||
230 | * struct ieee80211_bar - HT Block Ack Request | ||
231 | * | ||
232 | * This structure refers to "HT BlockAckReq" as | ||
233 | * described in 802.11n draft section 7.2.1.7.1 | ||
234 | */ | ||
235 | struct ieee80211_bar { | ||
236 | __le16 frame_control; | ||
237 | __le16 duration; | ||
238 | __u8 ra[6]; | ||
239 | __u8 ta[6]; | ||
240 | __le16 control; | ||
241 | __le16 start_seq_num; | ||
242 | } __attribute__((packed)); | ||
243 | |||
244 | /** | ||
245 | * struct ieee80211_ht_cap - HT capabilities | ||
246 | * | ||
247 | * This structure refers to "HT capabilities element" as | ||
248 | * described in 802.11n draft section 7.3.2.52 | ||
249 | */ | ||
250 | struct ieee80211_ht_cap { | ||
251 | __le16 cap_info; | ||
252 | u8 ampdu_params_info; | ||
253 | u8 supp_mcs_set[16]; | ||
254 | __le16 extended_ht_cap_info; | ||
255 | __le32 tx_BF_cap_info; | ||
256 | u8 antenna_selection_info; | ||
257 | } __attribute__ ((packed)); | ||
258 | |||
259 | /** | ||
260 | * struct ieee80211_ht_cap - HT additional information | ||
261 | * | ||
262 | * This structure refers to "HT information element" as | ||
263 | * described in 802.11n draft section 7.3.2.53 | ||
264 | */ | ||
265 | struct ieee80211_ht_addt_info { | ||
266 | u8 control_chan; | ||
267 | u8 ht_param; | ||
268 | __le16 operation_mode; | ||
269 | __le16 stbc_param; | ||
270 | u8 basic_set[16]; | ||
271 | } __attribute__ ((packed)); | ||
272 | |||
273 | /* 802.11n HT capabilities masks */ | ||
274 | #define IEEE80211_HT_CAP_SUP_WIDTH 0x0002 | ||
275 | #define IEEE80211_HT_CAP_MIMO_PS 0x000C | ||
276 | #define IEEE80211_HT_CAP_GRN_FLD 0x0010 | ||
277 | #define IEEE80211_HT_CAP_SGI_20 0x0020 | ||
278 | #define IEEE80211_HT_CAP_SGI_40 0x0040 | ||
279 | #define IEEE80211_HT_CAP_DELAY_BA 0x0400 | ||
280 | #define IEEE80211_HT_CAP_MAX_AMSDU 0x0800 | ||
281 | #define IEEE80211_HT_CAP_AMPDU_FACTOR 0x03 | ||
282 | #define IEEE80211_HT_CAP_AMPDU_DENSITY 0x1C | ||
283 | /* 802.11n HT IE masks */ | ||
284 | #define IEEE80211_HT_IE_CHA_SEC_OFFSET 0x03 | ||
285 | #define IEEE80211_HT_IE_CHA_WIDTH 0x04 | ||
286 | #define IEEE80211_HT_IE_HT_PROTECTION 0x0003 | ||
287 | #define IEEE80211_HT_IE_NON_GF_STA_PRSNT 0x0004 | ||
288 | #define IEEE80211_HT_IE_NON_HT_STA_PRSNT 0x0010 | ||
208 | 289 | ||
209 | /* Authentication algorithms */ | 290 | /* Authentication algorithms */ |
210 | #define WLAN_AUTH_OPEN 0 | 291 | #define WLAN_AUTH_OPEN 0 |
@@ -271,6 +352,18 @@ enum ieee80211_statuscode { | |||
271 | WLAN_STATUS_UNSUPP_RSN_VERSION = 44, | 352 | WLAN_STATUS_UNSUPP_RSN_VERSION = 44, |
272 | WLAN_STATUS_INVALID_RSN_IE_CAP = 45, | 353 | WLAN_STATUS_INVALID_RSN_IE_CAP = 45, |
273 | WLAN_STATUS_CIPHER_SUITE_REJECTED = 46, | 354 | WLAN_STATUS_CIPHER_SUITE_REJECTED = 46, |
355 | /* 802.11e */ | ||
356 | WLAN_STATUS_UNSPECIFIED_QOS = 32, | ||
357 | WLAN_STATUS_ASSOC_DENIED_NOBANDWIDTH = 33, | ||
358 | WLAN_STATUS_ASSOC_DENIED_LOWACK = 34, | ||
359 | WLAN_STATUS_ASSOC_DENIED_UNSUPP_QOS = 35, | ||
360 | WLAN_STATUS_REQUEST_DECLINED = 37, | ||
361 | WLAN_STATUS_INVALID_QOS_PARAM = 38, | ||
362 | WLAN_STATUS_CHANGE_TSPEC = 39, | ||
363 | WLAN_STATUS_WAIT_TS_DELAY = 47, | ||
364 | WLAN_STATUS_NO_DIRECT_LINK = 48, | ||
365 | WLAN_STATUS_STA_NOT_PRESENT = 49, | ||
366 | WLAN_STATUS_STA_NOT_QSTA = 50, | ||
274 | }; | 367 | }; |
275 | 368 | ||
276 | 369 | ||
@@ -301,6 +394,16 @@ enum ieee80211_reasoncode { | |||
301 | WLAN_REASON_INVALID_RSN_IE_CAP = 22, | 394 | WLAN_REASON_INVALID_RSN_IE_CAP = 22, |
302 | WLAN_REASON_IEEE8021X_FAILED = 23, | 395 | WLAN_REASON_IEEE8021X_FAILED = 23, |
303 | WLAN_REASON_CIPHER_SUITE_REJECTED = 24, | 396 | WLAN_REASON_CIPHER_SUITE_REJECTED = 24, |
397 | /* 802.11e */ | ||
398 | WLAN_REASON_DISASSOC_UNSPECIFIED_QOS = 32, | ||
399 | WLAN_REASON_DISASSOC_QAP_NO_BANDWIDTH = 33, | ||
400 | WLAN_REASON_DISASSOC_LOW_ACK = 34, | ||
401 | WLAN_REASON_DISASSOC_QAP_EXCEED_TXOP = 35, | ||
402 | WLAN_REASON_QSTA_LEAVE_QBSS = 36, | ||
403 | WLAN_REASON_QSTA_NOT_USE = 37, | ||
404 | WLAN_REASON_QSTA_REQUIRE_SETUP = 38, | ||
405 | WLAN_REASON_QSTA_TIMEOUT = 39, | ||
406 | WLAN_REASON_QSTA_CIPHER_NOT_SUPP = 45, | ||
304 | }; | 407 | }; |
305 | 408 | ||
306 | 409 | ||
@@ -319,6 +422,15 @@ enum ieee80211_eid { | |||
319 | WLAN_EID_HP_PARAMS = 8, | 422 | WLAN_EID_HP_PARAMS = 8, |
320 | WLAN_EID_HP_TABLE = 9, | 423 | WLAN_EID_HP_TABLE = 9, |
321 | WLAN_EID_REQUEST = 10, | 424 | WLAN_EID_REQUEST = 10, |
425 | /* 802.11e */ | ||
426 | WLAN_EID_QBSS_LOAD = 11, | ||
427 | WLAN_EID_EDCA_PARAM_SET = 12, | ||
428 | WLAN_EID_TSPEC = 13, | ||
429 | WLAN_EID_TCLAS = 14, | ||
430 | WLAN_EID_SCHEDULE = 15, | ||
431 | WLAN_EID_TS_DELAY = 43, | ||
432 | WLAN_EID_TCLAS_PROCESSING = 44, | ||
433 | WLAN_EID_QOS_CAPA = 46, | ||
322 | /* 802.11h */ | 434 | /* 802.11h */ |
323 | WLAN_EID_PWR_CONSTRAINT = 32, | 435 | WLAN_EID_PWR_CONSTRAINT = 32, |
324 | WLAN_EID_PWR_CAPABILITY = 33, | 436 | WLAN_EID_PWR_CAPABILITY = 33, |
@@ -333,6 +445,9 @@ enum ieee80211_eid { | |||
333 | /* 802.11g */ | 445 | /* 802.11g */ |
334 | WLAN_EID_ERP_INFO = 42, | 446 | WLAN_EID_ERP_INFO = 42, |
335 | WLAN_EID_EXT_SUPP_RATES = 50, | 447 | WLAN_EID_EXT_SUPP_RATES = 50, |
448 | /* 802.11n */ | ||
449 | WLAN_EID_HT_CAPABILITY = 45, | ||
450 | WLAN_EID_HT_EXTRA_INFO = 61, | ||
336 | /* 802.11i */ | 451 | /* 802.11i */ |
337 | WLAN_EID_RSN = 48, | 452 | WLAN_EID_RSN = 48, |
338 | WLAN_EID_WPA = 221, | 453 | WLAN_EID_WPA = 221, |
@@ -341,6 +456,32 @@ enum ieee80211_eid { | |||
341 | WLAN_EID_QOS_PARAMETER = 222 | 456 | WLAN_EID_QOS_PARAMETER = 222 |
342 | }; | 457 | }; |
343 | 458 | ||
459 | /* Action category code */ | ||
460 | enum ieee80211_category { | ||
461 | WLAN_CATEGORY_SPECTRUM_MGMT = 0, | ||
462 | WLAN_CATEGORY_QOS = 1, | ||
463 | WLAN_CATEGORY_DLS = 2, | ||
464 | WLAN_CATEGORY_BACK = 3, | ||
465 | WLAN_CATEGORY_WMM = 17, | ||
466 | }; | ||
467 | |||
468 | /* BACK action code */ | ||
469 | enum ieee80211_back_actioncode { | ||
470 | WLAN_ACTION_ADDBA_REQ = 0, | ||
471 | WLAN_ACTION_ADDBA_RESP = 1, | ||
472 | WLAN_ACTION_DELBA = 2, | ||
473 | }; | ||
474 | |||
475 | /* BACK (block-ack) parties */ | ||
476 | enum ieee80211_back_parties { | ||
477 | WLAN_BACK_RECIPIENT = 0, | ||
478 | WLAN_BACK_INITIATOR = 1, | ||
479 | WLAN_BACK_TIMER = 2, | ||
480 | }; | ||
481 | |||
482 | /* A-MSDU 802.11n */ | ||
483 | #define IEEE80211_QOS_CONTROL_A_MSDU_PRESENT 0x0080 | ||
484 | |||
344 | /* cipher suite selectors */ | 485 | /* cipher suite selectors */ |
345 | #define WLAN_CIPHER_SUITE_USE_GROUP 0x000FAC00 | 486 | #define WLAN_CIPHER_SUITE_USE_GROUP 0x000FAC00 |
346 | #define WLAN_CIPHER_SUITE_WEP40 0x000FAC01 | 487 | #define WLAN_CIPHER_SUITE_WEP40 0x000FAC01 |
diff --git a/include/linux/if.h b/include/linux/if.h index 32bf419351f1..5c9d1fa93fef 100644 --- a/include/linux/if.h +++ b/include/linux/if.h | |||
@@ -50,7 +50,9 @@ | |||
50 | #define IFF_LOWER_UP 0x10000 /* driver signals L1 up */ | 50 | #define IFF_LOWER_UP 0x10000 /* driver signals L1 up */ |
51 | #define IFF_DORMANT 0x20000 /* driver signals dormant */ | 51 | #define IFF_DORMANT 0x20000 /* driver signals dormant */ |
52 | 52 | ||
53 | #define IFF_VOLATILE (IFF_LOOPBACK|IFF_POINTOPOINT|IFF_BROADCAST|\ | 53 | #define IFF_ECHO 0x40000 /* echo sent packets */ |
54 | |||
55 | #define IFF_VOLATILE (IFF_LOOPBACK|IFF_POINTOPOINT|IFF_BROADCAST|IFF_ECHO|\ | ||
54 | IFF_MASTER|IFF_SLAVE|IFF_RUNNING|IFF_LOWER_UP|IFF_DORMANT) | 56 | IFF_MASTER|IFF_SLAVE|IFF_RUNNING|IFF_LOWER_UP|IFF_DORMANT) |
55 | 57 | ||
56 | /* Private (from user) interface flags (netdevice->priv_flags). */ | 58 | /* Private (from user) interface flags (netdevice->priv_flags). */ |
@@ -61,6 +63,7 @@ | |||
61 | #define IFF_MASTER_ALB 0x10 /* bonding master, balance-alb. */ | 63 | #define IFF_MASTER_ALB 0x10 /* bonding master, balance-alb. */ |
62 | #define IFF_BONDING 0x20 /* bonding master or slave */ | 64 | #define IFF_BONDING 0x20 /* bonding master or slave */ |
63 | #define IFF_SLAVE_NEEDARP 0x40 /* need ARPs for validation */ | 65 | #define IFF_SLAVE_NEEDARP 0x40 /* need ARPs for validation */ |
66 | #define IFF_ISATAP 0x80 /* ISATAP interface (RFC4214) */ | ||
64 | 67 | ||
65 | #define IF_GET_IFACE 0x0001 /* for querying only */ | 68 | #define IF_GET_IFACE 0x0001 /* for querying only */ |
66 | #define IF_GET_PROTO 0x0002 | 69 | #define IF_GET_PROTO 0x0002 |
diff --git a/include/linux/if_addrlabel.h b/include/linux/if_addrlabel.h new file mode 100644 index 000000000000..9fe79c95dd28 --- /dev/null +++ b/include/linux/if_addrlabel.h | |||
@@ -0,0 +1,32 @@ | |||
1 | /* | ||
2 | * if_addrlabel.h - netlink interface for address labels | ||
3 | * | ||
4 | * Copyright (C)2007 USAGI/WIDE Project, All Rights Reserved. | ||
5 | * | ||
6 | * Authors: | ||
7 | * YOSHIFUJI Hideaki @ USAGI/WIDE <yoshfuji@linux-ipv6.org> | ||
8 | */ | ||
9 | |||
10 | #ifndef __LINUX_IF_ADDRLABEL_H | ||
11 | #define __LINUX_IF_ADDRLABEL_H | ||
12 | |||
13 | struct ifaddrlblmsg | ||
14 | { | ||
15 | __u8 ifal_family; /* Address family */ | ||
16 | __u8 __ifal_reserved; /* Reserved */ | ||
17 | __u8 ifal_prefixlen; /* Prefix length */ | ||
18 | __u8 ifal_flags; /* Flags */ | ||
19 | __u32 ifal_index; /* Link index */ | ||
20 | __u32 ifal_seq; /* sequence number */ | ||
21 | }; | ||
22 | |||
23 | enum | ||
24 | { | ||
25 | IFAL_ADDRESS = 1, | ||
26 | IFAL_LABEL = 2, | ||
27 | __IFAL_MAX | ||
28 | }; | ||
29 | |||
30 | #define IFAL_MAX (__IFAL_MAX - 1) | ||
31 | |||
32 | #endif | ||
diff --git a/include/linux/if_arp.h b/include/linux/if_arp.h index ed7b93c3083a..296e8e86e91d 100644 --- a/include/linux/if_arp.h +++ b/include/linux/if_arp.h | |||
@@ -52,6 +52,7 @@ | |||
52 | #define ARPHRD_ROSE 270 | 52 | #define ARPHRD_ROSE 270 |
53 | #define ARPHRD_X25 271 /* CCITT X.25 */ | 53 | #define ARPHRD_X25 271 /* CCITT X.25 */ |
54 | #define ARPHRD_HWX25 272 /* Boards with X.25 in firmware */ | 54 | #define ARPHRD_HWX25 272 /* Boards with X.25 in firmware */ |
55 | #define ARPHRD_CAN 280 /* Controller Area Network */ | ||
55 | #define ARPHRD_PPP 512 | 56 | #define ARPHRD_PPP 512 |
56 | #define ARPHRD_CISCO 513 /* Cisco HDLC */ | 57 | #define ARPHRD_CISCO 513 /* Cisco HDLC */ |
57 | #define ARPHRD_HDLC ARPHRD_CISCO | 58 | #define ARPHRD_HDLC ARPHRD_CISCO |
diff --git a/include/linux/if_ether.h b/include/linux/if_ether.h index 5f9297793661..e157c1399b61 100644 --- a/include/linux/if_ether.h +++ b/include/linux/if_ether.h | |||
@@ -90,6 +90,7 @@ | |||
90 | #define ETH_P_WAN_PPP 0x0007 /* Dummy type for WAN PPP frames*/ | 90 | #define ETH_P_WAN_PPP 0x0007 /* Dummy type for WAN PPP frames*/ |
91 | #define ETH_P_PPP_MP 0x0008 /* Dummy type for PPP MP frames */ | 91 | #define ETH_P_PPP_MP 0x0008 /* Dummy type for PPP MP frames */ |
92 | #define ETH_P_LOCALTALK 0x0009 /* Localtalk pseudo type */ | 92 | #define ETH_P_LOCALTALK 0x0009 /* Localtalk pseudo type */ |
93 | #define ETH_P_CAN 0x000C /* Controller Area Network */ | ||
93 | #define ETH_P_PPPTALK 0x0010 /* Dummy type for Atalk over PPP*/ | 94 | #define ETH_P_PPPTALK 0x0010 /* Dummy type for Atalk over PPP*/ |
94 | #define ETH_P_TR_802_2 0x0011 /* 802.2 frames */ | 95 | #define ETH_P_TR_802_2 0x0011 /* 802.2 frames */ |
95 | #define ETH_P_MOBITEX 0x0015 /* Mobitex (kaz@cafe.net) */ | 96 | #define ETH_P_MOBITEX 0x0015 /* Mobitex (kaz@cafe.net) */ |
@@ -123,12 +124,15 @@ int eth_header_parse(const struct sk_buff *skb, unsigned char *haddr); | |||
123 | extern struct ctl_table ether_table[]; | 124 | extern struct ctl_table ether_table[]; |
124 | #endif | 125 | #endif |
125 | 126 | ||
127 | extern ssize_t sysfs_format_mac(char *buf, const unsigned char *addr, int len); | ||
128 | |||
126 | /* | 129 | /* |
127 | * Display a 6 byte device address (MAC) in a readable format. | 130 | * Display a 6 byte device address (MAC) in a readable format. |
128 | */ | 131 | */ |
132 | extern char *print_mac(char *buf, const unsigned char *addr); | ||
129 | #define MAC_FMT "%02x:%02x:%02x:%02x:%02x:%02x" | 133 | #define MAC_FMT "%02x:%02x:%02x:%02x:%02x:%02x" |
130 | extern char *print_mac(char *buf, const u8 *addr); | 134 | #define MAC_BUF_SIZE 18 |
131 | #define DECLARE_MAC_BUF(var) char var[18] __maybe_unused | 135 | #define DECLARE_MAC_BUF(var) char var[MAC_BUF_SIZE] __maybe_unused |
132 | 136 | ||
133 | #endif | 137 | #endif |
134 | 138 | ||
diff --git a/include/linux/if_frad.h b/include/linux/if_frad.h index f272a80caa3e..5c34240de746 100644 --- a/include/linux/if_frad.h +++ b/include/linux/if_frad.h | |||
@@ -137,7 +137,7 @@ struct frhdr | |||
137 | 137 | ||
138 | unsigned char NLPID; | 138 | unsigned char NLPID; |
139 | unsigned char OUI[3]; | 139 | unsigned char OUI[3]; |
140 | unsigned short PID; | 140 | __be16 PID; |
141 | 141 | ||
142 | #define IP_NLPID pad | 142 | #define IP_NLPID pad |
143 | } __attribute__((packed)); | 143 | } __attribute__((packed)); |
diff --git a/include/linux/if_shaper.h b/include/linux/if_shaper.h deleted file mode 100644 index 3b1b7ba19825..000000000000 --- a/include/linux/if_shaper.h +++ /dev/null | |||
@@ -1,51 +0,0 @@ | |||
1 | #ifndef __LINUX_SHAPER_H | ||
2 | #define __LINUX_SHAPER_H | ||
3 | |||
4 | #ifdef __KERNEL__ | ||
5 | |||
6 | #define SHAPER_QLEN 10 | ||
7 | /* | ||
8 | * This is a bit speed dependent (read it shouldn't be a constant!) | ||
9 | * | ||
10 | * 5 is about right for 28.8 upwards. Below that double for every | ||
11 | * halving of speed or so. - ie about 20 for 9600 baud. | ||
12 | */ | ||
13 | #define SHAPER_LATENCY (5*HZ) | ||
14 | #define SHAPER_MAXSLIP 2 | ||
15 | #define SHAPER_BURST (HZ/50) /* Good for >128K then */ | ||
16 | |||
17 | struct shaper | ||
18 | { | ||
19 | struct sk_buff_head sendq; | ||
20 | __u32 bytespertick; | ||
21 | __u32 bitspersec; | ||
22 | __u32 shapelatency; | ||
23 | __u32 shapeclock; | ||
24 | unsigned long recovery; /* Time we can next clock a packet out on | ||
25 | an empty queue */ | ||
26 | spinlock_t lock; | ||
27 | struct net_device *dev; | ||
28 | struct net_device_stats* (*get_stats)(struct net_device *dev); | ||
29 | struct timer_list timer; | ||
30 | }; | ||
31 | |||
32 | #endif | ||
33 | |||
34 | #define SHAPER_SET_DEV 0x0001 | ||
35 | #define SHAPER_SET_SPEED 0x0002 | ||
36 | #define SHAPER_GET_DEV 0x0003 | ||
37 | #define SHAPER_GET_SPEED 0x0004 | ||
38 | |||
39 | struct shaperconf | ||
40 | { | ||
41 | __u16 ss_cmd; | ||
42 | union | ||
43 | { | ||
44 | char ssu_name[14]; | ||
45 | __u32 ssu_speed; | ||
46 | } ss_u; | ||
47 | #define ss_speed ss_u.ssu_speed | ||
48 | #define ss_name ss_u.ssu_name | ||
49 | }; | ||
50 | |||
51 | #endif | ||
diff --git a/include/linux/if_tr.h b/include/linux/if_tr.h index 046e9d95ba9a..5bcec8b2c5e2 100644 --- a/include/linux/if_tr.h +++ b/include/linux/if_tr.h | |||
@@ -49,9 +49,6 @@ static inline struct trh_hdr *tr_hdr(const struct sk_buff *skb) | |||
49 | { | 49 | { |
50 | return (struct trh_hdr *)skb_mac_header(skb); | 50 | return (struct trh_hdr *)skb_mac_header(skb); |
51 | } | 51 | } |
52 | #ifdef CONFIG_SYSCTL | ||
53 | extern struct ctl_table tr_table[]; | ||
54 | #endif | ||
55 | #endif | 52 | #endif |
56 | 53 | ||
57 | /* This is an Token-Ring LLC structure */ | 54 | /* This is an Token-Ring LLC structure */ |
diff --git a/include/linux/if_tun.h b/include/linux/if_tun.h index 33e489d5bb33..72f1c5f47be3 100644 --- a/include/linux/if_tun.h +++ b/include/linux/if_tun.h | |||
@@ -21,6 +21,8 @@ | |||
21 | /* Uncomment to enable debugging */ | 21 | /* Uncomment to enable debugging */ |
22 | /* #define TUN_DEBUG 1 */ | 22 | /* #define TUN_DEBUG 1 */ |
23 | 23 | ||
24 | #include <linux/types.h> | ||
25 | |||
24 | #ifdef __KERNEL__ | 26 | #ifdef __KERNEL__ |
25 | 27 | ||
26 | #ifdef TUN_DEBUG | 28 | #ifdef TUN_DEBUG |
@@ -88,7 +90,7 @@ struct tun_struct { | |||
88 | 90 | ||
89 | struct tun_pi { | 91 | struct tun_pi { |
90 | unsigned short flags; | 92 | unsigned short flags; |
91 | unsigned short proto; | 93 | __be16 proto; |
92 | }; | 94 | }; |
93 | #define TUN_PKT_STRIP 0x0001 | 95 | #define TUN_PKT_STRIP 0x0001 |
94 | 96 | ||
diff --git a/include/linux/if_tunnel.h b/include/linux/if_tunnel.h index 660b5010c2d9..228eb4eb3129 100644 --- a/include/linux/if_tunnel.h +++ b/include/linux/if_tunnel.h | |||
@@ -17,6 +17,9 @@ | |||
17 | #define GRE_FLAGS __constant_htons(0x00F8) | 17 | #define GRE_FLAGS __constant_htons(0x00F8) |
18 | #define GRE_VERSION __constant_htons(0x0007) | 18 | #define GRE_VERSION __constant_htons(0x0007) |
19 | 19 | ||
20 | /* i_flags values for SIT mode */ | ||
21 | #define SIT_ISATAP 0x0001 | ||
22 | |||
20 | struct ip_tunnel_parm | 23 | struct ip_tunnel_parm |
21 | { | 24 | { |
22 | char name[IFNAMSIZ]; | 25 | char name[IFNAMSIZ]; |
diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h index 976d4b1067d1..34f40efc7607 100644 --- a/include/linux/if_vlan.h +++ b/include/linux/if_vlan.h | |||
@@ -16,11 +16,6 @@ | |||
16 | #ifdef __KERNEL__ | 16 | #ifdef __KERNEL__ |
17 | 17 | ||
18 | /* externally defined structs */ | 18 | /* externally defined structs */ |
19 | struct vlan_group; | ||
20 | struct net_device; | ||
21 | struct packet_type; | ||
22 | struct vlan_collection; | ||
23 | struct vlan_dev_info; | ||
24 | struct hlist_node; | 19 | struct hlist_node; |
25 | 20 | ||
26 | #include <linux/netdevice.h> | 21 | #include <linux/netdevice.h> |
@@ -39,12 +34,30 @@ struct hlist_node; | |||
39 | #define VLAN_ETH_DATA_LEN 1500 /* Max. octets in payload */ | 34 | #define VLAN_ETH_DATA_LEN 1500 /* Max. octets in payload */ |
40 | #define VLAN_ETH_FRAME_LEN 1518 /* Max. octets in frame sans FCS */ | 35 | #define VLAN_ETH_FRAME_LEN 1518 /* Max. octets in frame sans FCS */ |
41 | 36 | ||
37 | /* | ||
38 | * struct vlan_hdr - vlan header | ||
39 | * @h_vlan_TCI: priority and VLAN ID | ||
40 | * @h_vlan_encapsulated_proto: packet type ID or len | ||
41 | */ | ||
42 | struct vlan_hdr { | ||
43 | __be16 h_vlan_TCI; | ||
44 | __be16 h_vlan_encapsulated_proto; | ||
45 | }; | ||
46 | |||
47 | /** | ||
48 | * struct vlan_ethhdr - vlan ethernet header (ethhdr + vlan_hdr) | ||
49 | * @h_dest: destination ethernet address | ||
50 | * @h_source: source ethernet address | ||
51 | * @h_vlan_proto: ethernet protocol (always 0x8100) | ||
52 | * @h_vlan_TCI: priority and VLAN ID | ||
53 | * @h_vlan_encapsulated_proto: packet type ID or len | ||
54 | */ | ||
42 | struct vlan_ethhdr { | 55 | struct vlan_ethhdr { |
43 | unsigned char h_dest[ETH_ALEN]; /* destination eth addr */ | 56 | unsigned char h_dest[ETH_ALEN]; |
44 | unsigned char h_source[ETH_ALEN]; /* source ether addr */ | 57 | unsigned char h_source[ETH_ALEN]; |
45 | __be16 h_vlan_proto; /* Should always be 0x8100 */ | 58 | __be16 h_vlan_proto; |
46 | __be16 h_vlan_TCI; /* Encapsulates priority and VLAN ID */ | 59 | __be16 h_vlan_TCI; |
47 | __be16 h_vlan_encapsulated_proto; /* packet type ID field (or len) */ | 60 | __be16 h_vlan_encapsulated_proto; |
48 | }; | 61 | }; |
49 | 62 | ||
50 | #include <linux/skbuff.h> | 63 | #include <linux/skbuff.h> |
@@ -54,18 +67,11 @@ static inline struct vlan_ethhdr *vlan_eth_hdr(const struct sk_buff *skb) | |||
54 | return (struct vlan_ethhdr *)skb_mac_header(skb); | 67 | return (struct vlan_ethhdr *)skb_mac_header(skb); |
55 | } | 68 | } |
56 | 69 | ||
57 | struct vlan_hdr { | ||
58 | __be16 h_vlan_TCI; /* Encapsulates priority and VLAN ID */ | ||
59 | __be16 h_vlan_encapsulated_proto; /* packet type ID field (or len) */ | ||
60 | }; | ||
61 | |||
62 | #define VLAN_VID_MASK 0xfff | 70 | #define VLAN_VID_MASK 0xfff |
63 | 71 | ||
64 | /* found in socket.c */ | 72 | /* found in socket.c */ |
65 | extern void vlan_ioctl_set(int (*hook)(struct net *, void __user *)); | 73 | extern void vlan_ioctl_set(int (*hook)(struct net *, void __user *)); |
66 | 74 | ||
67 | #define VLAN_NAME "vlan" | ||
68 | |||
69 | /* if this changes, algorithm will have to be reworked because this | 75 | /* if this changes, algorithm will have to be reworked because this |
70 | * depends on completely exhausting the VLAN identifier space. Thus | 76 | * depends on completely exhausting the VLAN identifier space. Thus |
71 | * it gives constant time look-up, but in many cases it wastes memory. | 77 | * it gives constant time look-up, but in many cases it wastes memory. |
@@ -76,19 +82,22 @@ extern void vlan_ioctl_set(int (*hook)(struct net *, void __user *)); | |||
76 | 82 | ||
77 | struct vlan_group { | 83 | struct vlan_group { |
78 | int real_dev_ifindex; /* The ifindex of the ethernet(like) device the vlan is attached to. */ | 84 | int real_dev_ifindex; /* The ifindex of the ethernet(like) device the vlan is attached to. */ |
85 | unsigned int nr_vlans; | ||
79 | struct hlist_node hlist; /* linked list */ | 86 | struct hlist_node hlist; /* linked list */ |
80 | struct net_device **vlan_devices_arrays[VLAN_GROUP_ARRAY_SPLIT_PARTS]; | 87 | struct net_device **vlan_devices_arrays[VLAN_GROUP_ARRAY_SPLIT_PARTS]; |
81 | struct rcu_head rcu; | 88 | struct rcu_head rcu; |
82 | }; | 89 | }; |
83 | 90 | ||
84 | static inline struct net_device *vlan_group_get_device(struct vlan_group *vg, int vlan_id) | 91 | static inline struct net_device *vlan_group_get_device(struct vlan_group *vg, |
92 | unsigned int vlan_id) | ||
85 | { | 93 | { |
86 | struct net_device **array; | 94 | struct net_device **array; |
87 | array = vg->vlan_devices_arrays[vlan_id / VLAN_GROUP_ARRAY_PART_LEN]; | 95 | array = vg->vlan_devices_arrays[vlan_id / VLAN_GROUP_ARRAY_PART_LEN]; |
88 | return array[vlan_id % VLAN_GROUP_ARRAY_PART_LEN]; | 96 | return array[vlan_id % VLAN_GROUP_ARRAY_PART_LEN]; |
89 | } | 97 | } |
90 | 98 | ||
91 | static inline void vlan_group_set_device(struct vlan_group *vg, int vlan_id, | 99 | static inline void vlan_group_set_device(struct vlan_group *vg, |
100 | unsigned int vlan_id, | ||
92 | struct net_device *dev) | 101 | struct net_device *dev) |
93 | { | 102 | { |
94 | struct net_device **array; | 103 | struct net_device **array; |
@@ -132,22 +141,18 @@ struct vlan_dev_info { | |||
132 | struct proc_dir_entry *dent; /* Holds the proc data */ | 141 | struct proc_dir_entry *dent; /* Holds the proc data */ |
133 | unsigned long cnt_inc_headroom_on_tx; /* How many times did we have to grow the skb on TX. */ | 142 | unsigned long cnt_inc_headroom_on_tx; /* How many times did we have to grow the skb on TX. */ |
134 | unsigned long cnt_encap_on_xmit; /* How many times did we have to encapsulate the skb on TX. */ | 143 | unsigned long cnt_encap_on_xmit; /* How many times did we have to encapsulate the skb on TX. */ |
135 | struct net_device_stats dev_stats; /* Device stats (rx-bytes, tx-pkts, etc...) */ | ||
136 | }; | 144 | }; |
137 | 145 | ||
138 | #define VLAN_DEV_INFO(x) ((struct vlan_dev_info *)(x->priv)) | 146 | static inline struct vlan_dev_info *vlan_dev_info(const struct net_device *dev) |
139 | |||
140 | /* inline functions */ | ||
141 | |||
142 | static inline struct net_device_stats *vlan_dev_get_stats(struct net_device *dev) | ||
143 | { | 147 | { |
144 | return &(VLAN_DEV_INFO(dev)->dev_stats); | 148 | return netdev_priv(dev); |
145 | } | 149 | } |
146 | 150 | ||
151 | /* inline functions */ | ||
147 | static inline __u32 vlan_get_ingress_priority(struct net_device *dev, | 152 | static inline __u32 vlan_get_ingress_priority(struct net_device *dev, |
148 | unsigned short vlan_tag) | 153 | unsigned short vlan_tag) |
149 | { | 154 | { |
150 | struct vlan_dev_info *vip = VLAN_DEV_INFO(dev); | 155 | struct vlan_dev_info *vip = vlan_dev_info(dev); |
151 | 156 | ||
152 | return vip->ingress_priority_map[(vlan_tag >> 13) & 0x7]; | 157 | return vip->ingress_priority_map[(vlan_tag >> 13) & 0x7]; |
153 | } | 158 | } |
@@ -188,7 +193,7 @@ static inline int __vlan_hwaccel_rx(struct sk_buff *skb, | |||
188 | 193 | ||
189 | skb->dev->last_rx = jiffies; | 194 | skb->dev->last_rx = jiffies; |
190 | 195 | ||
191 | stats = vlan_dev_get_stats(skb->dev); | 196 | stats = &skb->dev->stats; |
192 | stats->rx_packets++; | 197 | stats->rx_packets++; |
193 | stats->rx_bytes += skb->len; | 198 | stats->rx_bytes += skb->len; |
194 | 199 | ||
@@ -266,12 +271,12 @@ static inline struct sk_buff *__vlan_put_tag(struct sk_buff *skb, unsigned short | |||
266 | memmove(skb->data, skb->data + VLAN_HLEN, 2 * VLAN_ETH_ALEN); | 271 | memmove(skb->data, skb->data + VLAN_HLEN, 2 * VLAN_ETH_ALEN); |
267 | 272 | ||
268 | /* first, the ethernet type */ | 273 | /* first, the ethernet type */ |
269 | veth->h_vlan_proto = __constant_htons(ETH_P_8021Q); | 274 | veth->h_vlan_proto = htons(ETH_P_8021Q); |
270 | 275 | ||
271 | /* now, the tag */ | 276 | /* now, the tag */ |
272 | veth->h_vlan_TCI = htons(tag); | 277 | veth->h_vlan_TCI = htons(tag); |
273 | 278 | ||
274 | skb->protocol = __constant_htons(ETH_P_8021Q); | 279 | skb->protocol = htons(ETH_P_8021Q); |
275 | skb->mac_header -= VLAN_HLEN; | 280 | skb->mac_header -= VLAN_HLEN; |
276 | skb->network_header -= VLAN_HLEN; | 281 | skb->network_header -= VLAN_HLEN; |
277 | 282 | ||
@@ -326,7 +331,7 @@ static inline int __vlan_get_tag(struct sk_buff *skb, unsigned short *tag) | |||
326 | { | 331 | { |
327 | struct vlan_ethhdr *veth = (struct vlan_ethhdr *)skb->data; | 332 | struct vlan_ethhdr *veth = (struct vlan_ethhdr *)skb->data; |
328 | 333 | ||
329 | if (veth->h_vlan_proto != __constant_htons(ETH_P_8021Q)) { | 334 | if (veth->h_vlan_proto != htons(ETH_P_8021Q)) { |
330 | return -EINVAL; | 335 | return -EINVAL; |
331 | } | 336 | } |
332 | 337 | ||
diff --git a/include/linux/in.h b/include/linux/in.h index 3975cbf52f20..70c6df882694 100644 --- a/include/linux/in.h +++ b/include/linux/in.h | |||
@@ -246,13 +246,69 @@ struct sockaddr_in { | |||
246 | #include <asm/byteorder.h> | 246 | #include <asm/byteorder.h> |
247 | 247 | ||
248 | #ifdef __KERNEL__ | 248 | #ifdef __KERNEL__ |
249 | /* Some random defines to make it easier in the kernel.. */ | ||
250 | #define LOOPBACK(x) (((x) & htonl(0xff000000)) == htonl(0x7f000000)) | ||
251 | #define MULTICAST(x) (((x) & htonl(0xf0000000)) == htonl(0xe0000000)) | ||
252 | #define BADCLASS(x) (((x) & htonl(0xf0000000)) == htonl(0xf0000000)) | ||
253 | #define ZERONET(x) (((x) & htonl(0xff000000)) == htonl(0x00000000)) | ||
254 | #define LOCAL_MCAST(x) (((x) & htonl(0xFFFFFF00)) == htonl(0xE0000000)) | ||
255 | 249 | ||
250 | static inline bool ipv4_is_loopback(__be32 addr) | ||
251 | { | ||
252 | return (addr & htonl(0xff000000)) == htonl(0x7f000000); | ||
253 | } | ||
254 | |||
255 | static inline bool ipv4_is_multicast(__be32 addr) | ||
256 | { | ||
257 | return (addr & htonl(0xf0000000)) == htonl(0xe0000000); | ||
258 | } | ||
259 | |||
260 | static inline bool ipv4_is_local_multicast(__be32 addr) | ||
261 | { | ||
262 | return (addr & htonl(0xffffff00)) == htonl(0xe0000000); | ||
263 | } | ||
264 | |||
265 | static inline bool ipv4_is_lbcast(__be32 addr) | ||
266 | { | ||
267 | /* limited broadcast */ | ||
268 | return addr == INADDR_BROADCAST; | ||
269 | } | ||
270 | |||
271 | static inline bool ipv4_is_zeronet(__be32 addr) | ||
272 | { | ||
273 | return (addr & htonl(0xff000000)) == htonl(0x00000000); | ||
274 | } | ||
275 | |||
276 | /* Special-Use IPv4 Addresses (RFC3330) */ | ||
277 | |||
278 | static inline bool ipv4_is_private_10(__be32 addr) | ||
279 | { | ||
280 | return (addr & htonl(0xff000000)) == htonl(0x0a000000); | ||
281 | } | ||
282 | |||
283 | static inline bool ipv4_is_private_172(__be32 addr) | ||
284 | { | ||
285 | return (addr & htonl(0xfff00000)) == htonl(0xac100000); | ||
286 | } | ||
287 | |||
288 | static inline bool ipv4_is_private_192(__be32 addr) | ||
289 | { | ||
290 | return (addr & htonl(0xffff0000)) == htonl(0xc0a80000); | ||
291 | } | ||
292 | |||
293 | static inline bool ipv4_is_linklocal_169(__be32 addr) | ||
294 | { | ||
295 | return (addr & htonl(0xffff0000)) == htonl(0xa9fe0000); | ||
296 | } | ||
297 | |||
298 | static inline bool ipv4_is_anycast_6to4(__be32 addr) | ||
299 | { | ||
300 | return (addr & htonl(0xffffff00)) == htonl(0xc0586300); | ||
301 | } | ||
302 | |||
303 | static inline bool ipv4_is_test_192(__be32 addr) | ||
304 | { | ||
305 | return (addr & htonl(0xffffff00)) == htonl(0xc0000200); | ||
306 | } | ||
307 | |||
308 | static inline bool ipv4_is_test_198(__be32 addr) | ||
309 | { | ||
310 | return (addr & htonl(0xfffe0000)) == htonl(0xc6120000); | ||
311 | } | ||
256 | #endif | 312 | #endif |
257 | 313 | ||
258 | #endif /* _LINUX_IN_H */ | 314 | #endif /* _LINUX_IN_H */ |
diff --git a/include/linux/inetdevice.h b/include/linux/inetdevice.h index d83fee2dc643..8d9eaaebded7 100644 --- a/include/linux/inetdevice.h +++ b/include/linux/inetdevice.h | |||
@@ -44,7 +44,8 @@ struct in_device | |||
44 | }; | 44 | }; |
45 | 45 | ||
46 | #define IPV4_DEVCONF(cnf, attr) ((cnf).data[NET_IPV4_CONF_ ## attr - 1]) | 46 | #define IPV4_DEVCONF(cnf, attr) ((cnf).data[NET_IPV4_CONF_ ## attr - 1]) |
47 | #define IPV4_DEVCONF_ALL(attr) IPV4_DEVCONF(ipv4_devconf, attr) | 47 | #define IPV4_DEVCONF_ALL(net, attr) \ |
48 | IPV4_DEVCONF((*(net)->ipv4.devconf_all), attr) | ||
48 | 49 | ||
49 | static inline int ipv4_devconf_get(struct in_device *in_dev, int index) | 50 | static inline int ipv4_devconf_get(struct in_device *in_dev, int index) |
50 | { | 51 | { |
@@ -71,16 +72,17 @@ static inline void ipv4_devconf_setall(struct in_device *in_dev) | |||
71 | ipv4_devconf_set((in_dev), NET_IPV4_CONF_ ## attr, (val)) | 72 | ipv4_devconf_set((in_dev), NET_IPV4_CONF_ ## attr, (val)) |
72 | 73 | ||
73 | #define IN_DEV_ANDCONF(in_dev, attr) \ | 74 | #define IN_DEV_ANDCONF(in_dev, attr) \ |
74 | (IPV4_DEVCONF_ALL(attr) && IN_DEV_CONF_GET((in_dev), attr)) | 75 | (IPV4_DEVCONF_ALL(in_dev->dev->nd_net, attr) && \ |
76 | IN_DEV_CONF_GET((in_dev), attr)) | ||
75 | #define IN_DEV_ORCONF(in_dev, attr) \ | 77 | #define IN_DEV_ORCONF(in_dev, attr) \ |
76 | (IPV4_DEVCONF_ALL(attr) || IN_DEV_CONF_GET((in_dev), attr)) | 78 | (IPV4_DEVCONF_ALL(in_dev->dev->nd_net, attr) || \ |
79 | IN_DEV_CONF_GET((in_dev), attr)) | ||
77 | #define IN_DEV_MAXCONF(in_dev, attr) \ | 80 | #define IN_DEV_MAXCONF(in_dev, attr) \ |
78 | (max(IPV4_DEVCONF_ALL(attr), IN_DEV_CONF_GET((in_dev), attr))) | 81 | (max(IPV4_DEVCONF_ALL(in_dev->dev->nd_net, attr), \ |
82 | IN_DEV_CONF_GET((in_dev), attr))) | ||
79 | 83 | ||
80 | #define IN_DEV_FORWARD(in_dev) IN_DEV_CONF_GET((in_dev), FORWARDING) | 84 | #define IN_DEV_FORWARD(in_dev) IN_DEV_CONF_GET((in_dev), FORWARDING) |
81 | #define IN_DEV_MFORWARD(in_dev) (IPV4_DEVCONF_ALL(MC_FORWARDING) && \ | 85 | #define IN_DEV_MFORWARD(in_dev) IN_DEV_ANDCONF((in_dev), MC_FORWARDING) |
82 | IPV4_DEVCONF((in_dev)->cnf, \ | ||
83 | MC_FORWARDING)) | ||
84 | #define IN_DEV_RPFILTER(in_dev) IN_DEV_ANDCONF((in_dev), RP_FILTER) | 86 | #define IN_DEV_RPFILTER(in_dev) IN_DEV_ANDCONF((in_dev), RP_FILTER) |
85 | #define IN_DEV_SOURCE_ROUTE(in_dev) IN_DEV_ANDCONF((in_dev), \ | 87 | #define IN_DEV_SOURCE_ROUTE(in_dev) IN_DEV_ANDCONF((in_dev), \ |
86 | ACCEPT_SOURCE_ROUTE) | 88 | ACCEPT_SOURCE_ROUTE) |
@@ -127,15 +129,14 @@ struct in_ifaddr | |||
127 | extern int register_inetaddr_notifier(struct notifier_block *nb); | 129 | extern int register_inetaddr_notifier(struct notifier_block *nb); |
128 | extern int unregister_inetaddr_notifier(struct notifier_block *nb); | 130 | extern int unregister_inetaddr_notifier(struct notifier_block *nb); |
129 | 131 | ||
130 | extern struct net_device *ip_dev_find(__be32 addr); | 132 | extern struct net_device *ip_dev_find(struct net *net, __be32 addr); |
131 | extern int inet_addr_onlink(struct in_device *in_dev, __be32 a, __be32 b); | 133 | extern int inet_addr_onlink(struct in_device *in_dev, __be32 a, __be32 b); |
132 | extern int devinet_ioctl(unsigned int cmd, void __user *); | 134 | extern int devinet_ioctl(unsigned int cmd, void __user *); |
133 | extern void devinet_init(void); | 135 | extern void devinet_init(void); |
134 | extern struct in_device *inetdev_by_index(int); | 136 | extern struct in_device *inetdev_by_index(struct net *, int); |
135 | extern __be32 inet_select_addr(const struct net_device *dev, __be32 dst, int scope); | 137 | extern __be32 inet_select_addr(const struct net_device *dev, __be32 dst, int scope); |
136 | extern __be32 inet_confirm_addr(const struct net_device *dev, __be32 dst, __be32 local, int scope); | 138 | extern __be32 inet_confirm_addr(struct in_device *in_dev, __be32 dst, __be32 local, int scope); |
137 | extern struct in_ifaddr *inet_ifa_byprefix(struct in_device *in_dev, __be32 prefix, __be32 mask); | 139 | extern struct in_ifaddr *inet_ifa_byprefix(struct in_device *in_dev, __be32 prefix, __be32 mask); |
138 | extern void inet_forward_change(void); | ||
139 | 140 | ||
140 | static __inline__ int inet_ifa_match(__be32 addr, struct in_ifaddr *ifa) | 141 | static __inline__ int inet_ifa_match(__be32 addr, struct in_ifaddr *ifa) |
141 | { | 142 | { |
diff --git a/include/linux/net.h b/include/linux/net.h index 596131ea46f4..c414d90e647b 100644 --- a/include/linux/net.h +++ b/include/linux/net.h | |||
@@ -22,6 +22,7 @@ | |||
22 | #include <asm/socket.h> | 22 | #include <asm/socket.h> |
23 | 23 | ||
24 | struct poll_table_struct; | 24 | struct poll_table_struct; |
25 | struct pipe_inode_info; | ||
25 | struct inode; | 26 | struct inode; |
26 | struct net; | 27 | struct net; |
27 | 28 | ||
@@ -172,6 +173,8 @@ struct proto_ops { | |||
172 | struct vm_area_struct * vma); | 173 | struct vm_area_struct * vma); |
173 | ssize_t (*sendpage) (struct socket *sock, struct page *page, | 174 | ssize_t (*sendpage) (struct socket *sock, struct page *page, |
174 | int offset, size_t size, int flags); | 175 | int offset, size_t size, int flags); |
176 | ssize_t (*splice_read)(struct socket *sock, loff_t *ppos, | ||
177 | struct pipe_inode_info *pipe, size_t len, unsigned int flags); | ||
175 | }; | 178 | }; |
176 | 179 | ||
177 | struct net_proto_family { | 180 | struct net_proto_family { |
@@ -183,6 +186,13 @@ struct net_proto_family { | |||
183 | struct iovec; | 186 | struct iovec; |
184 | struct kvec; | 187 | struct kvec; |
185 | 188 | ||
189 | enum { | ||
190 | SOCK_WAKE_IO, | ||
191 | SOCK_WAKE_WAITD, | ||
192 | SOCK_WAKE_SPACE, | ||
193 | SOCK_WAKE_URG, | ||
194 | }; | ||
195 | |||
186 | extern int sock_wake_async(struct socket *sk, int how, int band); | 196 | extern int sock_wake_async(struct socket *sk, int how, int band); |
187 | extern int sock_register(const struct net_proto_family *fam); | 197 | extern int sock_register(const struct net_proto_family *fam); |
188 | extern void sock_unregister(int family); | 198 | extern void sock_unregister(int family); |
@@ -327,7 +337,6 @@ static const struct proto_ops name##_ops = { \ | |||
327 | 337 | ||
328 | #ifdef CONFIG_SYSCTL | 338 | #ifdef CONFIG_SYSCTL |
329 | #include <linux/sysctl.h> | 339 | #include <linux/sysctl.h> |
330 | extern ctl_table net_table[]; | ||
331 | extern int net_msg_cost; | 340 | extern int net_msg_cost; |
332 | extern int net_msg_burst; | 341 | extern int net_msg_burst; |
333 | #endif | 342 | #endif |
diff --git a/include/linux/netfilter.h b/include/linux/netfilter.h index 16adac688af5..d74e79bacd2d 100644 --- a/include/linux/netfilter.h +++ b/include/linux/netfilter.h | |||
@@ -7,6 +7,8 @@ | |||
7 | #include <linux/skbuff.h> | 7 | #include <linux/skbuff.h> |
8 | #include <linux/net.h> | 8 | #include <linux/net.h> |
9 | #include <linux/if.h> | 9 | #include <linux/if.h> |
10 | #include <linux/in.h> | ||
11 | #include <linux/in6.h> | ||
10 | #include <linux/wait.h> | 12 | #include <linux/wait.h> |
11 | #include <linux/list.h> | 13 | #include <linux/list.h> |
12 | #endif | 14 | #endif |
@@ -39,6 +41,23 @@ | |||
39 | #define NFC_ALTERED 0x8000 | 41 | #define NFC_ALTERED 0x8000 |
40 | #endif | 42 | #endif |
41 | 43 | ||
44 | enum nf_inet_hooks { | ||
45 | NF_INET_PRE_ROUTING, | ||
46 | NF_INET_LOCAL_IN, | ||
47 | NF_INET_FORWARD, | ||
48 | NF_INET_LOCAL_OUT, | ||
49 | NF_INET_POST_ROUTING, | ||
50 | NF_INET_NUMHOOKS | ||
51 | }; | ||
52 | |||
53 | union nf_inet_addr { | ||
54 | u_int32_t all[4]; | ||
55 | __be32 ip; | ||
56 | __be32 ip6[4]; | ||
57 | struct in_addr in; | ||
58 | struct in6_addr in6; | ||
59 | }; | ||
60 | |||
42 | #ifdef __KERNEL__ | 61 | #ifdef __KERNEL__ |
43 | #ifdef CONFIG_NETFILTER | 62 | #ifdef CONFIG_NETFILTER |
44 | 63 | ||
@@ -92,19 +111,6 @@ struct nf_sockopt_ops | |||
92 | struct module *owner; | 111 | struct module *owner; |
93 | }; | 112 | }; |
94 | 113 | ||
95 | /* Each queued (to userspace) skbuff has one of these. */ | ||
96 | struct nf_info | ||
97 | { | ||
98 | /* The ops struct which sent us to userspace. */ | ||
99 | struct nf_hook_ops *elem; | ||
100 | |||
101 | /* If we're sent to userspace, this keeps housekeeping info */ | ||
102 | int pf; | ||
103 | unsigned int hook; | ||
104 | struct net_device *indev, *outdev; | ||
105 | int (*okfn)(struct sk_buff *); | ||
106 | }; | ||
107 | |||
108 | /* Function to register/unregister hook points. */ | 114 | /* Function to register/unregister hook points. */ |
109 | int nf_register_hook(struct nf_hook_ops *reg); | 115 | int nf_register_hook(struct nf_hook_ops *reg); |
110 | void nf_unregister_hook(struct nf_hook_ops *reg); | 116 | void nf_unregister_hook(struct nf_hook_ops *reg); |
@@ -118,71 +124,12 @@ void nf_unregister_sockopt(struct nf_sockopt_ops *reg); | |||
118 | 124 | ||
119 | #ifdef CONFIG_SYSCTL | 125 | #ifdef CONFIG_SYSCTL |
120 | /* Sysctl registration */ | 126 | /* Sysctl registration */ |
121 | struct ctl_table_header *nf_register_sysctl_table(struct ctl_table *path, | 127 | extern struct ctl_path nf_net_netfilter_sysctl_path[]; |
122 | struct ctl_table *table); | 128 | extern struct ctl_path nf_net_ipv4_netfilter_sysctl_path[]; |
123 | void nf_unregister_sysctl_table(struct ctl_table_header *header, | ||
124 | struct ctl_table *table); | ||
125 | extern struct ctl_table nf_net_netfilter_sysctl_path[]; | ||
126 | extern struct ctl_table nf_net_ipv4_netfilter_sysctl_path[]; | ||
127 | #endif /* CONFIG_SYSCTL */ | 129 | #endif /* CONFIG_SYSCTL */ |
128 | 130 | ||
129 | extern struct list_head nf_hooks[NPROTO][NF_MAX_HOOKS]; | 131 | extern struct list_head nf_hooks[NPROTO][NF_MAX_HOOKS]; |
130 | 132 | ||
131 | /* those NF_LOG_* defines and struct nf_loginfo are legacy definitios that will | ||
132 | * disappear once iptables is replaced with pkttables. Please DO NOT use them | ||
133 | * for any new code! */ | ||
134 | #define NF_LOG_TCPSEQ 0x01 /* Log TCP sequence numbers */ | ||
135 | #define NF_LOG_TCPOPT 0x02 /* Log TCP options */ | ||
136 | #define NF_LOG_IPOPT 0x04 /* Log IP options */ | ||
137 | #define NF_LOG_UID 0x08 /* Log UID owning local socket */ | ||
138 | #define NF_LOG_MASK 0x0f | ||
139 | |||
140 | #define NF_LOG_TYPE_LOG 0x01 | ||
141 | #define NF_LOG_TYPE_ULOG 0x02 | ||
142 | |||
143 | struct nf_loginfo { | ||
144 | u_int8_t type; | ||
145 | union { | ||
146 | struct { | ||
147 | u_int32_t copy_len; | ||
148 | u_int16_t group; | ||
149 | u_int16_t qthreshold; | ||
150 | } ulog; | ||
151 | struct { | ||
152 | u_int8_t level; | ||
153 | u_int8_t logflags; | ||
154 | } log; | ||
155 | } u; | ||
156 | }; | ||
157 | |||
158 | typedef void nf_logfn(unsigned int pf, | ||
159 | unsigned int hooknum, | ||
160 | const struct sk_buff *skb, | ||
161 | const struct net_device *in, | ||
162 | const struct net_device *out, | ||
163 | const struct nf_loginfo *li, | ||
164 | const char *prefix); | ||
165 | |||
166 | struct nf_logger { | ||
167 | struct module *me; | ||
168 | nf_logfn *logfn; | ||
169 | char *name; | ||
170 | }; | ||
171 | |||
172 | /* Function to register/unregister log function. */ | ||
173 | int nf_log_register(int pf, struct nf_logger *logger); | ||
174 | void nf_log_unregister(struct nf_logger *logger); | ||
175 | void nf_log_unregister_pf(int pf); | ||
176 | |||
177 | /* Calls the registered backend logging function */ | ||
178 | void nf_log_packet(int pf, | ||
179 | unsigned int hooknum, | ||
180 | const struct sk_buff *skb, | ||
181 | const struct net_device *in, | ||
182 | const struct net_device *out, | ||
183 | struct nf_loginfo *li, | ||
184 | const char *fmt, ...); | ||
185 | |||
186 | int nf_hook_slow(int pf, unsigned int hook, struct sk_buff *skb, | 133 | int nf_hook_slow(int pf, unsigned int hook, struct sk_buff *skb, |
187 | struct net_device *indev, struct net_device *outdev, | 134 | struct net_device *indev, struct net_device *outdev, |
188 | int (*okfn)(struct sk_buff *), int thresh); | 135 | int (*okfn)(struct sk_buff *), int thresh); |
@@ -265,65 +212,28 @@ int compat_nf_setsockopt(struct sock *sk, int pf, int optval, | |||
265 | int compat_nf_getsockopt(struct sock *sk, int pf, int optval, | 212 | int compat_nf_getsockopt(struct sock *sk, int pf, int optval, |
266 | char __user *opt, int *len); | 213 | char __user *opt, int *len); |
267 | 214 | ||
268 | /* Packet queuing */ | ||
269 | struct nf_queue_handler { | ||
270 | int (*outfn)(struct sk_buff *skb, struct nf_info *info, | ||
271 | unsigned int queuenum, void *data); | ||
272 | void *data; | ||
273 | char *name; | ||
274 | }; | ||
275 | extern int nf_register_queue_handler(int pf, | ||
276 | struct nf_queue_handler *qh); | ||
277 | extern int nf_unregister_queue_handler(int pf, | ||
278 | struct nf_queue_handler *qh); | ||
279 | extern void nf_unregister_queue_handlers(struct nf_queue_handler *qh); | ||
280 | extern void nf_reinject(struct sk_buff *skb, | ||
281 | struct nf_info *info, | ||
282 | unsigned int verdict); | ||
283 | |||
284 | /* FIXME: Before cache is ever used, this must be implemented for real. */ | ||
285 | extern void nf_invalidate_cache(int pf); | ||
286 | |||
287 | /* Call this before modifying an existing packet: ensures it is | 215 | /* Call this before modifying an existing packet: ensures it is |
288 | modifiable and linear to the point you care about (writable_len). | 216 | modifiable and linear to the point you care about (writable_len). |
289 | Returns true or false. */ | 217 | Returns true or false. */ |
290 | extern int skb_make_writable(struct sk_buff *skb, unsigned int writable_len); | 218 | extern int skb_make_writable(struct sk_buff *skb, unsigned int writable_len); |
291 | 219 | ||
292 | static inline void nf_csum_replace4(__sum16 *sum, __be32 from, __be32 to) | 220 | struct flowi; |
293 | { | 221 | struct nf_queue_entry; |
294 | __be32 diff[] = { ~from, to }; | ||
295 | |||
296 | *sum = csum_fold(csum_partial((char *)diff, sizeof(diff), ~csum_unfold(*sum))); | ||
297 | } | ||
298 | |||
299 | static inline void nf_csum_replace2(__sum16 *sum, __be16 from, __be16 to) | ||
300 | { | ||
301 | nf_csum_replace4(sum, (__force __be32)from, (__force __be32)to); | ||
302 | } | ||
303 | |||
304 | extern void nf_proto_csum_replace4(__sum16 *sum, struct sk_buff *skb, | ||
305 | __be32 from, __be32 to, int pseudohdr); | ||
306 | |||
307 | static inline void nf_proto_csum_replace2(__sum16 *sum, struct sk_buff *skb, | ||
308 | __be16 from, __be16 to, int pseudohdr) | ||
309 | { | ||
310 | nf_proto_csum_replace4(sum, skb, (__force __be32)from, | ||
311 | (__force __be32)to, pseudohdr); | ||
312 | } | ||
313 | 222 | ||
314 | struct nf_afinfo { | 223 | struct nf_afinfo { |
315 | unsigned short family; | 224 | unsigned short family; |
316 | __sum16 (*checksum)(struct sk_buff *skb, unsigned int hook, | 225 | __sum16 (*checksum)(struct sk_buff *skb, unsigned int hook, |
317 | unsigned int dataoff, u_int8_t protocol); | 226 | unsigned int dataoff, u_int8_t protocol); |
227 | int (*route)(struct dst_entry **dst, struct flowi *fl); | ||
318 | void (*saveroute)(const struct sk_buff *skb, | 228 | void (*saveroute)(const struct sk_buff *skb, |
319 | struct nf_info *info); | 229 | struct nf_queue_entry *entry); |
320 | int (*reroute)(struct sk_buff *skb, | 230 | int (*reroute)(struct sk_buff *skb, |
321 | const struct nf_info *info); | 231 | const struct nf_queue_entry *entry); |
322 | int route_key_size; | 232 | int route_key_size; |
323 | }; | 233 | }; |
324 | 234 | ||
325 | extern struct nf_afinfo *nf_afinfo[]; | 235 | extern const struct nf_afinfo *nf_afinfo[NPROTO]; |
326 | static inline struct nf_afinfo *nf_get_afinfo(unsigned short family) | 236 | static inline const struct nf_afinfo *nf_get_afinfo(unsigned short family) |
327 | { | 237 | { |
328 | return rcu_dereference(nf_afinfo[family]); | 238 | return rcu_dereference(nf_afinfo[family]); |
329 | } | 239 | } |
@@ -332,7 +242,7 @@ static inline __sum16 | |||
332 | nf_checksum(struct sk_buff *skb, unsigned int hook, unsigned int dataoff, | 242 | nf_checksum(struct sk_buff *skb, unsigned int hook, unsigned int dataoff, |
333 | u_int8_t protocol, unsigned short family) | 243 | u_int8_t protocol, unsigned short family) |
334 | { | 244 | { |
335 | struct nf_afinfo *afinfo; | 245 | const struct nf_afinfo *afinfo; |
336 | __sum16 csum = 0; | 246 | __sum16 csum = 0; |
337 | 247 | ||
338 | rcu_read_lock(); | 248 | rcu_read_lock(); |
@@ -343,10 +253,8 @@ nf_checksum(struct sk_buff *skb, unsigned int hook, unsigned int dataoff, | |||
343 | return csum; | 253 | return csum; |
344 | } | 254 | } |
345 | 255 | ||
346 | extern int nf_register_afinfo(struct nf_afinfo *afinfo); | 256 | extern int nf_register_afinfo(const struct nf_afinfo *afinfo); |
347 | extern void nf_unregister_afinfo(struct nf_afinfo *afinfo); | 257 | extern void nf_unregister_afinfo(const struct nf_afinfo *afinfo); |
348 | |||
349 | #define nf_info_reroute(x) ((void *)x + sizeof(struct nf_info)) | ||
350 | 258 | ||
351 | #include <net/flow.h> | 259 | #include <net/flow.h> |
352 | extern void (*ip_nat_decode_session)(struct sk_buff *, struct flowi *); | 260 | extern void (*ip_nat_decode_session)(struct sk_buff *, struct flowi *); |
@@ -354,11 +262,16 @@ extern void (*ip_nat_decode_session)(struct sk_buff *, struct flowi *); | |||
354 | static inline void | 262 | static inline void |
355 | nf_nat_decode_session(struct sk_buff *skb, struct flowi *fl, int family) | 263 | nf_nat_decode_session(struct sk_buff *skb, struct flowi *fl, int family) |
356 | { | 264 | { |
357 | #if defined(CONFIG_IP_NF_NAT_NEEDED) || defined(CONFIG_NF_NAT_NEEDED) | 265 | #ifdef CONFIG_NF_NAT_NEEDED |
358 | void (*decodefn)(struct sk_buff *, struct flowi *); | 266 | void (*decodefn)(struct sk_buff *, struct flowi *); |
359 | 267 | ||
360 | if (family == AF_INET && (decodefn = ip_nat_decode_session) != NULL) | 268 | if (family == AF_INET) { |
361 | decodefn(skb, fl); | 269 | rcu_read_lock(); |
270 | decodefn = rcu_dereference(ip_nat_decode_session); | ||
271 | if (decodefn) | ||
272 | decodefn(skb, fl); | ||
273 | rcu_read_unlock(); | ||
274 | } | ||
362 | #endif | 275 | #endif |
363 | } | 276 | } |
364 | 277 | ||
diff --git a/include/linux/netfilter/Kbuild b/include/linux/netfilter/Kbuild index b87e83a5e070..91fef0cae42f 100644 --- a/include/linux/netfilter/Kbuild +++ b/include/linux/netfilter/Kbuild | |||
@@ -10,6 +10,7 @@ header-y += xt_DSCP.h | |||
10 | header-y += xt_MARK.h | 10 | header-y += xt_MARK.h |
11 | header-y += xt_NFLOG.h | 11 | header-y += xt_NFLOG.h |
12 | header-y += xt_NFQUEUE.h | 12 | header-y += xt_NFQUEUE.h |
13 | header-y += xt_RATEEST.h | ||
13 | header-y += xt_SECMARK.h | 14 | header-y += xt_SECMARK.h |
14 | header-y += xt_TCPMSS.h | 15 | header-y += xt_TCPMSS.h |
15 | header-y += xt_comment.h | 16 | header-y += xt_comment.h |
@@ -20,14 +21,17 @@ header-y += xt_dccp.h | |||
20 | header-y += xt_dscp.h | 21 | header-y += xt_dscp.h |
21 | header-y += xt_esp.h | 22 | header-y += xt_esp.h |
22 | header-y += xt_hashlimit.h | 23 | header-y += xt_hashlimit.h |
24 | header-y += xt_iprange.h | ||
23 | header-y += xt_helper.h | 25 | header-y += xt_helper.h |
24 | header-y += xt_length.h | 26 | header-y += xt_length.h |
25 | header-y += xt_limit.h | 27 | header-y += xt_limit.h |
26 | header-y += xt_mac.h | 28 | header-y += xt_mac.h |
27 | header-y += xt_mark.h | 29 | header-y += xt_mark.h |
28 | header-y += xt_multiport.h | 30 | header-y += xt_multiport.h |
31 | header-y += xt_owner.h | ||
29 | header-y += xt_pkttype.h | 32 | header-y += xt_pkttype.h |
30 | header-y += xt_policy.h | 33 | header-y += xt_policy.h |
34 | header-y += xt_rateest.h | ||
31 | header-y += xt_realm.h | 35 | header-y += xt_realm.h |
32 | header-y += xt_sctp.h | 36 | header-y += xt_sctp.h |
33 | header-y += xt_state.h | 37 | header-y += xt_state.h |
diff --git a/include/linux/netfilter/nf_conntrack_common.h b/include/linux/netfilter/nf_conntrack_common.h index 9e0dae07861e..bad1eb760f61 100644 --- a/include/linux/netfilter/nf_conntrack_common.h +++ b/include/linux/netfilter/nf_conntrack_common.h | |||
@@ -129,6 +129,14 @@ enum ip_conntrack_events | |||
129 | /* Mark is set */ | 129 | /* Mark is set */ |
130 | IPCT_MARK_BIT = 12, | 130 | IPCT_MARK_BIT = 12, |
131 | IPCT_MARK = (1 << IPCT_MARK_BIT), | 131 | IPCT_MARK = (1 << IPCT_MARK_BIT), |
132 | |||
133 | /* NAT sequence adjustment */ | ||
134 | IPCT_NATSEQADJ_BIT = 13, | ||
135 | IPCT_NATSEQADJ = (1 << IPCT_NATSEQADJ_BIT), | ||
136 | |||
137 | /* Secmark is set */ | ||
138 | IPCT_SECMARK_BIT = 14, | ||
139 | IPCT_SECMARK = (1 << IPCT_SECMARK_BIT), | ||
132 | }; | 140 | }; |
133 | 141 | ||
134 | enum ip_conntrack_expect_events { | 142 | enum ip_conntrack_expect_events { |
diff --git a/include/linux/netfilter/nf_conntrack_h323.h b/include/linux/netfilter/nf_conntrack_h323.h index aabd24ac7631..26f9226ea72b 100644 --- a/include/linux/netfilter/nf_conntrack_h323.h +++ b/include/linux/netfilter/nf_conntrack_h323.h | |||
@@ -31,7 +31,7 @@ struct nf_conn; | |||
31 | 31 | ||
32 | extern int get_h225_addr(struct nf_conn *ct, unsigned char *data, | 32 | extern int get_h225_addr(struct nf_conn *ct, unsigned char *data, |
33 | TransportAddress *taddr, | 33 | TransportAddress *taddr, |
34 | union nf_conntrack_address *addr, __be16 *port); | 34 | union nf_inet_addr *addr, __be16 *port); |
35 | extern void nf_conntrack_h245_expect(struct nf_conn *new, | 35 | extern void nf_conntrack_h245_expect(struct nf_conn *new, |
36 | struct nf_conntrack_expect *this); | 36 | struct nf_conntrack_expect *this); |
37 | extern void nf_conntrack_q931_expect(struct nf_conn *new, | 37 | extern void nf_conntrack_q931_expect(struct nf_conn *new, |
@@ -39,12 +39,12 @@ extern void nf_conntrack_q931_expect(struct nf_conn *new, | |||
39 | extern int (*set_h245_addr_hook) (struct sk_buff *skb, | 39 | extern int (*set_h245_addr_hook) (struct sk_buff *skb, |
40 | unsigned char **data, int dataoff, | 40 | unsigned char **data, int dataoff, |
41 | H245_TransportAddress *taddr, | 41 | H245_TransportAddress *taddr, |
42 | union nf_conntrack_address *addr, | 42 | union nf_inet_addr *addr, |
43 | __be16 port); | 43 | __be16 port); |
44 | extern int (*set_h225_addr_hook) (struct sk_buff *skb, | 44 | extern int (*set_h225_addr_hook) (struct sk_buff *skb, |
45 | unsigned char **data, int dataoff, | 45 | unsigned char **data, int dataoff, |
46 | TransportAddress *taddr, | 46 | TransportAddress *taddr, |
47 | union nf_conntrack_address *addr, | 47 | union nf_inet_addr *addr, |
48 | __be16 port); | 48 | __be16 port); |
49 | extern int (*set_sig_addr_hook) (struct sk_buff *skb, | 49 | extern int (*set_sig_addr_hook) (struct sk_buff *skb, |
50 | struct nf_conn *ct, | 50 | struct nf_conn *ct, |
diff --git a/include/linux/netfilter/nf_conntrack_sctp.h b/include/linux/netfilter/nf_conntrack_sctp.h index 5cf2c115cce4..768f78c4ac53 100644 --- a/include/linux/netfilter/nf_conntrack_sctp.h +++ b/include/linux/netfilter/nf_conntrack_sctp.h | |||
@@ -21,7 +21,6 @@ struct ip_ct_sctp | |||
21 | enum sctp_conntrack state; | 21 | enum sctp_conntrack state; |
22 | 22 | ||
23 | __be32 vtag[IP_CT_DIR_MAX]; | 23 | __be32 vtag[IP_CT_DIR_MAX]; |
24 | u_int32_t ttag[IP_CT_DIR_MAX]; | ||
25 | }; | 24 | }; |
26 | 25 | ||
27 | #endif /* _NF_CONNTRACK_SCTP_H */ | 26 | #endif /* _NF_CONNTRACK_SCTP_H */ |
diff --git a/include/linux/netfilter/nfnetlink_conntrack.h b/include/linux/netfilter/nfnetlink_conntrack.h index 4affa3fe78e0..e3e1533aba2d 100644 --- a/include/linux/netfilter/nfnetlink_conntrack.h +++ b/include/linux/netfilter/nfnetlink_conntrack.h | |||
@@ -37,6 +37,9 @@ enum ctattr_type { | |||
37 | CTA_ID, | 37 | CTA_ID, |
38 | CTA_NAT_DST, | 38 | CTA_NAT_DST, |
39 | CTA_TUPLE_MASTER, | 39 | CTA_TUPLE_MASTER, |
40 | CTA_NAT_SEQ_ADJ_ORIG, | ||
41 | CTA_NAT_SEQ_ADJ_REPLY, | ||
42 | CTA_SECMARK, | ||
40 | __CTA_MAX | 43 | __CTA_MAX |
41 | }; | 44 | }; |
42 | #define CTA_MAX (__CTA_MAX - 1) | 45 | #define CTA_MAX (__CTA_MAX - 1) |
@@ -119,6 +122,14 @@ enum ctattr_protonat { | |||
119 | }; | 122 | }; |
120 | #define CTA_PROTONAT_MAX (__CTA_PROTONAT_MAX - 1) | 123 | #define CTA_PROTONAT_MAX (__CTA_PROTONAT_MAX - 1) |
121 | 124 | ||
125 | enum ctattr_natseq { | ||
126 | CTA_NAT_SEQ_CORRECTION_POS, | ||
127 | CTA_NAT_SEQ_OFFSET_BEFORE, | ||
128 | CTA_NAT_SEQ_OFFSET_AFTER, | ||
129 | __CTA_NAT_SEQ_MAX | ||
130 | }; | ||
131 | #define CTA_NAT_SEQ_MAX (__CTA_NAT_SEQ_MAX - 1) | ||
132 | |||
122 | enum ctattr_expect { | 133 | enum ctattr_expect { |
123 | CTA_EXPECT_UNSPEC, | 134 | CTA_EXPECT_UNSPEC, |
124 | CTA_EXPECT_MASTER, | 135 | CTA_EXPECT_MASTER, |
diff --git a/include/linux/netfilter/nfnetlink_log.h b/include/linux/netfilter/nfnetlink_log.h index 5966afa026e9..a85721332924 100644 --- a/include/linux/netfilter/nfnetlink_log.h +++ b/include/linux/netfilter/nfnetlink_log.h | |||
@@ -47,6 +47,7 @@ enum nfulnl_attr_type { | |||
47 | NFULA_UID, /* user id of socket */ | 47 | NFULA_UID, /* user id of socket */ |
48 | NFULA_SEQ, /* instance-local sequence number */ | 48 | NFULA_SEQ, /* instance-local sequence number */ |
49 | NFULA_SEQ_GLOBAL, /* global sequence number */ | 49 | NFULA_SEQ_GLOBAL, /* global sequence number */ |
50 | NFULA_GID, /* group id of socket */ | ||
50 | 51 | ||
51 | __NFULA_MAX | 52 | __NFULA_MAX |
52 | }; | 53 | }; |
diff --git a/include/linux/netfilter/x_tables.h b/include/linux/netfilter/x_tables.h index 03e6ce979eaa..b99ede51318a 100644 --- a/include/linux/netfilter/x_tables.h +++ b/include/linux/netfilter/x_tables.h | |||
@@ -126,6 +126,49 @@ struct xt_counters_info | |||
126 | 126 | ||
127 | #define XT_INV_PROTO 0x40 /* Invert the sense of PROTO. */ | 127 | #define XT_INV_PROTO 0x40 /* Invert the sense of PROTO. */ |
128 | 128 | ||
129 | /* fn returns 0 to continue iteration */ | ||
130 | #define XT_MATCH_ITERATE(type, e, fn, args...) \ | ||
131 | ({ \ | ||
132 | unsigned int __i; \ | ||
133 | int __ret = 0; \ | ||
134 | struct xt_entry_match *__m; \ | ||
135 | \ | ||
136 | for (__i = sizeof(type); \ | ||
137 | __i < (e)->target_offset; \ | ||
138 | __i += __m->u.match_size) { \ | ||
139 | __m = (void *)e + __i; \ | ||
140 | \ | ||
141 | __ret = fn(__m , ## args); \ | ||
142 | if (__ret != 0) \ | ||
143 | break; \ | ||
144 | } \ | ||
145 | __ret; \ | ||
146 | }) | ||
147 | |||
148 | /* fn returns 0 to continue iteration */ | ||
149 | #define XT_ENTRY_ITERATE_CONTINUE(type, entries, size, n, fn, args...) \ | ||
150 | ({ \ | ||
151 | unsigned int __i, __n; \ | ||
152 | int __ret = 0; \ | ||
153 | type *__entry; \ | ||
154 | \ | ||
155 | for (__i = 0, __n = 0; __i < (size); \ | ||
156 | __i += __entry->next_offset, __n++) { \ | ||
157 | __entry = (void *)(entries) + __i; \ | ||
158 | if (__n < n) \ | ||
159 | continue; \ | ||
160 | \ | ||
161 | __ret = fn(__entry , ## args); \ | ||
162 | if (__ret != 0) \ | ||
163 | break; \ | ||
164 | } \ | ||
165 | __ret; \ | ||
166 | }) | ||
167 | |||
168 | /* fn returns 0 to continue iteration */ | ||
169 | #define XT_ENTRY_ITERATE(type, entries, size, fn, args...) \ | ||
170 | XT_ENTRY_ITERATE_CONTINUE(type, entries, size, 0, fn, args) | ||
171 | |||
129 | #ifdef __KERNEL__ | 172 | #ifdef __KERNEL__ |
130 | 173 | ||
131 | #include <linux/netdevice.h> | 174 | #include <linux/netdevice.h> |
@@ -265,13 +308,16 @@ struct xt_table_info | |||
265 | unsigned int initial_entries; | 308 | unsigned int initial_entries; |
266 | 309 | ||
267 | /* Entry points and underflows */ | 310 | /* Entry points and underflows */ |
268 | unsigned int hook_entry[NF_IP_NUMHOOKS]; | 311 | unsigned int hook_entry[NF_INET_NUMHOOKS]; |
269 | unsigned int underflow[NF_IP_NUMHOOKS]; | 312 | unsigned int underflow[NF_INET_NUMHOOKS]; |
270 | 313 | ||
271 | /* ipt_entry tables: one per CPU */ | 314 | /* ipt_entry tables: one per CPU */ |
272 | char *entries[NR_CPUS]; | 315 | /* Note : this field MUST be the last one, see XT_TABLE_INFO_SZ */ |
316 | char *entries[1]; | ||
273 | }; | 317 | }; |
274 | 318 | ||
319 | #define XT_TABLE_INFO_SZ (offsetof(struct xt_table_info, entries) \ | ||
320 | + nr_cpu_ids * sizeof(char *)) | ||
275 | extern int xt_register_target(struct xt_target *target); | 321 | extern int xt_register_target(struct xt_target *target); |
276 | extern void xt_unregister_target(struct xt_target *target); | 322 | extern void xt_unregister_target(struct xt_target *target); |
277 | extern int xt_register_targets(struct xt_target *target, unsigned int n); | 323 | extern int xt_register_targets(struct xt_target *target, unsigned int n); |
@@ -378,9 +424,13 @@ struct compat_xt_counters_info | |||
378 | extern void xt_compat_lock(int af); | 424 | extern void xt_compat_lock(int af); |
379 | extern void xt_compat_unlock(int af); | 425 | extern void xt_compat_unlock(int af); |
380 | 426 | ||
427 | extern int xt_compat_add_offset(int af, unsigned int offset, short delta); | ||
428 | extern void xt_compat_flush_offsets(int af); | ||
429 | extern short xt_compat_calc_jump(int af, unsigned int offset); | ||
430 | |||
381 | extern int xt_compat_match_offset(struct xt_match *match); | 431 | extern int xt_compat_match_offset(struct xt_match *match); |
382 | extern void xt_compat_match_from_user(struct xt_entry_match *m, | 432 | extern int xt_compat_match_from_user(struct xt_entry_match *m, |
383 | void **dstptr, int *size); | 433 | void **dstptr, int *size); |
384 | extern int xt_compat_match_to_user(struct xt_entry_match *m, | 434 | extern int xt_compat_match_to_user(struct xt_entry_match *m, |
385 | void __user **dstptr, int *size); | 435 | void __user **dstptr, int *size); |
386 | 436 | ||
diff --git a/include/linux/netfilter/xt_CONNMARK.h b/include/linux/netfilter/xt_CONNMARK.h index 9f744689fffc..4e58ba43c289 100644 --- a/include/linux/netfilter/xt_CONNMARK.h +++ b/include/linux/netfilter/xt_CONNMARK.h | |||
@@ -22,4 +22,9 @@ struct xt_connmark_target_info { | |||
22 | u_int8_t mode; | 22 | u_int8_t mode; |
23 | }; | 23 | }; |
24 | 24 | ||
25 | struct xt_connmark_tginfo1 { | ||
26 | u_int32_t ctmark, ctmask, nfmask; | ||
27 | u_int8_t mode; | ||
28 | }; | ||
29 | |||
25 | #endif /*_XT_CONNMARK_H_target*/ | 30 | #endif /*_XT_CONNMARK_H_target*/ |
diff --git a/include/linux/netfilter/xt_DSCP.h b/include/linux/netfilter/xt_DSCP.h index 3c7c963997bd..14da1968e2c6 100644 --- a/include/linux/netfilter/xt_DSCP.h +++ b/include/linux/netfilter/xt_DSCP.h | |||
@@ -17,4 +17,9 @@ struct xt_DSCP_info { | |||
17 | u_int8_t dscp; | 17 | u_int8_t dscp; |
18 | }; | 18 | }; |
19 | 19 | ||
20 | struct xt_tos_target_info { | ||
21 | u_int8_t tos_value; | ||
22 | u_int8_t tos_mask; | ||
23 | }; | ||
24 | |||
20 | #endif /* _XT_DSCP_TARGET_H */ | 25 | #endif /* _XT_DSCP_TARGET_H */ |
diff --git a/include/linux/netfilter/xt_MARK.h b/include/linux/netfilter/xt_MARK.h index b021e93ee5d6..778b278fd9f2 100644 --- a/include/linux/netfilter/xt_MARK.h +++ b/include/linux/netfilter/xt_MARK.h | |||
@@ -18,4 +18,8 @@ struct xt_mark_target_info_v1 { | |||
18 | u_int8_t mode; | 18 | u_int8_t mode; |
19 | }; | 19 | }; |
20 | 20 | ||
21 | struct xt_mark_tginfo2 { | ||
22 | u_int32_t mark, mask; | ||
23 | }; | ||
24 | |||
21 | #endif /*_XT_MARK_H_target */ | 25 | #endif /*_XT_MARK_H_target */ |
diff --git a/include/linux/netfilter/xt_RATEEST.h b/include/linux/netfilter/xt_RATEEST.h new file mode 100644 index 000000000000..f79e3133cbea --- /dev/null +++ b/include/linux/netfilter/xt_RATEEST.h | |||
@@ -0,0 +1,13 @@ | |||
1 | #ifndef _XT_RATEEST_TARGET_H | ||
2 | #define _XT_RATEEST_TARGET_H | ||
3 | |||
4 | struct xt_rateest_target_info { | ||
5 | char name[IFNAMSIZ]; | ||
6 | int8_t interval; | ||
7 | u_int8_t ewma_log; | ||
8 | |||
9 | /* Used internally by the kernel */ | ||
10 | struct xt_rateest *est __attribute__((aligned(8))); | ||
11 | }; | ||
12 | |||
13 | #endif /* _XT_RATEEST_TARGET_H */ | ||
diff --git a/include/linux/netfilter/xt_TCPOPTSTRIP.h b/include/linux/netfilter/xt_TCPOPTSTRIP.h new file mode 100644 index 000000000000..2db543214ff5 --- /dev/null +++ b/include/linux/netfilter/xt_TCPOPTSTRIP.h | |||
@@ -0,0 +1,13 @@ | |||
1 | #ifndef _XT_TCPOPTSTRIP_H | ||
2 | #define _XT_TCPOPTSTRIP_H | ||
3 | |||
4 | #define tcpoptstrip_set_bit(bmap, idx) \ | ||
5 | (bmap[(idx) >> 5] |= 1U << (idx & 31)) | ||
6 | #define tcpoptstrip_test_bit(bmap, idx) \ | ||
7 | (((1U << (idx & 31)) & bmap[(idx) >> 5]) != 0) | ||
8 | |||
9 | struct xt_tcpoptstrip_target_info { | ||
10 | u_int32_t strip_bmap[8]; | ||
11 | }; | ||
12 | |||
13 | #endif /* _XT_TCPOPTSTRIP_H */ | ||
diff --git a/include/linux/netfilter/xt_connlimit.h b/include/linux/netfilter/xt_connlimit.h index 37e933c9987d..7e3284bcbd2b 100644 --- a/include/linux/netfilter/xt_connlimit.h +++ b/include/linux/netfilter/xt_connlimit.h | |||
@@ -5,12 +5,17 @@ struct xt_connlimit_data; | |||
5 | 5 | ||
6 | struct xt_connlimit_info { | 6 | struct xt_connlimit_info { |
7 | union { | 7 | union { |
8 | __be32 v4_mask; | 8 | union nf_inet_addr mask; |
9 | __be32 v6_mask[4]; | 9 | #ifndef __KERNEL__ |
10 | union { | ||
11 | __be32 v4_mask; | ||
12 | __be32 v6_mask[4]; | ||
13 | }; | ||
14 | #endif | ||
10 | }; | 15 | }; |
11 | unsigned int limit, inverse; | 16 | unsigned int limit, inverse; |
12 | 17 | ||
13 | /* this needs to be at the end */ | 18 | /* Used internally by the kernel */ |
14 | struct xt_connlimit_data *data __attribute__((aligned(8))); | 19 | struct xt_connlimit_data *data __attribute__((aligned(8))); |
15 | }; | 20 | }; |
16 | 21 | ||
diff --git a/include/linux/netfilter/xt_connmark.h b/include/linux/netfilter/xt_connmark.h index c592f6ae0883..359ef86918dc 100644 --- a/include/linux/netfilter/xt_connmark.h +++ b/include/linux/netfilter/xt_connmark.h | |||
@@ -15,4 +15,9 @@ struct xt_connmark_info { | |||
15 | u_int8_t invert; | 15 | u_int8_t invert; |
16 | }; | 16 | }; |
17 | 17 | ||
18 | struct xt_connmark_mtinfo1 { | ||
19 | u_int32_t mark, mask; | ||
20 | u_int8_t invert; | ||
21 | }; | ||
22 | |||
18 | #endif /*_XT_CONNMARK_H*/ | 23 | #endif /*_XT_CONNMARK_H*/ |
diff --git a/include/linux/netfilter/xt_conntrack.h b/include/linux/netfilter/xt_conntrack.h index 70b6f718cf4c..d2492a3329be 100644 --- a/include/linux/netfilter/xt_conntrack.h +++ b/include/linux/netfilter/xt_conntrack.h | |||
@@ -6,7 +6,9 @@ | |||
6 | #define _XT_CONNTRACK_H | 6 | #define _XT_CONNTRACK_H |
7 | 7 | ||
8 | #include <linux/netfilter/nf_conntrack_tuple_common.h> | 8 | #include <linux/netfilter/nf_conntrack_tuple_common.h> |
9 | #include <linux/in.h> | 9 | #ifdef __KERNEL__ |
10 | # include <linux/in.h> | ||
11 | #endif | ||
10 | 12 | ||
11 | #define XT_CONNTRACK_STATE_BIT(ctinfo) (1 << ((ctinfo)%IP_CT_IS_REPLY+1)) | 13 | #define XT_CONNTRACK_STATE_BIT(ctinfo) (1 << ((ctinfo)%IP_CT_IS_REPLY+1)) |
12 | #define XT_CONNTRACK_STATE_INVALID (1 << 0) | 14 | #define XT_CONNTRACK_STATE_INVALID (1 << 0) |
@@ -60,4 +62,16 @@ struct xt_conntrack_info | |||
60 | /* Inverse flags */ | 62 | /* Inverse flags */ |
61 | u_int8_t invflags; | 63 | u_int8_t invflags; |
62 | }; | 64 | }; |
65 | |||
66 | struct xt_conntrack_mtinfo1 { | ||
67 | union nf_inet_addr origsrc_addr, origsrc_mask; | ||
68 | union nf_inet_addr origdst_addr, origdst_mask; | ||
69 | union nf_inet_addr replsrc_addr, replsrc_mask; | ||
70 | union nf_inet_addr repldst_addr, repldst_mask; | ||
71 | u_int32_t expires_min, expires_max; | ||
72 | u_int16_t l4proto; | ||
73 | u_int8_t state_mask, status_mask; | ||
74 | u_int8_t match_flags, invert_flags; | ||
75 | }; | ||
76 | |||
63 | #endif /*_XT_CONNTRACK_H*/ | 77 | #endif /*_XT_CONNTRACK_H*/ |
diff --git a/include/linux/netfilter/xt_dscp.h b/include/linux/netfilter/xt_dscp.h index 1da61e6acaf7..f49bc1a648dc 100644 --- a/include/linux/netfilter/xt_dscp.h +++ b/include/linux/netfilter/xt_dscp.h | |||
@@ -20,4 +20,10 @@ struct xt_dscp_info { | |||
20 | u_int8_t invert; | 20 | u_int8_t invert; |
21 | }; | 21 | }; |
22 | 22 | ||
23 | struct xt_tos_match_info { | ||
24 | u_int8_t tos_mask; | ||
25 | u_int8_t tos_value; | ||
26 | u_int8_t invert; | ||
27 | }; | ||
28 | |||
23 | #endif /* _XT_DSCP_H */ | 29 | #endif /* _XT_DSCP_H */ |
diff --git a/include/linux/netfilter/xt_hashlimit.h b/include/linux/netfilter/xt_hashlimit.h index b4556b8edbfd..c19972e4564d 100644 --- a/include/linux/netfilter/xt_hashlimit.h +++ b/include/linux/netfilter/xt_hashlimit.h | |||
@@ -29,9 +29,9 @@ struct hashlimit_cfg { | |||
29 | struct xt_hashlimit_info { | 29 | struct xt_hashlimit_info { |
30 | char name [IFNAMSIZ]; /* name */ | 30 | char name [IFNAMSIZ]; /* name */ |
31 | struct hashlimit_cfg cfg; | 31 | struct hashlimit_cfg cfg; |
32 | struct xt_hashlimit_htable *hinfo; | ||
33 | 32 | ||
34 | /* Used internally by the kernel */ | 33 | /* Used internally by the kernel */ |
34 | struct xt_hashlimit_htable *hinfo; | ||
35 | union { | 35 | union { |
36 | void *ptr; | 36 | void *ptr; |
37 | struct xt_hashlimit_info *master; | 37 | struct xt_hashlimit_info *master; |
diff --git a/include/linux/netfilter/xt_iprange.h b/include/linux/netfilter/xt_iprange.h new file mode 100644 index 000000000000..a4299c7d3680 --- /dev/null +++ b/include/linux/netfilter/xt_iprange.h | |||
@@ -0,0 +1,17 @@ | |||
1 | #ifndef _LINUX_NETFILTER_XT_IPRANGE_H | ||
2 | #define _LINUX_NETFILTER_XT_IPRANGE_H 1 | ||
3 | |||
4 | enum { | ||
5 | IPRANGE_SRC = 1 << 0, /* match source IP address */ | ||
6 | IPRANGE_DST = 1 << 1, /* match destination IP address */ | ||
7 | IPRANGE_SRC_INV = 1 << 4, /* negate the condition */ | ||
8 | IPRANGE_DST_INV = 1 << 5, /* -"- */ | ||
9 | }; | ||
10 | |||
11 | struct xt_iprange_mtinfo { | ||
12 | union nf_inet_addr src_min, src_max; | ||
13 | union nf_inet_addr dst_min, dst_max; | ||
14 | u_int8_t flags; | ||
15 | }; | ||
16 | |||
17 | #endif /* _LINUX_NETFILTER_XT_IPRANGE_H */ | ||
diff --git a/include/linux/netfilter/xt_mark.h b/include/linux/netfilter/xt_mark.h index 802dd4842caf..fae74bc3f34e 100644 --- a/include/linux/netfilter/xt_mark.h +++ b/include/linux/netfilter/xt_mark.h | |||
@@ -6,4 +6,9 @@ struct xt_mark_info { | |||
6 | u_int8_t invert; | 6 | u_int8_t invert; |
7 | }; | 7 | }; |
8 | 8 | ||
9 | struct xt_mark_mtinfo1 { | ||
10 | u_int32_t mark, mask; | ||
11 | u_int8_t invert; | ||
12 | }; | ||
13 | |||
9 | #endif /*_XT_MARK_H*/ | 14 | #endif /*_XT_MARK_H*/ |
diff --git a/include/linux/netfilter/xt_owner.h b/include/linux/netfilter/xt_owner.h new file mode 100644 index 000000000000..eacd34efebd5 --- /dev/null +++ b/include/linux/netfilter/xt_owner.h | |||
@@ -0,0 +1,16 @@ | |||
1 | #ifndef _XT_OWNER_MATCH_H | ||
2 | #define _XT_OWNER_MATCH_H | ||
3 | |||
4 | enum { | ||
5 | XT_OWNER_UID = 1 << 0, | ||
6 | XT_OWNER_GID = 1 << 1, | ||
7 | XT_OWNER_SOCKET = 1 << 2, | ||
8 | }; | ||
9 | |||
10 | struct xt_owner_match_info { | ||
11 | u_int32_t uid; | ||
12 | u_int32_t gid; | ||
13 | u_int8_t match, invert; | ||
14 | }; | ||
15 | |||
16 | #endif /* _XT_OWNER_MATCH_H */ | ||
diff --git a/include/linux/netfilter/xt_policy.h b/include/linux/netfilter/xt_policy.h index 45654d359a68..053d8cc65464 100644 --- a/include/linux/netfilter/xt_policy.h +++ b/include/linux/netfilter/xt_policy.h | |||
@@ -27,18 +27,33 @@ struct xt_policy_spec | |||
27 | reqid:1; | 27 | reqid:1; |
28 | }; | 28 | }; |
29 | 29 | ||
30 | #ifndef __KERNEL__ | ||
30 | union xt_policy_addr | 31 | union xt_policy_addr |
31 | { | 32 | { |
32 | struct in_addr a4; | 33 | struct in_addr a4; |
33 | struct in6_addr a6; | 34 | struct in6_addr a6; |
34 | }; | 35 | }; |
36 | #endif | ||
35 | 37 | ||
36 | struct xt_policy_elem | 38 | struct xt_policy_elem |
37 | { | 39 | { |
38 | union xt_policy_addr saddr; | 40 | union { |
39 | union xt_policy_addr smask; | 41 | #ifdef __KERNEL__ |
40 | union xt_policy_addr daddr; | 42 | struct { |
41 | union xt_policy_addr dmask; | 43 | union nf_inet_addr saddr; |
44 | union nf_inet_addr smask; | ||
45 | union nf_inet_addr daddr; | ||
46 | union nf_inet_addr dmask; | ||
47 | }; | ||
48 | #else | ||
49 | struct { | ||
50 | union xt_policy_addr saddr; | ||
51 | union xt_policy_addr smask; | ||
52 | union xt_policy_addr daddr; | ||
53 | union xt_policy_addr dmask; | ||
54 | }; | ||
55 | #endif | ||
56 | }; | ||
42 | __be32 spi; | 57 | __be32 spi; |
43 | u_int32_t reqid; | 58 | u_int32_t reqid; |
44 | u_int8_t proto; | 59 | u_int8_t proto; |
diff --git a/include/linux/netfilter/xt_quota.h b/include/linux/netfilter/xt_quota.h index acd7fd77bbee..4c8368d781e5 100644 --- a/include/linux/netfilter/xt_quota.h +++ b/include/linux/netfilter/xt_quota.h | |||
@@ -9,6 +9,8 @@ enum xt_quota_flags { | |||
9 | struct xt_quota_info { | 9 | struct xt_quota_info { |
10 | u_int32_t flags; | 10 | u_int32_t flags; |
11 | u_int32_t pad; | 11 | u_int32_t pad; |
12 | |||
13 | /* Used internally by the kernel */ | ||
12 | aligned_u64 quota; | 14 | aligned_u64 quota; |
13 | struct xt_quota_info *master; | 15 | struct xt_quota_info *master; |
14 | }; | 16 | }; |
diff --git a/include/linux/netfilter/xt_rateest.h b/include/linux/netfilter/xt_rateest.h new file mode 100644 index 000000000000..2010cb74250f --- /dev/null +++ b/include/linux/netfilter/xt_rateest.h | |||
@@ -0,0 +1,35 @@ | |||
1 | #ifndef _XT_RATEEST_MATCH_H | ||
2 | #define _XT_RATEEST_MATCH_H | ||
3 | |||
4 | enum xt_rateest_match_flags { | ||
5 | XT_RATEEST_MATCH_INVERT = 1<<0, | ||
6 | XT_RATEEST_MATCH_ABS = 1<<1, | ||
7 | XT_RATEEST_MATCH_REL = 1<<2, | ||
8 | XT_RATEEST_MATCH_DELTA = 1<<3, | ||
9 | XT_RATEEST_MATCH_BPS = 1<<4, | ||
10 | XT_RATEEST_MATCH_PPS = 1<<5, | ||
11 | }; | ||
12 | |||
13 | enum xt_rateest_match_mode { | ||
14 | XT_RATEEST_MATCH_NONE, | ||
15 | XT_RATEEST_MATCH_EQ, | ||
16 | XT_RATEEST_MATCH_LT, | ||
17 | XT_RATEEST_MATCH_GT, | ||
18 | }; | ||
19 | |||
20 | struct xt_rateest_match_info { | ||
21 | char name1[IFNAMSIZ]; | ||
22 | char name2[IFNAMSIZ]; | ||
23 | u_int16_t flags; | ||
24 | u_int16_t mode; | ||
25 | u_int32_t bps1; | ||
26 | u_int32_t pps1; | ||
27 | u_int32_t bps2; | ||
28 | u_int32_t pps2; | ||
29 | |||
30 | /* Used internally by the kernel */ | ||
31 | struct xt_rateest *est1 __attribute__((aligned(8))); | ||
32 | struct xt_rateest *est2 __attribute__((aligned(8))); | ||
33 | }; | ||
34 | |||
35 | #endif /* _XT_RATEEST_MATCH_H */ | ||
diff --git a/include/linux/netfilter/xt_statistic.h b/include/linux/netfilter/xt_statistic.h index c344e9916e23..3d38bc975048 100644 --- a/include/linux/netfilter/xt_statistic.h +++ b/include/linux/netfilter/xt_statistic.h | |||
@@ -23,6 +23,7 @@ struct xt_statistic_info { | |||
23 | struct { | 23 | struct { |
24 | u_int32_t every; | 24 | u_int32_t every; |
25 | u_int32_t packet; | 25 | u_int32_t packet; |
26 | /* Used internally by the kernel */ | ||
26 | u_int32_t count; | 27 | u_int32_t count; |
27 | } nth; | 28 | } nth; |
28 | } u; | 29 | } u; |
diff --git a/include/linux/netfilter/xt_string.h b/include/linux/netfilter/xt_string.h index 3b3419f2637d..bb21dd1aee2d 100644 --- a/include/linux/netfilter/xt_string.h +++ b/include/linux/netfilter/xt_string.h | |||
@@ -12,6 +12,8 @@ struct xt_string_info | |||
12 | char pattern[XT_STRING_MAX_PATTERN_SIZE]; | 12 | char pattern[XT_STRING_MAX_PATTERN_SIZE]; |
13 | u_int8_t patlen; | 13 | u_int8_t patlen; |
14 | u_int8_t invert; | 14 | u_int8_t invert; |
15 | |||
16 | /* Used internally by the kernel */ | ||
15 | struct ts_config __attribute__((aligned(8))) *config; | 17 | struct ts_config __attribute__((aligned(8))) *config; |
16 | }; | 18 | }; |
17 | 19 | ||
diff --git a/include/linux/netfilter_arp/arp_tables.h b/include/linux/netfilter_arp/arp_tables.h index 2fc73fa8e37f..53dd4df27aa1 100644 --- a/include/linux/netfilter_arp/arp_tables.h +++ b/include/linux/netfilter_arp/arp_tables.h | |||
@@ -217,21 +217,8 @@ static __inline__ struct arpt_entry_target *arpt_get_target(struct arpt_entry *e | |||
217 | } | 217 | } |
218 | 218 | ||
219 | /* fn returns 0 to continue iteration */ | 219 | /* fn returns 0 to continue iteration */ |
220 | #define ARPT_ENTRY_ITERATE(entries, size, fn, args...) \ | 220 | #define ARPT_ENTRY_ITERATE(entries, size, fn, args...) \ |
221 | ({ \ | 221 | XT_ENTRY_ITERATE(struct arpt_entry, entries, size, fn, ## args) |
222 | unsigned int __i; \ | ||
223 | int __ret = 0; \ | ||
224 | struct arpt_entry *__entry; \ | ||
225 | \ | ||
226 | for (__i = 0; __i < (size); __i += __entry->next_offset) { \ | ||
227 | __entry = (void *)(entries) + __i; \ | ||
228 | \ | ||
229 | __ret = fn(__entry , ## args); \ | ||
230 | if (__ret != 0) \ | ||
231 | break; \ | ||
232 | } \ | ||
233 | __ret; \ | ||
234 | }) | ||
235 | 222 | ||
236 | /* | 223 | /* |
237 | * Main firewall chains definitions and global var's definitions. | 224 | * Main firewall chains definitions and global var's definitions. |
@@ -293,6 +280,37 @@ extern unsigned int arpt_do_table(struct sk_buff *skb, | |||
293 | const struct net_device *out, | 280 | const struct net_device *out, |
294 | struct arpt_table *table); | 281 | struct arpt_table *table); |
295 | 282 | ||
296 | #define ARPT_ALIGN(s) (((s) + (__alignof__(struct arpt_entry)-1)) & ~(__alignof__(struct arpt_entry)-1)) | 283 | #define ARPT_ALIGN(s) XT_ALIGN(s) |
284 | |||
285 | #ifdef CONFIG_COMPAT | ||
286 | #include <net/compat.h> | ||
287 | |||
288 | struct compat_arpt_entry | ||
289 | { | ||
290 | struct arpt_arp arp; | ||
291 | u_int16_t target_offset; | ||
292 | u_int16_t next_offset; | ||
293 | compat_uint_t comefrom; | ||
294 | struct compat_xt_counters counters; | ||
295 | unsigned char elems[0]; | ||
296 | }; | ||
297 | |||
298 | static inline struct arpt_entry_target * | ||
299 | compat_arpt_get_target(struct compat_arpt_entry *e) | ||
300 | { | ||
301 | return (void *)e + e->target_offset; | ||
302 | } | ||
303 | |||
304 | #define COMPAT_ARPT_ALIGN(s) COMPAT_XT_ALIGN(s) | ||
305 | |||
306 | /* fn returns 0 to continue iteration */ | ||
307 | #define COMPAT_ARPT_ENTRY_ITERATE(entries, size, fn, args...) \ | ||
308 | XT_ENTRY_ITERATE(struct compat_arpt_entry, entries, size, fn, ## args) | ||
309 | |||
310 | #define COMPAT_ARPT_ENTRY_ITERATE_CONTINUE(entries, size, n, fn, args...) \ | ||
311 | XT_ENTRY_ITERATE_CONTINUE(struct compat_arpt_entry, entries, size, n, \ | ||
312 | fn, ## args) | ||
313 | |||
314 | #endif /* CONFIG_COMPAT */ | ||
297 | #endif /*__KERNEL__*/ | 315 | #endif /*__KERNEL__*/ |
298 | #endif /* _ARPTABLES_H */ | 316 | #endif /* _ARPTABLES_H */ |
diff --git a/include/linux/netfilter_ipv4.h b/include/linux/netfilter_ipv4.h index 1a63adf5c4c1..9a10092e358c 100644 --- a/include/linux/netfilter_ipv4.h +++ b/include/linux/netfilter_ipv4.h | |||
@@ -36,7 +36,6 @@ | |||
36 | #define NFC_IP_DST_PT 0x0400 | 36 | #define NFC_IP_DST_PT 0x0400 |
37 | /* Something else about the proto */ | 37 | /* Something else about the proto */ |
38 | #define NFC_IP_PROTO_UNKNOWN 0x2000 | 38 | #define NFC_IP_PROTO_UNKNOWN 0x2000 |
39 | #endif /* ! __KERNEL__ */ | ||
40 | 39 | ||
41 | /* IP Hooks */ | 40 | /* IP Hooks */ |
42 | /* After promisc drops, checksum checks. */ | 41 | /* After promisc drops, checksum checks. */ |
@@ -50,6 +49,7 @@ | |||
50 | /* Packets about to hit the wire. */ | 49 | /* Packets about to hit the wire. */ |
51 | #define NF_IP_POST_ROUTING 4 | 50 | #define NF_IP_POST_ROUTING 4 |
52 | #define NF_IP_NUMHOOKS 5 | 51 | #define NF_IP_NUMHOOKS 5 |
52 | #endif /* ! __KERNEL__ */ | ||
53 | 53 | ||
54 | enum nf_ip_hook_priorities { | 54 | enum nf_ip_hook_priorities { |
55 | NF_IP_PRI_FIRST = INT_MIN, | 55 | NF_IP_PRI_FIRST = INT_MIN, |
diff --git a/include/linux/netfilter_ipv4/ip_tables.h b/include/linux/netfilter_ipv4/ip_tables.h index d79ed69cbc1f..45fcad91e67b 100644 --- a/include/linux/netfilter_ipv4/ip_tables.h +++ b/include/linux/netfilter_ipv4/ip_tables.h | |||
@@ -156,10 +156,10 @@ struct ipt_getinfo | |||
156 | unsigned int valid_hooks; | 156 | unsigned int valid_hooks; |
157 | 157 | ||
158 | /* Hook entry points: one per netfilter hook. */ | 158 | /* Hook entry points: one per netfilter hook. */ |
159 | unsigned int hook_entry[NF_IP_NUMHOOKS]; | 159 | unsigned int hook_entry[NF_INET_NUMHOOKS]; |
160 | 160 | ||
161 | /* Underflow points. */ | 161 | /* Underflow points. */ |
162 | unsigned int underflow[NF_IP_NUMHOOKS]; | 162 | unsigned int underflow[NF_INET_NUMHOOKS]; |
163 | 163 | ||
164 | /* Number of entries */ | 164 | /* Number of entries */ |
165 | unsigned int num_entries; | 165 | unsigned int num_entries; |
@@ -185,10 +185,10 @@ struct ipt_replace | |||
185 | unsigned int size; | 185 | unsigned int size; |
186 | 186 | ||
187 | /* Hook entry points. */ | 187 | /* Hook entry points. */ |
188 | unsigned int hook_entry[NF_IP_NUMHOOKS]; | 188 | unsigned int hook_entry[NF_INET_NUMHOOKS]; |
189 | 189 | ||
190 | /* Underflow points. */ | 190 | /* Underflow points. */ |
191 | unsigned int underflow[NF_IP_NUMHOOKS]; | 191 | unsigned int underflow[NF_INET_NUMHOOKS]; |
192 | 192 | ||
193 | /* Information about old entries: */ | 193 | /* Information about old entries: */ |
194 | /* Number of counters (must be equal to current number of entries). */ | 194 | /* Number of counters (must be equal to current number of entries). */ |
@@ -229,60 +229,12 @@ ipt_get_target(struct ipt_entry *e) | |||
229 | } | 229 | } |
230 | 230 | ||
231 | /* fn returns 0 to continue iteration */ | 231 | /* fn returns 0 to continue iteration */ |
232 | #define IPT_MATCH_ITERATE(e, fn, args...) \ | 232 | #define IPT_MATCH_ITERATE(e, fn, args...) \ |
233 | ({ \ | 233 | XT_MATCH_ITERATE(struct ipt_entry, e, fn, ## args) |
234 | unsigned int __i; \ | ||
235 | int __ret = 0; \ | ||
236 | struct ipt_entry_match *__match; \ | ||
237 | \ | ||
238 | for (__i = sizeof(struct ipt_entry); \ | ||
239 | __i < (e)->target_offset; \ | ||
240 | __i += __match->u.match_size) { \ | ||
241 | __match = (void *)(e) + __i; \ | ||
242 | \ | ||
243 | __ret = fn(__match , ## args); \ | ||
244 | if (__ret != 0) \ | ||
245 | break; \ | ||
246 | } \ | ||
247 | __ret; \ | ||
248 | }) | ||
249 | 234 | ||
250 | /* fn returns 0 to continue iteration */ | 235 | /* fn returns 0 to continue iteration */ |
251 | #define IPT_ENTRY_ITERATE(entries, size, fn, args...) \ | 236 | #define IPT_ENTRY_ITERATE(entries, size, fn, args...) \ |
252 | ({ \ | 237 | XT_ENTRY_ITERATE(struct ipt_entry, entries, size, fn, ## args) |
253 | unsigned int __i; \ | ||
254 | int __ret = 0; \ | ||
255 | struct ipt_entry *__entry; \ | ||
256 | \ | ||
257 | for (__i = 0; __i < (size); __i += __entry->next_offset) { \ | ||
258 | __entry = (void *)(entries) + __i; \ | ||
259 | \ | ||
260 | __ret = fn(__entry , ## args); \ | ||
261 | if (__ret != 0) \ | ||
262 | break; \ | ||
263 | } \ | ||
264 | __ret; \ | ||
265 | }) | ||
266 | |||
267 | /* fn returns 0 to continue iteration */ | ||
268 | #define IPT_ENTRY_ITERATE_CONTINUE(entries, size, n, fn, args...) \ | ||
269 | ({ \ | ||
270 | unsigned int __i, __n; \ | ||
271 | int __ret = 0; \ | ||
272 | struct ipt_entry *__entry; \ | ||
273 | \ | ||
274 | for (__i = 0, __n = 0; __i < (size); \ | ||
275 | __i += __entry->next_offset, __n++) { \ | ||
276 | __entry = (void *)(entries) + __i; \ | ||
277 | if (__n < n) \ | ||
278 | continue; \ | ||
279 | \ | ||
280 | __ret = fn(__entry , ## args); \ | ||
281 | if (__ret != 0) \ | ||
282 | break; \ | ||
283 | } \ | ||
284 | __ret; \ | ||
285 | }) | ||
286 | 238 | ||
287 | /* | 239 | /* |
288 | * Main firewall chains definitions and global var's definitions. | 240 | * Main firewall chains definitions and global var's definitions. |
@@ -359,8 +311,28 @@ struct compat_ipt_entry | |||
359 | unsigned char elems[0]; | 311 | unsigned char elems[0]; |
360 | }; | 312 | }; |
361 | 313 | ||
314 | /* Helper functions */ | ||
315 | static inline struct ipt_entry_target * | ||
316 | compat_ipt_get_target(struct compat_ipt_entry *e) | ||
317 | { | ||
318 | return (void *)e + e->target_offset; | ||
319 | } | ||
320 | |||
362 | #define COMPAT_IPT_ALIGN(s) COMPAT_XT_ALIGN(s) | 321 | #define COMPAT_IPT_ALIGN(s) COMPAT_XT_ALIGN(s) |
363 | 322 | ||
323 | /* fn returns 0 to continue iteration */ | ||
324 | #define COMPAT_IPT_MATCH_ITERATE(e, fn, args...) \ | ||
325 | XT_MATCH_ITERATE(struct compat_ipt_entry, e, fn, ## args) | ||
326 | |||
327 | /* fn returns 0 to continue iteration */ | ||
328 | #define COMPAT_IPT_ENTRY_ITERATE(entries, size, fn, args...) \ | ||
329 | XT_ENTRY_ITERATE(struct compat_ipt_entry, entries, size, fn, ## args) | ||
330 | |||
331 | /* fn returns 0 to continue iteration */ | ||
332 | #define COMPAT_IPT_ENTRY_ITERATE_CONTINUE(entries, size, n, fn, args...) \ | ||
333 | XT_ENTRY_ITERATE_CONTINUE(struct compat_ipt_entry, entries, size, n, \ | ||
334 | fn, ## args) | ||
335 | |||
364 | #endif /* CONFIG_COMPAT */ | 336 | #endif /* CONFIG_COMPAT */ |
365 | #endif /*__KERNEL__*/ | 337 | #endif /*__KERNEL__*/ |
366 | #endif /* _IPTABLES_H */ | 338 | #endif /* _IPTABLES_H */ |
diff --git a/include/linux/netfilter_ipv4/ipt_CLUSTERIP.h b/include/linux/netfilter_ipv4/ipt_CLUSTERIP.h index daf50be22c9d..e5a3687c8a72 100644 --- a/include/linux/netfilter_ipv4/ipt_CLUSTERIP.h +++ b/include/linux/netfilter_ipv4/ipt_CLUSTERIP.h | |||
@@ -27,6 +27,7 @@ struct ipt_clusterip_tgt_info { | |||
27 | u_int32_t hash_mode; | 27 | u_int32_t hash_mode; |
28 | u_int32_t hash_initval; | 28 | u_int32_t hash_initval; |
29 | 29 | ||
30 | /* Used internally by the kernel */ | ||
30 | struct clusterip_config *config; | 31 | struct clusterip_config *config; |
31 | }; | 32 | }; |
32 | 33 | ||
diff --git a/include/linux/netfilter_ipv4/ipt_addrtype.h b/include/linux/netfilter_ipv4/ipt_addrtype.h index 166ed01a8122..446de6aef983 100644 --- a/include/linux/netfilter_ipv4/ipt_addrtype.h +++ b/include/linux/netfilter_ipv4/ipt_addrtype.h | |||
@@ -1,6 +1,20 @@ | |||
1 | #ifndef _IPT_ADDRTYPE_H | 1 | #ifndef _IPT_ADDRTYPE_H |
2 | #define _IPT_ADDRTYPE_H | 2 | #define _IPT_ADDRTYPE_H |
3 | 3 | ||
4 | enum { | ||
5 | IPT_ADDRTYPE_INVERT_SOURCE = 0x0001, | ||
6 | IPT_ADDRTYPE_INVERT_DEST = 0x0002, | ||
7 | IPT_ADDRTYPE_LIMIT_IFACE_IN = 0x0004, | ||
8 | IPT_ADDRTYPE_LIMIT_IFACE_OUT = 0x0008, | ||
9 | }; | ||
10 | |||
11 | struct ipt_addrtype_info_v1 { | ||
12 | u_int16_t source; /* source-type mask */ | ||
13 | u_int16_t dest; /* dest-type mask */ | ||
14 | u_int32_t flags; | ||
15 | }; | ||
16 | |||
17 | /* revision 0 */ | ||
4 | struct ipt_addrtype_info { | 18 | struct ipt_addrtype_info { |
5 | u_int16_t source; /* source-type mask */ | 19 | u_int16_t source; /* source-type mask */ |
6 | u_int16_t dest; /* dest-type mask */ | 20 | u_int16_t dest; /* dest-type mask */ |
diff --git a/include/linux/netfilter_ipv4/ipt_iprange.h b/include/linux/netfilter_ipv4/ipt_iprange.h index a92fefc3c7ec..5f1aebde4d2f 100644 --- a/include/linux/netfilter_ipv4/ipt_iprange.h +++ b/include/linux/netfilter_ipv4/ipt_iprange.h | |||
@@ -2,11 +2,7 @@ | |||
2 | #define _IPT_IPRANGE_H | 2 | #define _IPT_IPRANGE_H |
3 | 3 | ||
4 | #include <linux/types.h> | 4 | #include <linux/types.h> |
5 | 5 | #include <linux/netfilter/xt_iprange.h> | |
6 | #define IPRANGE_SRC 0x01 /* Match source IP address */ | ||
7 | #define IPRANGE_DST 0x02 /* Match destination IP address */ | ||
8 | #define IPRANGE_SRC_INV 0x10 /* Negate the condition */ | ||
9 | #define IPRANGE_DST_INV 0x20 /* Negate the condition */ | ||
10 | 6 | ||
11 | struct ipt_iprange { | 7 | struct ipt_iprange { |
12 | /* Inclusive: network order. */ | 8 | /* Inclusive: network order. */ |
diff --git a/include/linux/netfilter_ipv6.h b/include/linux/netfilter_ipv6.h index 66ca8e3100dc..3475a65dae9b 100644 --- a/include/linux/netfilter_ipv6.h +++ b/include/linux/netfilter_ipv6.h | |||
@@ -40,8 +40,6 @@ | |||
40 | #define NFC_IP6_DST_PT 0x0400 | 40 | #define NFC_IP6_DST_PT 0x0400 |
41 | /* Something else about the proto */ | 41 | /* Something else about the proto */ |
42 | #define NFC_IP6_PROTO_UNKNOWN 0x2000 | 42 | #define NFC_IP6_PROTO_UNKNOWN 0x2000 |
43 | #endif /* ! __KERNEL__ */ | ||
44 | |||
45 | 43 | ||
46 | /* IP6 Hooks */ | 44 | /* IP6 Hooks */ |
47 | /* After promisc drops, checksum checks. */ | 45 | /* After promisc drops, checksum checks. */ |
@@ -55,6 +53,7 @@ | |||
55 | /* Packets about to hit the wire. */ | 53 | /* Packets about to hit the wire. */ |
56 | #define NF_IP6_POST_ROUTING 4 | 54 | #define NF_IP6_POST_ROUTING 4 |
57 | #define NF_IP6_NUMHOOKS 5 | 55 | #define NF_IP6_NUMHOOKS 5 |
56 | #endif /* ! __KERNEL__ */ | ||
58 | 57 | ||
59 | 58 | ||
60 | enum nf_ip6_hook_priorities { | 59 | enum nf_ip6_hook_priorities { |
diff --git a/include/linux/netfilter_ipv6/ip6_tables.h b/include/linux/netfilter_ipv6/ip6_tables.h index 7dc481ce7cba..110801d699ee 100644 --- a/include/linux/netfilter_ipv6/ip6_tables.h +++ b/include/linux/netfilter_ipv6/ip6_tables.h | |||
@@ -216,10 +216,10 @@ struct ip6t_getinfo | |||
216 | unsigned int valid_hooks; | 216 | unsigned int valid_hooks; |
217 | 217 | ||
218 | /* Hook entry points: one per netfilter hook. */ | 218 | /* Hook entry points: one per netfilter hook. */ |
219 | unsigned int hook_entry[NF_IP6_NUMHOOKS]; | 219 | unsigned int hook_entry[NF_INET_NUMHOOKS]; |
220 | 220 | ||
221 | /* Underflow points. */ | 221 | /* Underflow points. */ |
222 | unsigned int underflow[NF_IP6_NUMHOOKS]; | 222 | unsigned int underflow[NF_INET_NUMHOOKS]; |
223 | 223 | ||
224 | /* Number of entries */ | 224 | /* Number of entries */ |
225 | unsigned int num_entries; | 225 | unsigned int num_entries; |
@@ -245,10 +245,10 @@ struct ip6t_replace | |||
245 | unsigned int size; | 245 | unsigned int size; |
246 | 246 | ||
247 | /* Hook entry points. */ | 247 | /* Hook entry points. */ |
248 | unsigned int hook_entry[NF_IP6_NUMHOOKS]; | 248 | unsigned int hook_entry[NF_INET_NUMHOOKS]; |
249 | 249 | ||
250 | /* Underflow points. */ | 250 | /* Underflow points. */ |
251 | unsigned int underflow[NF_IP6_NUMHOOKS]; | 251 | unsigned int underflow[NF_INET_NUMHOOKS]; |
252 | 252 | ||
253 | /* Information about old entries: */ | 253 | /* Information about old entries: */ |
254 | /* Number of counters (must be equal to current number of entries). */ | 254 | /* Number of counters (must be equal to current number of entries). */ |
@@ -289,40 +289,12 @@ ip6t_get_target(struct ip6t_entry *e) | |||
289 | } | 289 | } |
290 | 290 | ||
291 | /* fn returns 0 to continue iteration */ | 291 | /* fn returns 0 to continue iteration */ |
292 | #define IP6T_MATCH_ITERATE(e, fn, args...) \ | 292 | #define IP6T_MATCH_ITERATE(e, fn, args...) \ |
293 | ({ \ | 293 | XT_MATCH_ITERATE(struct ip6t_entry, e, fn, ## args) |
294 | unsigned int __i; \ | ||
295 | int __ret = 0; \ | ||
296 | struct ip6t_entry_match *__m; \ | ||
297 | \ | ||
298 | for (__i = sizeof(struct ip6t_entry); \ | ||
299 | __i < (e)->target_offset; \ | ||
300 | __i += __m->u.match_size) { \ | ||
301 | __m = (void *)(e) + __i; \ | ||
302 | \ | ||
303 | __ret = fn(__m , ## args); \ | ||
304 | if (__ret != 0) \ | ||
305 | break; \ | ||
306 | } \ | ||
307 | __ret; \ | ||
308 | }) | ||
309 | 294 | ||
310 | /* fn returns 0 to continue iteration */ | 295 | /* fn returns 0 to continue iteration */ |
311 | #define IP6T_ENTRY_ITERATE(entries, size, fn, args...) \ | 296 | #define IP6T_ENTRY_ITERATE(entries, size, fn, args...) \ |
312 | ({ \ | 297 | XT_ENTRY_ITERATE(struct ip6t_entry, entries, size, fn, ## args) |
313 | unsigned int __i; \ | ||
314 | int __ret = 0; \ | ||
315 | struct ip6t_entry *__e; \ | ||
316 | \ | ||
317 | for (__i = 0; __i < (size); __i += __e->next_offset) { \ | ||
318 | __e = (void *)(entries) + __i; \ | ||
319 | \ | ||
320 | __ret = fn(__e , ## args); \ | ||
321 | if (__ret != 0) \ | ||
322 | break; \ | ||
323 | } \ | ||
324 | __ret; \ | ||
325 | }) | ||
326 | 298 | ||
327 | /* | 299 | /* |
328 | * Main firewall chains definitions and global var's definitions. | 300 | * Main firewall chains definitions and global var's definitions. |
@@ -352,7 +324,42 @@ extern int ip6_masked_addrcmp(const struct in6_addr *addr1, | |||
352 | const struct in6_addr *mask, | 324 | const struct in6_addr *mask, |
353 | const struct in6_addr *addr2); | 325 | const struct in6_addr *addr2); |
354 | 326 | ||
355 | #define IP6T_ALIGN(s) (((s) + (__alignof__(struct ip6t_entry)-1)) & ~(__alignof__(struct ip6t_entry)-1)) | 327 | #define IP6T_ALIGN(s) XT_ALIGN(s) |
356 | 328 | ||
329 | #ifdef CONFIG_COMPAT | ||
330 | #include <net/compat.h> | ||
331 | |||
332 | struct compat_ip6t_entry | ||
333 | { | ||
334 | struct ip6t_ip6 ipv6; | ||
335 | compat_uint_t nfcache; | ||
336 | u_int16_t target_offset; | ||
337 | u_int16_t next_offset; | ||
338 | compat_uint_t comefrom; | ||
339 | struct compat_xt_counters counters; | ||
340 | unsigned char elems[0]; | ||
341 | }; | ||
342 | |||
343 | static inline struct ip6t_entry_target * | ||
344 | compat_ip6t_get_target(struct compat_ip6t_entry *e) | ||
345 | { | ||
346 | return (void *)e + e->target_offset; | ||
347 | } | ||
348 | |||
349 | #define COMPAT_IP6T_ALIGN(s) COMPAT_XT_ALIGN(s) | ||
350 | |||
351 | /* fn returns 0 to continue iteration */ | ||
352 | #define COMPAT_IP6T_MATCH_ITERATE(e, fn, args...) \ | ||
353 | XT_MATCH_ITERATE(struct compat_ip6t_entry, e, fn, ## args) | ||
354 | |||
355 | /* fn returns 0 to continue iteration */ | ||
356 | #define COMPAT_IP6T_ENTRY_ITERATE(entries, size, fn, args...) \ | ||
357 | XT_ENTRY_ITERATE(struct compat_ip6t_entry, entries, size, fn, ## args) | ||
358 | |||
359 | #define COMPAT_IP6T_ENTRY_ITERATE_CONTINUE(entries, size, n, fn, args...) \ | ||
360 | XT_ENTRY_ITERATE_CONTINUE(struct compat_ip6t_entry, entries, size, n, \ | ||
361 | fn, ## args) | ||
362 | |||
363 | #endif /* CONFIG_COMPAT */ | ||
357 | #endif /*__KERNEL__*/ | 364 | #endif /*__KERNEL__*/ |
358 | #endif /* _IP6_TABLES_H */ | 365 | #endif /* _IP6_TABLES_H */ |
diff --git a/include/linux/netlink.h b/include/linux/netlink.h index d5bfaba595c7..bd13b6f4a98e 100644 --- a/include/linux/netlink.h +++ b/include/linux/netlink.h | |||
@@ -178,6 +178,7 @@ extern struct sock *netlink_kernel_create(struct net *net, | |||
178 | void (*input)(struct sk_buff *skb), | 178 | void (*input)(struct sk_buff *skb), |
179 | struct mutex *cb_mutex, | 179 | struct mutex *cb_mutex, |
180 | struct module *module); | 180 | struct module *module); |
181 | extern void netlink_kernel_release(struct sock *sk); | ||
181 | extern int netlink_change_ngroups(struct sock *sk, unsigned int groups); | 182 | extern int netlink_change_ngroups(struct sock *sk, unsigned int groups); |
182 | extern void netlink_clear_multicast_users(struct sock *sk, unsigned int group); | 183 | extern void netlink_clear_multicast_users(struct sock *sk, unsigned int group); |
183 | extern void netlink_ack(struct sk_buff *in_skb, struct nlmsghdr *nlh, int err); | 184 | extern void netlink_ack(struct sk_buff *in_skb, struct nlmsghdr *nlh, int err); |
@@ -245,7 +246,7 @@ __nlmsg_put(struct sk_buff *skb, u32 pid, u32 seq, int type, int len, int flags) | |||
245 | } | 246 | } |
246 | 247 | ||
247 | #define NLMSG_NEW(skb, pid, seq, type, len, flags) \ | 248 | #define NLMSG_NEW(skb, pid, seq, type, len, flags) \ |
248 | ({ if (skb_tailroom(skb) < (int)NLMSG_SPACE(len)) \ | 249 | ({ if (unlikely(skb_tailroom(skb) < (int)NLMSG_SPACE(len))) \ |
249 | goto nlmsg_failure; \ | 250 | goto nlmsg_failure; \ |
250 | __nlmsg_put(skb, pid, seq, type, len, flags); }) | 251 | __nlmsg_put(skb, pid, seq, type, len, flags); }) |
251 | 252 | ||
diff --git a/include/linux/netpoll.h b/include/linux/netpoll.h index 20250d963d72..a0525a1f4715 100644 --- a/include/linux/netpoll.h +++ b/include/linux/netpoll.h | |||
@@ -20,12 +20,11 @@ struct netpoll { | |||
20 | 20 | ||
21 | u32 local_ip, remote_ip; | 21 | u32 local_ip, remote_ip; |
22 | u16 local_port, remote_port; | 22 | u16 local_port, remote_port; |
23 | u8 local_mac[ETH_ALEN], remote_mac[ETH_ALEN]; | 23 | u8 remote_mac[ETH_ALEN]; |
24 | }; | 24 | }; |
25 | 25 | ||
26 | struct netpoll_info { | 26 | struct netpoll_info { |
27 | atomic_t refcnt; | 27 | atomic_t refcnt; |
28 | int rx_flags; | ||
29 | spinlock_t rx_lock; | 28 | spinlock_t rx_lock; |
30 | struct netpoll *rx_np; /* netpoll that registered an rx_hook */ | 29 | struct netpoll *rx_np; /* netpoll that registered an rx_hook */ |
31 | struct sk_buff_head arp_tx; /* list of arp requests to reply to */ | 30 | struct sk_buff_head arp_tx; /* list of arp requests to reply to */ |
@@ -51,12 +50,12 @@ static inline int netpoll_rx(struct sk_buff *skb) | |||
51 | unsigned long flags; | 50 | unsigned long flags; |
52 | int ret = 0; | 51 | int ret = 0; |
53 | 52 | ||
54 | if (!npinfo || (!npinfo->rx_np && !npinfo->rx_flags)) | 53 | if (!npinfo || !npinfo->rx_np) |
55 | return 0; | 54 | return 0; |
56 | 55 | ||
57 | spin_lock_irqsave(&npinfo->rx_lock, flags); | 56 | spin_lock_irqsave(&npinfo->rx_lock, flags); |
58 | /* check rx_flags again with the lock held */ | 57 | /* check rx_np again with the lock held */ |
59 | if (npinfo->rx_flags && __netpoll_rx(skb)) | 58 | if (npinfo->rx_np && __netpoll_rx(skb)) |
60 | ret = 1; | 59 | ret = 1; |
61 | spin_unlock_irqrestore(&npinfo->rx_lock, flags); | 60 | spin_unlock_irqrestore(&npinfo->rx_lock, flags); |
62 | 61 | ||
diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h index 538ee1dd3d0a..9fecf902419c 100644 --- a/include/linux/nl80211.h +++ b/include/linux/nl80211.h | |||
@@ -7,6 +7,18 @@ | |||
7 | */ | 7 | */ |
8 | 8 | ||
9 | /** | 9 | /** |
10 | * DOC: Station handling | ||
11 | * | ||
12 | * Stations are added per interface, but a special case exists with VLAN | ||
13 | * interfaces. When a station is bound to an AP interface, it may be moved | ||
14 | * into a VLAN identified by a VLAN interface index (%NL80211_ATTR_STA_VLAN). | ||
15 | * The station is still assumed to belong to the AP interface it was added | ||
16 | * to. | ||
17 | * | ||
18 | * TODO: need more info? | ||
19 | */ | ||
20 | |||
21 | /** | ||
10 | * enum nl80211_commands - supported nl80211 commands | 22 | * enum nl80211_commands - supported nl80211 commands |
11 | * | 23 | * |
12 | * @NL80211_CMD_UNSPEC: unspecified command to catch errors | 24 | * @NL80211_CMD_UNSPEC: unspecified command to catch errors |
@@ -37,6 +49,35 @@ | |||
37 | * userspace to request deletion of a virtual interface, then requires | 49 | * userspace to request deletion of a virtual interface, then requires |
38 | * attribute %NL80211_ATTR_IFINDEX. | 50 | * attribute %NL80211_ATTR_IFINDEX. |
39 | * | 51 | * |
52 | * @NL80211_CMD_GET_KEY: Get sequence counter information for a key specified | ||
53 | * by %NL80211_ATTR_KEY_IDX and/or %NL80211_ATTR_MAC. | ||
54 | * @NL80211_CMD_SET_KEY: Set key attributes %NL80211_ATTR_KEY_DEFAULT or | ||
55 | * %NL80211_ATTR_KEY_THRESHOLD. | ||
56 | * @NL80211_CMD_NEW_KEY: add a key with given %NL80211_ATTR_KEY_DATA, | ||
57 | * %NL80211_ATTR_KEY_IDX, %NL80211_ATTR_MAC and %NL80211_ATTR_KEY_CIPHER | ||
58 | * attributes. | ||
59 | * @NL80211_CMD_DEL_KEY: delete a key identified by %NL80211_ATTR_KEY_IDX | ||
60 | * or %NL80211_ATTR_MAC. | ||
61 | * | ||
62 | * @NL80211_CMD_GET_BEACON: retrieve beacon information (returned in a | ||
63 | * %NL80222_CMD_NEW_BEACON message) | ||
64 | * @NL80211_CMD_SET_BEACON: set the beacon on an access point interface | ||
65 | * using the %NL80211_ATTR_BEACON_INTERVAL, %NL80211_ATTR_DTIM_PERIOD, | ||
66 | * %NL80211_BEACON_HEAD and %NL80211_BEACON_TAIL attributes. | ||
67 | * @NL80211_CMD_NEW_BEACON: add a new beacon to an access point interface, | ||
68 | * parameters are like for %NL80211_CMD_SET_BEACON. | ||
69 | * @NL80211_CMD_DEL_BEACON: remove the beacon, stop sending it | ||
70 | * | ||
71 | * @NL80211_CMD_GET_STATION: Get station attributes for station identified by | ||
72 | * %NL80211_ATTR_MAC on the interface identified by %NL80211_ATTR_IFINDEX. | ||
73 | * @NL80211_CMD_SET_STATION: Set station attributes for station identified by | ||
74 | * %NL80211_ATTR_MAC on the interface identified by %NL80211_ATTR_IFINDEX. | ||
75 | * @NL80211_CMD_NEW_STATION: Add a station with given attributes to the | ||
76 | * the interface identified by %NL80211_ATTR_IFINDEX. | ||
77 | * @NL80211_CMD_DEL_STATION: Remove a station identified by %NL80211_ATTR_MAC | ||
78 | * or, if no MAC address given, all stations, on the interface identified | ||
79 | * by %NL80211_ATTR_IFINDEX. | ||
80 | * | ||
40 | * @NL80211_CMD_MAX: highest used command number | 81 | * @NL80211_CMD_MAX: highest used command number |
41 | * @__NL80211_CMD_AFTER_LAST: internal use | 82 | * @__NL80211_CMD_AFTER_LAST: internal use |
42 | */ | 83 | */ |
@@ -54,6 +95,21 @@ enum nl80211_commands { | |||
54 | NL80211_CMD_NEW_INTERFACE, | 95 | NL80211_CMD_NEW_INTERFACE, |
55 | NL80211_CMD_DEL_INTERFACE, | 96 | NL80211_CMD_DEL_INTERFACE, |
56 | 97 | ||
98 | NL80211_CMD_GET_KEY, | ||
99 | NL80211_CMD_SET_KEY, | ||
100 | NL80211_CMD_NEW_KEY, | ||
101 | NL80211_CMD_DEL_KEY, | ||
102 | |||
103 | NL80211_CMD_GET_BEACON, | ||
104 | NL80211_CMD_SET_BEACON, | ||
105 | NL80211_CMD_NEW_BEACON, | ||
106 | NL80211_CMD_DEL_BEACON, | ||
107 | |||
108 | NL80211_CMD_GET_STATION, | ||
109 | NL80211_CMD_SET_STATION, | ||
110 | NL80211_CMD_NEW_STATION, | ||
111 | NL80211_CMD_DEL_STATION, | ||
112 | |||
57 | /* add commands here */ | 113 | /* add commands here */ |
58 | 114 | ||
59 | /* used to define NL80211_CMD_MAX below */ | 115 | /* used to define NL80211_CMD_MAX below */ |
@@ -75,6 +131,36 @@ enum nl80211_commands { | |||
75 | * @NL80211_ATTR_IFNAME: network interface name | 131 | * @NL80211_ATTR_IFNAME: network interface name |
76 | * @NL80211_ATTR_IFTYPE: type of virtual interface, see &enum nl80211_iftype | 132 | * @NL80211_ATTR_IFTYPE: type of virtual interface, see &enum nl80211_iftype |
77 | * | 133 | * |
134 | * @NL80211_ATTR_MAC: MAC address (various uses) | ||
135 | * | ||
136 | * @NL80211_ATTR_KEY_DATA: (temporal) key data; for TKIP this consists of | ||
137 | * 16 bytes encryption key followed by 8 bytes each for TX and RX MIC | ||
138 | * keys | ||
139 | * @NL80211_ATTR_KEY_IDX: key ID (u8, 0-3) | ||
140 | * @NL80211_ATTR_KEY_CIPHER: key cipher suite (u32, as defined by IEEE 802.11 | ||
141 | * section 7.3.2.25.1, e.g. 0x000FAC04) | ||
142 | * @NL80211_ATTR_KEY_SEQ: transmit key sequence number (IV/PN) for TKIP and | ||
143 | * CCMP keys, each six bytes in little endian | ||
144 | * | ||
145 | * @NL80211_ATTR_BEACON_INTERVAL: beacon interval in TU | ||
146 | * @NL80211_ATTR_DTIM_PERIOD: DTIM period for beaconing | ||
147 | * @NL80211_ATTR_BEACON_HEAD: portion of the beacon before the TIM IE | ||
148 | * @NL80211_ATTR_BEACON_TAIL: portion of the beacon after the TIM IE | ||
149 | * | ||
150 | * @NL80211_ATTR_STA_AID: Association ID for the station (u16) | ||
151 | * @NL80211_ATTR_STA_FLAGS: flags, nested element with NLA_FLAG attributes of | ||
152 | * &enum nl80211_sta_flags. | ||
153 | * @NL80211_ATTR_STA_LISTEN_INTERVAL: listen interval as defined by | ||
154 | * IEEE 802.11 7.3.1.6 (u16). | ||
155 | * @NL80211_ATTR_STA_SUPPORTED_RATES: supported rates, array of supported | ||
156 | * rates as defined by IEEE 802.11 7.3.2.2 but without the length | ||
157 | * restriction (at most %NL80211_MAX_SUPP_RATES). | ||
158 | * @NL80211_ATTR_STA_VLAN: interface index of VLAN interface to move station | ||
159 | * to, or the AP interface the station was originally added to to. | ||
160 | * @NL80211_ATTR_STA_STATS: statistics for a station, part of station info | ||
161 | * given for %NL80211_CMD_GET_STATION, nested attribute containing | ||
162 | * info as possible, see &enum nl80211_sta_stats. | ||
163 | * | ||
78 | * @NL80211_ATTR_MAX: highest attribute number currently defined | 164 | * @NL80211_ATTR_MAX: highest attribute number currently defined |
79 | * @__NL80211_ATTR_AFTER_LAST: internal use | 165 | * @__NL80211_ATTR_AFTER_LAST: internal use |
80 | */ | 166 | */ |
@@ -89,12 +175,34 @@ enum nl80211_attrs { | |||
89 | NL80211_ATTR_IFNAME, | 175 | NL80211_ATTR_IFNAME, |
90 | NL80211_ATTR_IFTYPE, | 176 | NL80211_ATTR_IFTYPE, |
91 | 177 | ||
178 | NL80211_ATTR_MAC, | ||
179 | |||
180 | NL80211_ATTR_KEY_DATA, | ||
181 | NL80211_ATTR_KEY_IDX, | ||
182 | NL80211_ATTR_KEY_CIPHER, | ||
183 | NL80211_ATTR_KEY_SEQ, | ||
184 | NL80211_ATTR_KEY_DEFAULT, | ||
185 | |||
186 | NL80211_ATTR_BEACON_INTERVAL, | ||
187 | NL80211_ATTR_DTIM_PERIOD, | ||
188 | NL80211_ATTR_BEACON_HEAD, | ||
189 | NL80211_ATTR_BEACON_TAIL, | ||
190 | |||
191 | NL80211_ATTR_STA_AID, | ||
192 | NL80211_ATTR_STA_FLAGS, | ||
193 | NL80211_ATTR_STA_LISTEN_INTERVAL, | ||
194 | NL80211_ATTR_STA_SUPPORTED_RATES, | ||
195 | NL80211_ATTR_STA_VLAN, | ||
196 | NL80211_ATTR_STA_STATS, | ||
197 | |||
92 | /* add attributes here, update the policy in nl80211.c */ | 198 | /* add attributes here, update the policy in nl80211.c */ |
93 | 199 | ||
94 | __NL80211_ATTR_AFTER_LAST, | 200 | __NL80211_ATTR_AFTER_LAST, |
95 | NL80211_ATTR_MAX = __NL80211_ATTR_AFTER_LAST - 1 | 201 | NL80211_ATTR_MAX = __NL80211_ATTR_AFTER_LAST - 1 |
96 | }; | 202 | }; |
97 | 203 | ||
204 | #define NL80211_MAX_SUPP_RATES 32 | ||
205 | |||
98 | /** | 206 | /** |
99 | * enum nl80211_iftype - (virtual) interface types | 207 | * enum nl80211_iftype - (virtual) interface types |
100 | * | 208 | * |
@@ -126,4 +234,50 @@ enum nl80211_iftype { | |||
126 | NL80211_IFTYPE_MAX = __NL80211_IFTYPE_AFTER_LAST - 1 | 234 | NL80211_IFTYPE_MAX = __NL80211_IFTYPE_AFTER_LAST - 1 |
127 | }; | 235 | }; |
128 | 236 | ||
237 | /** | ||
238 | * enum nl80211_sta_flags - station flags | ||
239 | * | ||
240 | * Station flags. When a station is added to an AP interface, it is | ||
241 | * assumed to be already associated (and hence authenticated.) | ||
242 | * | ||
243 | * @NL80211_STA_FLAG_AUTHORIZED: station is authorized (802.1X) | ||
244 | * @NL80211_STA_FLAG_SHORT_PREAMBLE: station is capable of receiving frames | ||
245 | * with short barker preamble | ||
246 | * @NL80211_STA_FLAG_WME: station is WME/QoS capable | ||
247 | */ | ||
248 | enum nl80211_sta_flags { | ||
249 | __NL80211_STA_FLAG_INVALID, | ||
250 | NL80211_STA_FLAG_AUTHORIZED, | ||
251 | NL80211_STA_FLAG_SHORT_PREAMBLE, | ||
252 | NL80211_STA_FLAG_WME, | ||
253 | |||
254 | /* keep last */ | ||
255 | __NL80211_STA_FLAG_AFTER_LAST, | ||
256 | NL80211_STA_FLAG_MAX = __NL80211_STA_FLAG_AFTER_LAST - 1 | ||
257 | }; | ||
258 | |||
259 | /** | ||
260 | * enum nl80211_sta_stats - station statistics | ||
261 | * | ||
262 | * These attribute types are used with %NL80211_ATTR_STA_STATS | ||
263 | * when getting information about a station. | ||
264 | * | ||
265 | * @__NL80211_STA_STAT_INVALID: attribute number 0 is reserved | ||
266 | * @NL80211_STA_STAT_INACTIVE_TIME: time since last activity (u32, msecs) | ||
267 | * @NL80211_STA_STAT_RX_BYTES: total received bytes (u32, from this station) | ||
268 | * @NL80211_STA_STAT_TX_BYTES: total transmitted bytes (u32, to this station) | ||
269 | * @__NL80211_STA_STAT_AFTER_LAST: internal | ||
270 | * @NL80211_STA_STAT_MAX: highest possible station stats attribute | ||
271 | */ | ||
272 | enum nl80211_sta_stats { | ||
273 | __NL80211_STA_STAT_INVALID, | ||
274 | NL80211_STA_STAT_INACTIVE_TIME, | ||
275 | NL80211_STA_STAT_RX_BYTES, | ||
276 | NL80211_STA_STAT_TX_BYTES, | ||
277 | |||
278 | /* keep last */ | ||
279 | __NL80211_STA_STAT_AFTER_LAST, | ||
280 | NL80211_STA_STAT_MAX = __NL80211_STA_STAT_AFTER_LAST - 1 | ||
281 | }; | ||
282 | |||
129 | #endif /* __LINUX_NL80211_H */ | 283 | #endif /* __LINUX_NL80211_H */ |
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index 1fbd0256e86b..c69531348363 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
@@ -1943,6 +1943,7 @@ | |||
1943 | #define PCI_DEVICE_ID_NX2_5706 0x164a | 1943 | #define PCI_DEVICE_ID_NX2_5706 0x164a |
1944 | #define PCI_DEVICE_ID_NX2_5708 0x164c | 1944 | #define PCI_DEVICE_ID_NX2_5708 0x164c |
1945 | #define PCI_DEVICE_ID_TIGON3_5702FE 0x164d | 1945 | #define PCI_DEVICE_ID_TIGON3_5702FE 0x164d |
1946 | #define PCI_DEVICE_ID_NX2_57710 0x164e | ||
1946 | #define PCI_DEVICE_ID_TIGON3_5705 0x1653 | 1947 | #define PCI_DEVICE_ID_TIGON3_5705 0x1653 |
1947 | #define PCI_DEVICE_ID_TIGON3_5705_2 0x1654 | 1948 | #define PCI_DEVICE_ID_TIGON3_5705_2 0x1654 |
1948 | #define PCI_DEVICE_ID_TIGON3_5720 0x1658 | 1949 | #define PCI_DEVICE_ID_TIGON3_5720 0x1658 |
@@ -2081,6 +2082,9 @@ | |||
2081 | #define PCI_DEVICE_ID_ALTIMA_AC9100 0x03ea | 2082 | #define PCI_DEVICE_ID_ALTIMA_AC9100 0x03ea |
2082 | #define PCI_DEVICE_ID_ALTIMA_AC1003 0x03eb | 2083 | #define PCI_DEVICE_ID_ALTIMA_AC1003 0x03eb |
2083 | 2084 | ||
2085 | #define PCI_VENDOR_ID_BELKIN 0x1799 | ||
2086 | #define PCI_DEVICE_ID_BELKIN_F5D7010V7 0x701f | ||
2087 | |||
2084 | #define PCI_VENDOR_ID_LENOVO 0x17aa | 2088 | #define PCI_VENDOR_ID_LENOVO 0x17aa |
2085 | 2089 | ||
2086 | #define PCI_VENDOR_ID_ARECA 0x17d3 | 2090 | #define PCI_VENDOR_ID_ARECA 0x17d3 |
@@ -2109,6 +2113,8 @@ | |||
2109 | #define PCI_DEVICE_ID_HERC_WIN 0x5732 | 2113 | #define PCI_DEVICE_ID_HERC_WIN 0x5732 |
2110 | #define PCI_DEVICE_ID_HERC_UNI 0x5832 | 2114 | #define PCI_DEVICE_ID_HERC_UNI 0x5832 |
2111 | 2115 | ||
2116 | #define PCI_VENDOR_ID_RDC 0x17f3 | ||
2117 | |||
2112 | #define PCI_VENDOR_ID_SITECOM 0x182d | 2118 | #define PCI_VENDOR_ID_SITECOM 0x182d |
2113 | #define PCI_DEVICE_ID_SITECOM_DC105V2 0x3069 | 2119 | #define PCI_DEVICE_ID_SITECOM_DC105V2 0x3069 |
2114 | 2120 | ||
diff --git a/include/linux/pcounter.h b/include/linux/pcounter.h new file mode 100644 index 000000000000..a82d9f2628ca --- /dev/null +++ b/include/linux/pcounter.h | |||
@@ -0,0 +1,74 @@ | |||
1 | #ifndef __LINUX_PCOUNTER_H | ||
2 | #define __LINUX_PCOUNTER_H | ||
3 | /* | ||
4 | * Using a dynamic percpu 'int' variable has a cost : | ||
5 | * 1) Extra dereference | ||
6 | * Current per_cpu_ptr() implementation uses an array per 'percpu variable'. | ||
7 | * 2) memory cost of NR_CPUS*(32+sizeof(void *)) instead of num_possible_cpus()*4 | ||
8 | * | ||
9 | * This pcounter implementation is an abstraction to be able to use | ||
10 | * either a static or a dynamic per cpu variable. | ||
11 | * One dynamic per cpu variable gets a fast & cheap implementation, we can | ||
12 | * change pcounter implementation too. | ||
13 | */ | ||
14 | struct pcounter { | ||
15 | #ifdef CONFIG_SMP | ||
16 | void (*add)(struct pcounter *self, int inc); | ||
17 | int (*getval)(const struct pcounter *self, int cpu); | ||
18 | int *per_cpu_values; | ||
19 | #else | ||
20 | int val; | ||
21 | #endif | ||
22 | }; | ||
23 | |||
24 | #ifdef CONFIG_SMP | ||
25 | #include <linux/percpu.h> | ||
26 | |||
27 | #define DEFINE_PCOUNTER(NAME) \ | ||
28 | static DEFINE_PER_CPU(int, NAME##_pcounter_values); \ | ||
29 | static void NAME##_pcounter_add(struct pcounter *self, int val) \ | ||
30 | { \ | ||
31 | __get_cpu_var(NAME##_pcounter_values) += val; \ | ||
32 | } \ | ||
33 | static int NAME##_pcounter_getval(const struct pcounter *self, int cpu) \ | ||
34 | { \ | ||
35 | return per_cpu(NAME##_pcounter_values, cpu); \ | ||
36 | } \ | ||
37 | |||
38 | #define PCOUNTER_MEMBER_INITIALIZER(NAME, MEMBER) \ | ||
39 | MEMBER = { \ | ||
40 | .add = NAME##_pcounter_add, \ | ||
41 | .getval = NAME##_pcounter_getval, \ | ||
42 | } | ||
43 | |||
44 | |||
45 | static inline void pcounter_add(struct pcounter *self, int inc) | ||
46 | { | ||
47 | self->add(self, inc); | ||
48 | } | ||
49 | |||
50 | extern int pcounter_getval(const struct pcounter *self); | ||
51 | extern int pcounter_alloc(struct pcounter *self); | ||
52 | extern void pcounter_free(struct pcounter *self); | ||
53 | |||
54 | |||
55 | #else /* CONFIG_SMP */ | ||
56 | |||
57 | static inline void pcounter_add(struct pcounter *self, int inc) | ||
58 | { | ||
59 | self->val += inc; | ||
60 | } | ||
61 | |||
62 | static inline int pcounter_getval(const struct pcounter *self) | ||
63 | { | ||
64 | return self->val; | ||
65 | } | ||
66 | |||
67 | #define DEFINE_PCOUNTER(NAME) | ||
68 | #define PCOUNTER_MEMBER_INITIALIZER(NAME, MEMBER) | ||
69 | #define pcounter_alloc(self) 0 | ||
70 | #define pcounter_free(self) | ||
71 | |||
72 | #endif /* CONFIG_SMP */ | ||
73 | |||
74 | #endif /* __LINUX_PCOUNTER_H */ | ||
diff --git a/include/linux/pkt_sched.h b/include/linux/pkt_sched.h index 919af93b7059..32761352e858 100644 --- a/include/linux/pkt_sched.h +++ b/include/linux/pkt_sched.h | |||
@@ -83,6 +83,8 @@ struct tc_ratespec | |||
83 | __u32 rate; | 83 | __u32 rate; |
84 | }; | 84 | }; |
85 | 85 | ||
86 | #define TC_RTAB_SIZE 1024 | ||
87 | |||
86 | /* FIFO section */ | 88 | /* FIFO section */ |
87 | 89 | ||
88 | struct tc_fifo_qopt | 90 | struct tc_fifo_qopt |
diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h index a5316829215b..8f92546b403d 100644 --- a/include/linux/proc_fs.h +++ b/include/linux/proc_fs.h | |||
@@ -201,6 +201,8 @@ static inline struct proc_dir_entry *create_proc_info_entry(const char *name, | |||
201 | extern struct proc_dir_entry *proc_net_fops_create(struct net *net, | 201 | extern struct proc_dir_entry *proc_net_fops_create(struct net *net, |
202 | const char *name, mode_t mode, const struct file_operations *fops); | 202 | const char *name, mode_t mode, const struct file_operations *fops); |
203 | extern void proc_net_remove(struct net *net, const char *name); | 203 | extern void proc_net_remove(struct net *net, const char *name); |
204 | extern struct proc_dir_entry *proc_net_mkdir(struct net *net, const char *name, | ||
205 | struct proc_dir_entry *parent); | ||
204 | 206 | ||
205 | #else | 207 | #else |
206 | 208 | ||
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h index 4e81836191df..b014f6b7fe29 100644 --- a/include/linux/rtnetlink.h +++ b/include/linux/rtnetlink.h | |||
@@ -100,6 +100,13 @@ enum { | |||
100 | RTM_NEWNDUSEROPT = 68, | 100 | RTM_NEWNDUSEROPT = 68, |
101 | #define RTM_NEWNDUSEROPT RTM_NEWNDUSEROPT | 101 | #define RTM_NEWNDUSEROPT RTM_NEWNDUSEROPT |
102 | 102 | ||
103 | RTM_NEWADDRLABEL = 72, | ||
104 | #define RTM_NEWADDRLABEL RTM_NEWADDRLABEL | ||
105 | RTM_DELADDRLABEL, | ||
106 | #define RTM_NEWADDRLABEL RTM_NEWADDRLABEL | ||
107 | RTM_GETADDRLABEL, | ||
108 | #define RTM_GETADDRLABEL RTM_GETADDRLABEL | ||
109 | |||
103 | __RTM_MAX, | 110 | __RTM_MAX, |
104 | #define RTM_MAX (((__RTM_MAX + 3) & ~3) - 1) | 111 | #define RTM_MAX (((__RTM_MAX + 3) & ~3) - 1) |
105 | }; | 112 | }; |
@@ -613,11 +620,11 @@ extern int __rtattr_parse_nested_compat(struct rtattr *tb[], int maxattr, | |||
613 | ({ data = RTA_PAYLOAD(rta) >= len ? RTA_DATA(rta) : NULL; \ | 620 | ({ data = RTA_PAYLOAD(rta) >= len ? RTA_DATA(rta) : NULL; \ |
614 | __rtattr_parse_nested_compat(tb, max, rta, len); }) | 621 | __rtattr_parse_nested_compat(tb, max, rta, len); }) |
615 | 622 | ||
616 | extern int rtnetlink_send(struct sk_buff *skb, u32 pid, u32 group, int echo); | 623 | extern int rtnetlink_send(struct sk_buff *skb, struct net *net, u32 pid, u32 group, int echo); |
617 | extern int rtnl_unicast(struct sk_buff *skb, u32 pid); | 624 | extern int rtnl_unicast(struct sk_buff *skb, struct net *net, u32 pid); |
618 | extern int rtnl_notify(struct sk_buff *skb, u32 pid, u32 group, | 625 | extern int rtnl_notify(struct sk_buff *skb, struct net *net, u32 pid, u32 group, |
619 | struct nlmsghdr *nlh, gfp_t flags); | 626 | struct nlmsghdr *nlh, gfp_t flags); |
620 | extern void rtnl_set_sk_err(u32 group, int error); | 627 | extern void rtnl_set_sk_err(struct net *net, u32 group, int error); |
621 | extern int rtnetlink_put_metrics(struct sk_buff *skb, u32 *metrics); | 628 | extern int rtnetlink_put_metrics(struct sk_buff *skb, u32 *metrics); |
622 | extern int rtnl_put_cacheinfo(struct sk_buff *skb, struct dst_entry *dst, | 629 | extern int rtnl_put_cacheinfo(struct sk_buff *skb, struct dst_entry *dst, |
623 | u32 id, u32 ts, u32 tsage, long expires, | 630 | u32 id, u32 ts, u32 tsage, long expires, |
diff --git a/include/linux/seq_file.h b/include/linux/seq_file.h index ebbc02b325fc..648dfeb444db 100644 --- a/include/linux/seq_file.h +++ b/include/linux/seq_file.h | |||
@@ -63,5 +63,18 @@ extern struct list_head *seq_list_start_head(struct list_head *head, | |||
63 | extern struct list_head *seq_list_next(void *v, struct list_head *head, | 63 | extern struct list_head *seq_list_next(void *v, struct list_head *head, |
64 | loff_t *ppos); | 64 | loff_t *ppos); |
65 | 65 | ||
66 | struct net; | ||
67 | struct seq_net_private { | ||
68 | struct net *net; | ||
69 | }; | ||
70 | |||
71 | int seq_open_net(struct inode *, struct file *, | ||
72 | const struct seq_operations *, int); | ||
73 | int seq_release_net(struct inode *, struct file *); | ||
74 | static inline struct net *seq_file_net(struct seq_file *seq) | ||
75 | { | ||
76 | return ((struct seq_net_private *)seq->private)->net; | ||
77 | } | ||
78 | |||
66 | #endif | 79 | #endif |
67 | #endif | 80 | #endif |
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index bddd50bd6878..c618fbf7d173 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
@@ -95,6 +95,7 @@ | |||
95 | 95 | ||
96 | struct net_device; | 96 | struct net_device; |
97 | struct scatterlist; | 97 | struct scatterlist; |
98 | struct pipe_inode_info; | ||
98 | 99 | ||
99 | #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) | 100 | #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) |
100 | struct nf_conntrack { | 101 | struct nf_conntrack { |
@@ -287,6 +288,7 @@ struct sk_buff { | |||
287 | __u8 pkt_type:3, | 288 | __u8 pkt_type:3, |
288 | fclone:2, | 289 | fclone:2, |
289 | ipvs_property:1, | 290 | ipvs_property:1, |
291 | peeked:1, | ||
290 | nf_trace:1; | 292 | nf_trace:1; |
291 | __be16 protocol; | 293 | __be16 protocol; |
292 | 294 | ||
@@ -1537,6 +1539,8 @@ static inline int pskb_trim_rcsum(struct sk_buff *skb, unsigned int len) | |||
1537 | skb = skb->prev) | 1539 | skb = skb->prev) |
1538 | 1540 | ||
1539 | 1541 | ||
1542 | extern struct sk_buff *__skb_recv_datagram(struct sock *sk, unsigned flags, | ||
1543 | int *peeked, int *err); | ||
1540 | extern struct sk_buff *skb_recv_datagram(struct sock *sk, unsigned flags, | 1544 | extern struct sk_buff *skb_recv_datagram(struct sock *sk, unsigned flags, |
1541 | int noblock, int *err); | 1545 | int noblock, int *err); |
1542 | extern unsigned int datagram_poll(struct file *file, struct socket *sock, | 1546 | extern unsigned int datagram_poll(struct file *file, struct socket *sock, |
@@ -1548,7 +1552,7 @@ extern int skb_copy_and_csum_datagram_iovec(struct sk_buff *skb, | |||
1548 | int hlen, | 1552 | int hlen, |
1549 | struct iovec *iov); | 1553 | struct iovec *iov); |
1550 | extern void skb_free_datagram(struct sock *sk, struct sk_buff *skb); | 1554 | extern void skb_free_datagram(struct sock *sk, struct sk_buff *skb); |
1551 | extern void skb_kill_datagram(struct sock *sk, struct sk_buff *skb, | 1555 | extern int skb_kill_datagram(struct sock *sk, struct sk_buff *skb, |
1552 | unsigned int flags); | 1556 | unsigned int flags); |
1553 | extern __wsum skb_checksum(const struct sk_buff *skb, int offset, | 1557 | extern __wsum skb_checksum(const struct sk_buff *skb, int offset, |
1554 | int len, __wsum csum); | 1558 | int len, __wsum csum); |
@@ -1559,6 +1563,11 @@ extern int skb_store_bits(struct sk_buff *skb, int offset, | |||
1559 | extern __wsum skb_copy_and_csum_bits(const struct sk_buff *skb, | 1563 | extern __wsum skb_copy_and_csum_bits(const struct sk_buff *skb, |
1560 | int offset, u8 *to, int len, | 1564 | int offset, u8 *to, int len, |
1561 | __wsum csum); | 1565 | __wsum csum); |
1566 | extern int skb_splice_bits(struct sk_buff *skb, | ||
1567 | unsigned int offset, | ||
1568 | struct pipe_inode_info *pipe, | ||
1569 | unsigned int len, | ||
1570 | unsigned int flags); | ||
1562 | extern void skb_copy_and_csum_dev(const struct sk_buff *skb, u8 *to); | 1571 | extern void skb_copy_and_csum_dev(const struct sk_buff *skb, u8 *to); |
1563 | extern void skb_split(struct sk_buff *skb, | 1572 | extern void skb_split(struct sk_buff *skb, |
1564 | struct sk_buff *skb1, const u32 len); | 1573 | struct sk_buff *skb1, const u32 len); |
diff --git a/include/linux/snmp.h b/include/linux/snmp.h index 89f0c2b5f405..86d3effb2836 100644 --- a/include/linux/snmp.h +++ b/include/linux/snmp.h | |||
@@ -217,4 +217,35 @@ enum | |||
217 | __LINUX_MIB_MAX | 217 | __LINUX_MIB_MAX |
218 | }; | 218 | }; |
219 | 219 | ||
220 | /* linux Xfrm mib definitions */ | ||
221 | enum | ||
222 | { | ||
223 | LINUX_MIB_XFRMNUM = 0, | ||
224 | LINUX_MIB_XFRMINERROR, /* XfrmInError */ | ||
225 | LINUX_MIB_XFRMINBUFFERERROR, /* XfrmInBufferError */ | ||
226 | LINUX_MIB_XFRMINHDRERROR, /* XfrmInHdrError */ | ||
227 | LINUX_MIB_XFRMINNOSTATES, /* XfrmInNoStates */ | ||
228 | LINUX_MIB_XFRMINSTATEPROTOERROR, /* XfrmInStateProtoError */ | ||
229 | LINUX_MIB_XFRMINSTATEMODEERROR, /* XfrmInStateModeError */ | ||
230 | LINUX_MIB_XFRMINSEQOUTOFWINDOW, /* XfrmInSeqOutOfWindow */ | ||
231 | LINUX_MIB_XFRMINSTATEEXPIRED, /* XfrmInStateExpired */ | ||
232 | LINUX_MIB_XFRMINSTATEMISMATCH, /* XfrmInStateMismatch */ | ||
233 | LINUX_MIB_XFRMINSTATEINVALID, /* XfrmInStateInvalid */ | ||
234 | LINUX_MIB_XFRMINTMPLMISMATCH, /* XfrmInTmplMismatch */ | ||
235 | LINUX_MIB_XFRMINNOPOLS, /* XfrmInNoPols */ | ||
236 | LINUX_MIB_XFRMINPOLBLOCK, /* XfrmInPolBlock */ | ||
237 | LINUX_MIB_XFRMINPOLERROR, /* XfrmInPolError */ | ||
238 | LINUX_MIB_XFRMOUTERROR, /* XfrmOutError */ | ||
239 | LINUX_MIB_XFRMOUTBUNDLEGENERROR, /* XfrmOutBundleGenError */ | ||
240 | LINUX_MIB_XFRMOUTBUNDLECHECKERROR, /* XfrmOutBundleCheckError */ | ||
241 | LINUX_MIB_XFRMOUTNOSTATES, /* XfrmOutNoStates */ | ||
242 | LINUX_MIB_XFRMOUTSTATEPROTOERROR, /* XfrmOutStateProtoError */ | ||
243 | LINUX_MIB_XFRMOUTSTATEMODEERROR, /* XfrmOutStateModeError */ | ||
244 | LINUX_MIB_XFRMOUTSTATEEXPIRED, /* XfrmOutStateExpired */ | ||
245 | LINUX_MIB_XFRMOUTPOLBLOCK, /* XfrmOutPolBlock */ | ||
246 | LINUX_MIB_XFRMOUTPOLDEAD, /* XfrmOutPolDead */ | ||
247 | LINUX_MIB_XFRMOUTPOLERROR, /* XfrmOutPolError */ | ||
248 | __LINUX_MIB_XFRMMAX | ||
249 | }; | ||
250 | |||
220 | #endif /* _LINUX_SNMP_H */ | 251 | #endif /* _LINUX_SNMP_H */ |
diff --git a/include/linux/socket.h b/include/linux/socket.h index c22ef1c1afb8..bd2b30a74e76 100644 --- a/include/linux/socket.h +++ b/include/linux/socket.h | |||
@@ -24,7 +24,6 @@ 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 | extern int sysctl_somaxconn; | ||
28 | #ifdef CONFIG_PROC_FS | 27 | #ifdef CONFIG_PROC_FS |
29 | struct seq_file; | 28 | struct seq_file; |
30 | extern void socket_seq_show(struct seq_file *seq); | 29 | extern void socket_seq_show(struct seq_file *seq); |
@@ -185,6 +184,7 @@ struct ucred { | |||
185 | #define AF_PPPOX 24 /* PPPoX sockets */ | 184 | #define AF_PPPOX 24 /* PPPoX sockets */ |
186 | #define AF_WANPIPE 25 /* Wanpipe API Sockets */ | 185 | #define AF_WANPIPE 25 /* Wanpipe API Sockets */ |
187 | #define AF_LLC 26 /* Linux LLC */ | 186 | #define AF_LLC 26 /* Linux LLC */ |
187 | #define AF_CAN 29 /* Controller Area Network */ | ||
188 | #define AF_TIPC 30 /* TIPC sockets */ | 188 | #define AF_TIPC 30 /* TIPC sockets */ |
189 | #define AF_BLUETOOTH 31 /* Bluetooth sockets */ | 189 | #define AF_BLUETOOTH 31 /* Bluetooth sockets */ |
190 | #define AF_IUCV 32 /* IUCV sockets */ | 190 | #define AF_IUCV 32 /* IUCV sockets */ |
@@ -220,6 +220,7 @@ struct ucred { | |||
220 | #define PF_PPPOX AF_PPPOX | 220 | #define PF_PPPOX AF_PPPOX |
221 | #define PF_WANPIPE AF_WANPIPE | 221 | #define PF_WANPIPE AF_WANPIPE |
222 | #define PF_LLC AF_LLC | 222 | #define PF_LLC AF_LLC |
223 | #define PF_CAN AF_CAN | ||
223 | #define PF_TIPC AF_TIPC | 224 | #define PF_TIPC AF_TIPC |
224 | #define PF_BLUETOOTH AF_BLUETOOTH | 225 | #define PF_BLUETOOTH AF_BLUETOOTH |
225 | #define PF_IUCV AF_IUCV | 226 | #define PF_IUCV AF_IUCV |
diff --git a/include/linux/splice.h b/include/linux/splice.h index 33e447f98a54..528dcb93c2f2 100644 --- a/include/linux/splice.h +++ b/include/linux/splice.h | |||
@@ -53,6 +53,7 @@ struct splice_pipe_desc { | |||
53 | int nr_pages; /* number of pages in map */ | 53 | int nr_pages; /* number of pages in map */ |
54 | unsigned int flags; /* splice flags */ | 54 | unsigned int flags; /* splice flags */ |
55 | const struct pipe_buf_operations *ops;/* ops associated with output pipe */ | 55 | const struct pipe_buf_operations *ops;/* ops associated with output pipe */ |
56 | void (*spd_release)(struct splice_pipe_desc *, unsigned int); | ||
56 | }; | 57 | }; |
57 | 58 | ||
58 | typedef int (splice_actor)(struct pipe_inode_info *, struct pipe_buffer *, | 59 | typedef int (splice_actor)(struct pipe_inode_info *, struct pipe_buffer *, |
diff --git a/include/linux/ssb/ssb.h b/include/linux/ssb/ssb.h index 2b5c312c4960..e18f5c23b930 100644 --- a/include/linux/ssb/ssb.h +++ b/include/linux/ssb/ssb.h | |||
@@ -15,22 +15,19 @@ struct pcmcia_device; | |||
15 | struct ssb_bus; | 15 | struct ssb_bus; |
16 | struct ssb_driver; | 16 | struct ssb_driver; |
17 | 17 | ||
18 | 18 | struct ssb_sprom { | |
19 | struct ssb_sprom_r1 { | 19 | u8 revision; |
20 | u16 pci_spid; /* Subsystem Product ID for PCI */ | ||
21 | u16 pci_svid; /* Subsystem Vendor ID for PCI */ | ||
22 | u16 pci_pid; /* Product ID for PCI */ | ||
23 | u8 il0mac[6]; /* MAC address for 802.11b/g */ | 20 | u8 il0mac[6]; /* MAC address for 802.11b/g */ |
24 | u8 et0mac[6]; /* MAC address for Ethernet */ | 21 | u8 et0mac[6]; /* MAC address for Ethernet */ |
25 | u8 et1mac[6]; /* MAC address for 802.11a */ | 22 | u8 et1mac[6]; /* MAC address for 802.11a */ |
26 | u8 et0phyaddr:5; /* MII address for enet0 */ | 23 | u8 et0phyaddr; /* MII address for enet0 */ |
27 | u8 et1phyaddr:5; /* MII address for enet1 */ | 24 | u8 et1phyaddr; /* MII address for enet1 */ |
28 | u8 et0mdcport:1; /* MDIO for enet0 */ | 25 | u8 et0mdcport; /* MDIO for enet0 */ |
29 | u8 et1mdcport:1; /* MDIO for enet1 */ | 26 | u8 et1mdcport; /* MDIO for enet1 */ |
30 | u8 board_rev; /* Board revision */ | 27 | u8 board_rev; /* Board revision number from SPROM. */ |
31 | u8 country_code:4; /* Country Code */ | 28 | u8 country_code; /* Country Code */ |
32 | u8 antenna_a:2; /* Antenna 0/1 available for A-PHY */ | 29 | u8 ant_available_a; /* A-PHY antenna available bits (up to 4) */ |
33 | u8 antenna_bg:2; /* Antenna 0/1 available for B-PHY and G-PHY */ | 30 | u8 ant_available_bg; /* B/G-PHY antenna available bits (up to 4) */ |
34 | u16 pa0b0; | 31 | u16 pa0b0; |
35 | u16 pa0b1; | 32 | u16 pa0b1; |
36 | u16 pa0b2; | 33 | u16 pa0b2; |
@@ -41,61 +38,26 @@ struct ssb_sprom_r1 { | |||
41 | u8 gpio1; /* GPIO pin 1 */ | 38 | u8 gpio1; /* GPIO pin 1 */ |
42 | u8 gpio2; /* GPIO pin 2 */ | 39 | u8 gpio2; /* GPIO pin 2 */ |
43 | u8 gpio3; /* GPIO pin 3 */ | 40 | u8 gpio3; /* GPIO pin 3 */ |
44 | u16 maxpwr_a; /* A-PHY Power Amplifier Max Power (in dBm Q5.2) */ | 41 | u16 maxpwr_a; /* A-PHY Amplifier Max Power (in dBm Q5.2) */ |
45 | u16 maxpwr_bg; /* B/G-PHY Power Amplifier Max Power (in dBm Q5.2) */ | 42 | u16 maxpwr_bg; /* B/G-PHY Amplifier Max Power (in dBm Q5.2) */ |
46 | u8 itssi_a; /* Idle TSSI Target for A-PHY */ | 43 | u8 itssi_a; /* Idle TSSI Target for A-PHY */ |
47 | u8 itssi_bg; /* Idle TSSI Target for B/G-PHY */ | 44 | u8 itssi_bg; /* Idle TSSI Target for B/G-PHY */ |
48 | u16 boardflags_lo; /* Boardflags (low 16 bits) */ | 45 | u16 boardflags_lo; /* Boardflags (low 16 bits) */ |
49 | u8 antenna_gain_a; /* A-PHY Antenna gain (in dBm Q5.2) */ | ||
50 | u8 antenna_gain_bg; /* B/G-PHY Antenna gain (in dBm Q5.2) */ | ||
51 | u8 oem[8]; /* OEM string (rev 1 only) */ | ||
52 | }; | ||
53 | |||
54 | struct ssb_sprom_r2 { | ||
55 | u16 boardflags_hi; /* Boardflags (high 16 bits) */ | 46 | u16 boardflags_hi; /* Boardflags (high 16 bits) */ |
56 | u8 maxpwr_a_lo; /* A-PHY Max Power Low */ | ||
57 | u8 maxpwr_a_hi; /* A-PHY Max Power High */ | ||
58 | u16 pa1lob0; /* A-PHY PA Low Settings */ | ||
59 | u16 pa1lob1; /* A-PHY PA Low Settings */ | ||
60 | u16 pa1lob2; /* A-PHY PA Low Settings */ | ||
61 | u16 pa1hib0; /* A-PHY PA High Settings */ | ||
62 | u16 pa1hib1; /* A-PHY PA High Settings */ | ||
63 | u16 pa1hib2; /* A-PHY PA High Settings */ | ||
64 | u8 ofdm_pwr_off; /* OFDM Power Offset from CCK Level */ | ||
65 | u8 country_str[2]; /* Two char Country Code */ | ||
66 | }; | ||
67 | |||
68 | struct ssb_sprom_r3 { | ||
69 | u32 ofdmapo; /* A-PHY OFDM Mid Power Offset */ | ||
70 | u32 ofdmalpo; /* A-PHY OFDM Low Power Offset */ | ||
71 | u32 ofdmahpo; /* A-PHY OFDM High Power Offset */ | ||
72 | u8 gpioldc_on_cnt; /* GPIO LED Powersave Duty Cycle ON count */ | ||
73 | u8 gpioldc_off_cnt; /* GPIO LED Powersave Duty Cycle OFF count */ | ||
74 | u8 cckpo_1M:4; /* CCK Power Offset for Rate 1M */ | ||
75 | u8 cckpo_2M:4; /* CCK Power Offset for Rate 2M */ | ||
76 | u8 cckpo_55M:4; /* CCK Power Offset for Rate 5.5M */ | ||
77 | u8 cckpo_11M:4; /* CCK Power Offset for Rate 11M */ | ||
78 | u32 ofdmgpo; /* G-PHY OFDM Power Offset */ | ||
79 | }; | ||
80 | |||
81 | struct ssb_sprom_r4 { | ||
82 | /* TODO */ | ||
83 | }; | ||
84 | 47 | ||
85 | struct ssb_sprom { | 48 | /* Antenna gain values for up to 4 antennas |
86 | u8 revision; | 49 | * on each band. Values in dBm/4 (Q5.2). Negative gain means the |
87 | u8 crc; | 50 | * loss in the connectors is bigger than the gain. */ |
88 | /* The valid r# fields are selected by the "revision". | 51 | struct { |
89 | * Revision 3 and lower inherit from lower revisions. | ||
90 | */ | ||
91 | union { | ||
92 | struct { | 52 | struct { |
93 | struct ssb_sprom_r1 r1; | 53 | s8 a0, a1, a2, a3; |
94 | struct ssb_sprom_r2 r2; | 54 | } ghz24; /* 2.4GHz band */ |
95 | struct ssb_sprom_r3 r3; | 55 | struct { |
96 | }; | 56 | s8 a0, a1, a2, a3; |
97 | struct ssb_sprom_r4 r4; | 57 | } ghz5; /* 5GHz band */ |
98 | }; | 58 | } antenna_gain; |
59 | |||
60 | /* TODO - add any parameters needed from rev 2, 3, or 4 SPROMs */ | ||
99 | }; | 61 | }; |
100 | 62 | ||
101 | /* Information about the PCB the circuitry is soldered on. */ | 63 | /* Information about the PCB the circuitry is soldered on. */ |
@@ -270,7 +232,8 @@ struct ssb_bus { | |||
270 | struct ssb_device *mapped_device; | 232 | struct ssb_device *mapped_device; |
271 | /* Currently mapped PCMCIA segment. (bustype == SSB_BUSTYPE_PCMCIA only) */ | 233 | /* Currently mapped PCMCIA segment. (bustype == SSB_BUSTYPE_PCMCIA only) */ |
272 | u8 mapped_pcmcia_seg; | 234 | u8 mapped_pcmcia_seg; |
273 | /* Lock for core and segment switching. */ | 235 | /* Lock for core and segment switching. |
236 | * On PCMCIA-host busses this is used to protect the whole MMIO access. */ | ||
274 | spinlock_t bar_lock; | 237 | spinlock_t bar_lock; |
275 | 238 | ||
276 | /* The bus this backplane is running on. */ | 239 | /* The bus this backplane is running on. */ |
@@ -288,6 +251,7 @@ struct ssb_bus { | |||
288 | /* ID information about the Chip. */ | 251 | /* ID information about the Chip. */ |
289 | u16 chip_id; | 252 | u16 chip_id; |
290 | u16 chip_rev; | 253 | u16 chip_rev; |
254 | u16 sprom_size; /* number of words in sprom */ | ||
291 | u8 chip_package; | 255 | u8 chip_package; |
292 | 256 | ||
293 | /* List of devices (cores) on the backplane. */ | 257 | /* List of devices (cores) on the backplane. */ |
@@ -402,6 +366,13 @@ static inline void ssb_pcihost_unregister(struct pci_driver *driver) | |||
402 | { | 366 | { |
403 | pci_unregister_driver(driver); | 367 | pci_unregister_driver(driver); |
404 | } | 368 | } |
369 | |||
370 | static inline | ||
371 | void ssb_pcihost_set_power_state(struct ssb_device *sdev, pci_power_t state) | ||
372 | { | ||
373 | if (sdev->bus->bustype == SSB_BUSTYPE_PCI) | ||
374 | pci_set_power_state(sdev->bus->host_pci, state); | ||
375 | } | ||
405 | #endif /* CONFIG_SSB_PCIHOST */ | 376 | #endif /* CONFIG_SSB_PCIHOST */ |
406 | 377 | ||
407 | 378 | ||
diff --git a/include/linux/ssb/ssb_regs.h b/include/linux/ssb/ssb_regs.h index 47c7c71a5acf..ebad0bac9801 100644 --- a/include/linux/ssb/ssb_regs.h +++ b/include/linux/ssb/ssb_regs.h | |||
@@ -147,6 +147,10 @@ | |||
147 | #define SSB_IDLOW_SSBREV 0xF0000000 /* Sonics Backplane Revision code */ | 147 | #define SSB_IDLOW_SSBREV 0xF0000000 /* Sonics Backplane Revision code */ |
148 | #define SSB_IDLOW_SSBREV_22 0x00000000 /* <= 2.2 */ | 148 | #define SSB_IDLOW_SSBREV_22 0x00000000 /* <= 2.2 */ |
149 | #define SSB_IDLOW_SSBREV_23 0x10000000 /* 2.3 */ | 149 | #define SSB_IDLOW_SSBREV_23 0x10000000 /* 2.3 */ |
150 | #define SSB_IDLOW_SSBREV_24 0x40000000 /* ?? Found in BCM4328 */ | ||
151 | #define SSB_IDLOW_SSBREV_25 0x50000000 /* ?? Not Found yet */ | ||
152 | #define SSB_IDLOW_SSBREV_26 0x60000000 /* ?? Found in some BCM4311/2 */ | ||
153 | #define SSB_IDLOW_SSBREV_27 0x70000000 /* ?? Found in some BCM4311/2 */ | ||
150 | #define SSB_IDHIGH 0x0FFC /* SB Identification High */ | 154 | #define SSB_IDHIGH 0x0FFC /* SB Identification High */ |
151 | #define SSB_IDHIGH_RCLO 0x0000000F /* Revision Code (low part) */ | 155 | #define SSB_IDHIGH_RCLO 0x0000000F /* Revision Code (low part) */ |
152 | #define SSB_IDHIGH_CC 0x00008FF0 /* Core Code */ | 156 | #define SSB_IDHIGH_CC 0x00008FF0 /* Core Code */ |
@@ -162,11 +166,16 @@ | |||
162 | */ | 166 | */ |
163 | #define SSB_SPROMSIZE_WORDS 64 | 167 | #define SSB_SPROMSIZE_WORDS 64 |
164 | #define SSB_SPROMSIZE_BYTES (SSB_SPROMSIZE_WORDS * sizeof(u16)) | 168 | #define SSB_SPROMSIZE_BYTES (SSB_SPROMSIZE_WORDS * sizeof(u16)) |
169 | #define SSB_SPROMSIZE_WORDS_R123 64 | ||
170 | #define SSB_SPROMSIZE_WORDS_R4 220 | ||
171 | #define SSB_SPROMSIZE_BYTES_R123 (SSB_SPROMSIZE_WORDS_R123 * sizeof(u16)) | ||
172 | #define SSB_SPROMSIZE_BYTES_R4 (SSB_SPROMSIZE_WORDS_R4 * sizeof(u16)) | ||
165 | #define SSB_SPROM_BASE 0x1000 | 173 | #define SSB_SPROM_BASE 0x1000 |
166 | #define SSB_SPROM_REVISION 0x107E | 174 | #define SSB_SPROM_REVISION 0x107E |
167 | #define SSB_SPROM_REVISION_REV 0x00FF /* SPROM Revision number */ | 175 | #define SSB_SPROM_REVISION_REV 0x00FF /* SPROM Revision number */ |
168 | #define SSB_SPROM_REVISION_CRC 0xFF00 /* SPROM CRC8 value */ | 176 | #define SSB_SPROM_REVISION_CRC 0xFF00 /* SPROM CRC8 value */ |
169 | #define SSB_SPROM_REVISION_CRC_SHIFT 8 | 177 | #define SSB_SPROM_REVISION_CRC_SHIFT 8 |
178 | |||
170 | /* SPROM Revision 1 */ | 179 | /* SPROM Revision 1 */ |
171 | #define SSB_SPROM1_SPID 0x1004 /* Subsystem Product ID for PCI */ | 180 | #define SSB_SPROM1_SPID 0x1004 /* Subsystem Product ID for PCI */ |
172 | #define SSB_SPROM1_SVID 0x1006 /* Subsystem Vendor ID for PCI */ | 181 | #define SSB_SPROM1_SVID 0x1006 /* Subsystem Vendor ID for PCI */ |
@@ -184,10 +193,10 @@ | |||
184 | #define SSB_SPROM1_BINF_BREV 0x00FF /* Board Revision */ | 193 | #define SSB_SPROM1_BINF_BREV 0x00FF /* Board Revision */ |
185 | #define SSB_SPROM1_BINF_CCODE 0x0F00 /* Country Code */ | 194 | #define SSB_SPROM1_BINF_CCODE 0x0F00 /* Country Code */ |
186 | #define SSB_SPROM1_BINF_CCODE_SHIFT 8 | 195 | #define SSB_SPROM1_BINF_CCODE_SHIFT 8 |
187 | #define SSB_SPROM1_BINF_ANTA 0x3000 /* Available A-PHY antennas */ | 196 | #define SSB_SPROM1_BINF_ANTBG 0x3000 /* Available B-PHY and G-PHY antennas */ |
188 | #define SSB_SPROM1_BINF_ANTA_SHIFT 12 | 197 | #define SSB_SPROM1_BINF_ANTBG_SHIFT 12 |
189 | #define SSB_SPROM1_BINF_ANTBG 0xC000 /* Available B-PHY antennas */ | 198 | #define SSB_SPROM1_BINF_ANTA 0xC000 /* Available A-PHY antennas */ |
190 | #define SSB_SPROM1_BINF_ANTBG_SHIFT 14 | 199 | #define SSB_SPROM1_BINF_ANTA_SHIFT 14 |
191 | #define SSB_SPROM1_PA0B0 0x105E | 200 | #define SSB_SPROM1_PA0B0 0x105E |
192 | #define SSB_SPROM1_PA0B1 0x1060 | 201 | #define SSB_SPROM1_PA0B1 0x1060 |
193 | #define SSB_SPROM1_PA0B2 0x1062 | 202 | #define SSB_SPROM1_PA0B2 0x1062 |
@@ -212,10 +221,11 @@ | |||
212 | #define SSB_SPROM1_ITSSI_A_SHIFT 8 | 221 | #define SSB_SPROM1_ITSSI_A_SHIFT 8 |
213 | #define SSB_SPROM1_BFLLO 0x1072 /* Boardflags (low 16 bits) */ | 222 | #define SSB_SPROM1_BFLLO 0x1072 /* Boardflags (low 16 bits) */ |
214 | #define SSB_SPROM1_AGAIN 0x1074 /* Antenna Gain (in dBm Q5.2) */ | 223 | #define SSB_SPROM1_AGAIN 0x1074 /* Antenna Gain (in dBm Q5.2) */ |
215 | #define SSB_SPROM1_AGAIN_A 0x00FF /* A-PHY */ | 224 | #define SSB_SPROM1_AGAIN_BG 0x00FF /* B-PHY and G-PHY */ |
216 | #define SSB_SPROM1_AGAIN_BG 0xFF00 /* B-PHY and G-PHY */ | 225 | #define SSB_SPROM1_AGAIN_BG_SHIFT 0 |
217 | #define SSB_SPROM1_AGAIN_BG_SHIFT 8 | 226 | #define SSB_SPROM1_AGAIN_A 0xFF00 /* A-PHY */ |
218 | #define SSB_SPROM1_OEM 0x1076 /* 8 bytes OEM string (rev 1 only) */ | 227 | #define SSB_SPROM1_AGAIN_A_SHIFT 8 |
228 | |||
219 | /* SPROM Revision 2 (inherits from rev 1) */ | 229 | /* SPROM Revision 2 (inherits from rev 1) */ |
220 | #define SSB_SPROM2_BFLHI 0x1038 /* Boardflags (high 16 bits) */ | 230 | #define SSB_SPROM2_BFLHI 0x1038 /* Boardflags (high 16 bits) */ |
221 | #define SSB_SPROM2_MAXP_A 0x103A /* A-PHY Max Power */ | 231 | #define SSB_SPROM2_MAXP_A 0x103A /* A-PHY Max Power */ |
@@ -232,7 +242,11 @@ | |||
232 | #define SSB_SPROM2_OPO_VALUE 0x00FF | 242 | #define SSB_SPROM2_OPO_VALUE 0x00FF |
233 | #define SSB_SPROM2_OPO_UNUSED 0xFF00 | 243 | #define SSB_SPROM2_OPO_UNUSED 0xFF00 |
234 | #define SSB_SPROM2_CCODE 0x107C /* Two char Country Code */ | 244 | #define SSB_SPROM2_CCODE 0x107C /* Two char Country Code */ |
235 | /* SPROM Revision 3 (inherits from rev 2) */ | 245 | |
246 | /* SPROM Revision 3 (inherits most data from rev 2) */ | ||
247 | #define SSB_SPROM3_IL0MAC 0x104A /* 6 bytes MAC address for 802.11b/g */ | ||
248 | #define SSB_SPROM3_ET0MAC 0x1050 /* 6 bytes MAC address for Ethernet ?? */ | ||
249 | #define SSB_SPROM3_ET1MAC 0x1050 /* 6 bytes MAC address for 802.11a ?? */ | ||
236 | #define SSB_SPROM3_OFDMAPO 0x102C /* A-PHY OFDM Mid Power Offset (4 bytes, BigEndian) */ | 250 | #define SSB_SPROM3_OFDMAPO 0x102C /* A-PHY OFDM Mid Power Offset (4 bytes, BigEndian) */ |
237 | #define SSB_SPROM3_OFDMALPO 0x1030 /* A-PHY OFDM Low Power Offset (4 bytes, BigEndian) */ | 251 | #define SSB_SPROM3_OFDMALPO 0x1030 /* A-PHY OFDM Low Power Offset (4 bytes, BigEndian) */ |
238 | #define SSB_SPROM3_OFDMAHPO 0x1034 /* A-PHY OFDM High Power Offset (4 bytes, BigEndian) */ | 252 | #define SSB_SPROM3_OFDMAHPO 0x1034 /* A-PHY OFDM High Power Offset (4 bytes, BigEndian) */ |
@@ -251,6 +265,57 @@ | |||
251 | #define SSB_SPROM3_CCKPO_11M_SHIFT 12 | 265 | #define SSB_SPROM3_CCKPO_11M_SHIFT 12 |
252 | #define SSB_SPROM3_OFDMGPO 0x107A /* G-PHY OFDM Power Offset (4 bytes, BigEndian) */ | 266 | #define SSB_SPROM3_OFDMGPO 0x107A /* G-PHY OFDM Power Offset (4 bytes, BigEndian) */ |
253 | 267 | ||
268 | /* SPROM Revision 4 */ | ||
269 | #define SSB_SPROM4_IL0MAC 0x104C /* 6 byte MAC address for a/b/g/n */ | ||
270 | #define SSB_SPROM4_ET0MAC 0x1018 /* 6 bytes MAC address for Ethernet ?? */ | ||
271 | #define SSB_SPROM4_ET1MAC 0x1018 /* 6 bytes MAC address for 802.11a ?? */ | ||
272 | #define SSB_SPROM4_ETHPHY 0x105A /* Ethernet PHY settings ?? */ | ||
273 | #define SSB_SPROM4_ETHPHY_ET0A 0x001F /* MII Address for enet0 */ | ||
274 | #define SSB_SPROM4_ETHPHY_ET1A 0x03E0 /* MII Address for enet1 */ | ||
275 | #define SSB_SPROM4_ETHPHY_ET1A_SHIFT 5 | ||
276 | #define SSB_SPROM4_ETHPHY_ET0M (1<<14) /* MDIO for enet0 */ | ||
277 | #define SSB_SPROM4_ETHPHY_ET1M (1<<15) /* MDIO for enet1 */ | ||
278 | #define SSB_SPROM4_CCODE 0x1052 /* Country Code (2 bytes) */ | ||
279 | #define SSB_SPROM4_ANTAVAIL 0x105D /* Antenna available bitfields */ | ||
280 | #define SSB_SPROM4_ANTAVAIL_A 0x00FF /* A-PHY bitfield */ | ||
281 | #define SSB_SPROM4_ANTAVAIL_A_SHIFT 0 | ||
282 | #define SSB_SPROM4_ANTAVAIL_BG 0xFF00 /* B-PHY and G-PHY bitfield */ | ||
283 | #define SSB_SPROM4_ANTAVAIL_BG_SHIFT 8 | ||
284 | #define SSB_SPROM4_BFLLO 0x1044 /* Boardflags (low 16 bits) */ | ||
285 | #define SSB_SPROM4_AGAIN01 0x105E /* Antenna Gain (in dBm Q5.2) */ | ||
286 | #define SSB_SPROM4_AGAIN0 0x00FF /* Antenna 0 */ | ||
287 | #define SSB_SPROM4_AGAIN0_SHIFT 0 | ||
288 | #define SSB_SPROM4_AGAIN1 0xFF00 /* Antenna 1 */ | ||
289 | #define SSB_SPROM4_AGAIN1_SHIFT 8 | ||
290 | #define SSB_SPROM4_AGAIN23 0x1060 | ||
291 | #define SSB_SPROM4_AGAIN2 0x00FF /* Antenna 2 */ | ||
292 | #define SSB_SPROM4_AGAIN2_SHIFT 0 | ||
293 | #define SSB_SPROM4_AGAIN3 0xFF00 /* Antenna 3 */ | ||
294 | #define SSB_SPROM4_AGAIN3_SHIFT 8 | ||
295 | #define SSB_SPROM4_BFLHI 0x1046 /* Board Flags Hi */ | ||
296 | #define SSB_SPROM4_MAXP_BG 0x1080 /* Max Power BG in path 1 */ | ||
297 | #define SSB_SPROM4_MAXP_BG_MASK 0x00FF /* Mask for Max Power BG */ | ||
298 | #define SSB_SPROM4_ITSSI_BG 0xFF00 /* Mask for path 1 itssi_bg */ | ||
299 | #define SSB_SPROM4_ITSSI_BG_SHIFT 8 | ||
300 | #define SSB_SPROM4_MAXP_A 0x108A /* Max Power A in path 1 */ | ||
301 | #define SSB_SPROM4_MAXP_A_MASK 0x00FF /* Mask for Max Power A */ | ||
302 | #define SSB_SPROM4_ITSSI_A 0xFF00 /* Mask for path 1 itssi_a */ | ||
303 | #define SSB_SPROM4_ITSSI_A_SHIFT 8 | ||
304 | #define SSB_SPROM4_GPIOA 0x1056 /* Gen. Purpose IO # 0 and 1 */ | ||
305 | #define SSB_SPROM4_GPIOA_P0 0x00FF /* Pin 0 */ | ||
306 | #define SSB_SPROM4_GPIOA_P1 0xFF00 /* Pin 1 */ | ||
307 | #define SSB_SPROM4_GPIOA_P1_SHIFT 8 | ||
308 | #define SSB_SPROM4_GPIOB 0x1058 /* Gen. Purpose IO # 2 and 3 */ | ||
309 | #define SSB_SPROM4_GPIOB_P2 0x00FF /* Pin 2 */ | ||
310 | #define SSB_SPROM4_GPIOB_P3 0xFF00 /* Pin 3 */ | ||
311 | #define SSB_SPROM4_GPIOB_P3_SHIFT 8 | ||
312 | #define SSB_SPROM4_PA0B0 0x1082 /* The paXbY locations are */ | ||
313 | #define SSB_SPROM4_PA0B1 0x1084 /* only guesses */ | ||
314 | #define SSB_SPROM4_PA0B2 0x1086 | ||
315 | #define SSB_SPROM4_PA1B0 0x108E | ||
316 | #define SSB_SPROM4_PA1B1 0x1090 | ||
317 | #define SSB_SPROM4_PA1B2 0x1092 | ||
318 | |||
254 | /* Values for SSB_SPROM1_BINF_CCODE */ | 319 | /* Values for SSB_SPROM1_BINF_CCODE */ |
255 | enum { | 320 | enum { |
256 | SSB_SPROM1CCODE_WORLD = 0, | 321 | SSB_SPROM1CCODE_WORLD = 0, |
diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h index 4f5047df8a9e..89faebfe48b8 100644 --- a/include/linux/sysctl.h +++ b/include/linux/sysctl.h | |||
@@ -945,7 +945,10 @@ enum | |||
945 | 945 | ||
946 | /* For the /proc/sys support */ | 946 | /* For the /proc/sys support */ |
947 | struct ctl_table; | 947 | struct ctl_table; |
948 | struct nsproxy; | ||
948 | extern struct ctl_table_header *sysctl_head_next(struct ctl_table_header *prev); | 949 | extern struct ctl_table_header *sysctl_head_next(struct ctl_table_header *prev); |
950 | extern struct ctl_table_header *__sysctl_head_next(struct nsproxy *namespaces, | ||
951 | struct ctl_table_header *prev); | ||
949 | extern void sysctl_head_finish(struct ctl_table_header *prev); | 952 | extern void sysctl_head_finish(struct ctl_table_header *prev); |
950 | extern int sysctl_perm(struct ctl_table *table, int op); | 953 | extern int sysctl_perm(struct ctl_table *table, int op); |
951 | 954 | ||
@@ -1049,6 +1052,13 @@ struct ctl_table | |||
1049 | void *extra2; | 1052 | void *extra2; |
1050 | }; | 1053 | }; |
1051 | 1054 | ||
1055 | struct ctl_table_root { | ||
1056 | struct list_head root_list; | ||
1057 | struct list_head header_list; | ||
1058 | struct list_head *(*lookup)(struct ctl_table_root *root, | ||
1059 | struct nsproxy *namespaces); | ||
1060 | }; | ||
1061 | |||
1052 | /* struct ctl_table_header is used to maintain dynamic lists of | 1062 | /* struct ctl_table_header is used to maintain dynamic lists of |
1053 | struct ctl_table trees. */ | 1063 | struct ctl_table trees. */ |
1054 | struct ctl_table_header | 1064 | struct ctl_table_header |
@@ -1057,12 +1067,26 @@ struct ctl_table_header | |||
1057 | struct list_head ctl_entry; | 1067 | struct list_head ctl_entry; |
1058 | int used; | 1068 | int used; |
1059 | struct completion *unregistering; | 1069 | struct completion *unregistering; |
1070 | struct ctl_table *ctl_table_arg; | ||
1071 | struct ctl_table_root *root; | ||
1072 | }; | ||
1073 | |||
1074 | /* struct ctl_path describes where in the hierarchy a table is added */ | ||
1075 | struct ctl_path { | ||
1076 | const char *procname; | ||
1077 | int ctl_name; | ||
1060 | }; | 1078 | }; |
1061 | 1079 | ||
1080 | void register_sysctl_root(struct ctl_table_root *root); | ||
1081 | struct ctl_table_header *__register_sysctl_paths( | ||
1082 | struct ctl_table_root *root, struct nsproxy *namespaces, | ||
1083 | const struct ctl_path *path, struct ctl_table *table); | ||
1062 | struct ctl_table_header *register_sysctl_table(struct ctl_table * table); | 1084 | struct ctl_table_header *register_sysctl_table(struct ctl_table * table); |
1085 | struct ctl_table_header *register_sysctl_paths(const struct ctl_path *path, | ||
1086 | struct ctl_table *table); | ||
1063 | 1087 | ||
1064 | void unregister_sysctl_table(struct ctl_table_header * table); | 1088 | void unregister_sysctl_table(struct ctl_table_header * table); |
1065 | int sysctl_check_table(struct ctl_table *table); | 1089 | int sysctl_check_table(struct nsproxy *namespaces, struct ctl_table *table); |
1066 | 1090 | ||
1067 | #else /* __KERNEL__ */ | 1091 | #else /* __KERNEL__ */ |
1068 | 1092 | ||
diff --git a/include/linux/tcp.h b/include/linux/tcp.h index bac17c59b24e..08027f1d7f31 100644 --- a/include/linux/tcp.h +++ b/include/linux/tcp.h | |||
@@ -330,10 +330,12 @@ struct tcp_sock { | |||
330 | struct tcp_sack_block duplicate_sack[1]; /* D-SACK block */ | 330 | struct tcp_sack_block duplicate_sack[1]; /* D-SACK block */ |
331 | struct tcp_sack_block selective_acks[4]; /* The SACKS themselves*/ | 331 | struct tcp_sack_block selective_acks[4]; /* The SACKS themselves*/ |
332 | 332 | ||
333 | struct tcp_sack_block_wire recv_sack_cache[4]; | 333 | struct tcp_sack_block recv_sack_cache[4]; |
334 | 334 | ||
335 | u32 highest_sack; /* Start seq of globally highest revd SACK | 335 | struct sk_buff *highest_sack; /* highest skb with SACK received |
336 | * (validity guaranteed only if sacked_out > 0) */ | 336 | * (validity guaranteed only if |
337 | * sacked_out > 0) | ||
338 | */ | ||
337 | 339 | ||
338 | /* from STCP, retrans queue hinting */ | 340 | /* from STCP, retrans queue hinting */ |
339 | struct sk_buff* lost_skb_hint; | 341 | struct sk_buff* lost_skb_hint; |
@@ -341,10 +343,7 @@ struct tcp_sock { | |||
341 | struct sk_buff *scoreboard_skb_hint; | 343 | struct sk_buff *scoreboard_skb_hint; |
342 | struct sk_buff *retransmit_skb_hint; | 344 | struct sk_buff *retransmit_skb_hint; |
343 | struct sk_buff *forward_skb_hint; | 345 | struct sk_buff *forward_skb_hint; |
344 | struct sk_buff *fastpath_skb_hint; | ||
345 | 346 | ||
346 | int fastpath_cnt_hint; /* Lags behind by current skb's pcount | ||
347 | * compared to respective fackets_out */ | ||
348 | int lost_cnt_hint; | 347 | int lost_cnt_hint; |
349 | int retransmit_cnt_hint; | 348 | int retransmit_cnt_hint; |
350 | 349 | ||
diff --git a/include/linux/tty.h b/include/linux/tty.h index defd2ab72449..402de892b3ed 100644 --- a/include/linux/tty.h +++ b/include/linux/tty.h | |||
@@ -23,7 +23,7 @@ | |||
23 | */ | 23 | */ |
24 | #define NR_UNIX98_PTY_DEFAULT 4096 /* Default maximum for Unix98 ptys */ | 24 | #define NR_UNIX98_PTY_DEFAULT 4096 /* Default maximum for Unix98 ptys */ |
25 | #define NR_UNIX98_PTY_MAX (1 << MINORBITS) /* Absolute limit */ | 25 | #define NR_UNIX98_PTY_MAX (1 << MINORBITS) /* Absolute limit */ |
26 | #define NR_LDISCS 17 | 26 | #define NR_LDISCS 18 |
27 | 27 | ||
28 | /* line disciplines */ | 28 | /* line disciplines */ |
29 | #define N_TTY 0 | 29 | #define N_TTY 0 |
@@ -44,6 +44,7 @@ | |||
44 | #define N_SYNC_PPP 14 /* synchronous PPP */ | 44 | #define N_SYNC_PPP 14 /* synchronous PPP */ |
45 | #define N_HCI 15 /* Bluetooth HCI UART */ | 45 | #define N_HCI 15 /* Bluetooth HCI UART */ |
46 | #define N_GIGASET_M101 16 /* Siemens Gigaset M101 serial DECT adapter */ | 46 | #define N_GIGASET_M101 16 /* Siemens Gigaset M101 serial DECT adapter */ |
47 | #define N_SLCAN 17 /* Serial / USB serial CAN Adaptors */ | ||
47 | 48 | ||
48 | /* | 49 | /* |
49 | * This character is the same as _POSIX_VDISABLE: it cannot be used as | 50 | * This character is the same as _POSIX_VDISABLE: it cannot be used as |
diff --git a/include/linux/wireless.h b/include/linux/wireless.h index 0987aa7a6cf5..74e84caa1e20 100644 --- a/include/linux/wireless.h +++ b/include/linux/wireless.h | |||
@@ -541,6 +541,16 @@ | |||
541 | /* Maximum size of returned data */ | 541 | /* Maximum size of returned data */ |
542 | #define IW_SCAN_MAX_DATA 4096 /* In bytes */ | 542 | #define IW_SCAN_MAX_DATA 4096 /* In bytes */ |
543 | 543 | ||
544 | /* Scan capability flags - in (struct iw_range *)->scan_capa */ | ||
545 | #define IW_SCAN_CAPA_NONE 0x00 | ||
546 | #define IW_SCAN_CAPA_ESSID 0x01 | ||
547 | #define IW_SCAN_CAPA_BSSID 0x02 | ||
548 | #define IW_SCAN_CAPA_CHANNEL 0x04 | ||
549 | #define IW_SCAN_CAPA_MODE 0x08 | ||
550 | #define IW_SCAN_CAPA_RATE 0x10 | ||
551 | #define IW_SCAN_CAPA_TYPE 0x20 | ||
552 | #define IW_SCAN_CAPA_TIME 0x40 | ||
553 | |||
544 | /* Max number of char in custom event - use multiple of them if needed */ | 554 | /* Max number of char in custom event - use multiple of them if needed */ |
545 | #define IW_CUSTOM_MAX 256 /* In bytes */ | 555 | #define IW_CUSTOM_MAX 256 /* In bytes */ |
546 | 556 | ||
@@ -963,6 +973,9 @@ struct iw_range | |||
963 | __u16 old_num_channels; | 973 | __u16 old_num_channels; |
964 | __u8 old_num_frequency; | 974 | __u8 old_num_frequency; |
965 | 975 | ||
976 | /* Scan capabilities */ | ||
977 | __u8 scan_capa; /* IW_SCAN_CAPA_* bit field */ | ||
978 | |||
966 | /* Wireless event capability bitmasks */ | 979 | /* Wireless event capability bitmasks */ |
967 | __u32 event_capa[6]; | 980 | __u32 event_capa[6]; |
968 | 981 | ||
diff --git a/include/linux/xfrm.h b/include/linux/xfrm.h index b58adc52448d..9b5b00c4ef9d 100644 --- a/include/linux/xfrm.h +++ b/include/linux/xfrm.h | |||
@@ -91,9 +91,9 @@ struct xfrm_replay_state | |||
91 | }; | 91 | }; |
92 | 92 | ||
93 | struct xfrm_algo { | 93 | struct xfrm_algo { |
94 | char alg_name[64]; | 94 | char alg_name[64]; |
95 | int alg_key_len; /* in bits */ | 95 | unsigned int alg_key_len; /* in bits */ |
96 | char alg_key[0]; | 96 | char alg_key[0]; |
97 | }; | 97 | }; |
98 | 98 | ||
99 | struct xfrm_stats { | 99 | struct xfrm_stats { |
@@ -114,6 +114,7 @@ enum | |||
114 | XFRM_POLICY_IN = 0, | 114 | XFRM_POLICY_IN = 0, |
115 | XFRM_POLICY_OUT = 1, | 115 | XFRM_POLICY_OUT = 1, |
116 | XFRM_POLICY_FWD = 2, | 116 | XFRM_POLICY_FWD = 2, |
117 | XFRM_POLICY_MASK = 3, | ||
117 | XFRM_POLICY_MAX = 3 | 118 | XFRM_POLICY_MAX = 3 |
118 | }; | 119 | }; |
119 | 120 | ||
@@ -328,6 +329,7 @@ struct xfrm_usersa_info { | |||
328 | #define XFRM_STATE_DECAP_DSCP 2 | 329 | #define XFRM_STATE_DECAP_DSCP 2 |
329 | #define XFRM_STATE_NOPMTUDISC 4 | 330 | #define XFRM_STATE_NOPMTUDISC 4 |
330 | #define XFRM_STATE_WILDRECV 8 | 331 | #define XFRM_STATE_WILDRECV 8 |
332 | #define XFRM_STATE_ICMP 16 | ||
331 | }; | 333 | }; |
332 | 334 | ||
333 | struct xfrm_usersa_id { | 335 | struct xfrm_usersa_id { |
@@ -362,6 +364,8 @@ struct xfrm_userpolicy_info { | |||
362 | #define XFRM_POLICY_BLOCK 1 | 364 | #define XFRM_POLICY_BLOCK 1 |
363 | __u8 flags; | 365 | __u8 flags; |
364 | #define XFRM_POLICY_LOCALOK 1 /* Allow user to override global policy */ | 366 | #define XFRM_POLICY_LOCALOK 1 /* Allow user to override global policy */ |
367 | /* Automatically expand selector to include matching ICMP payloads. */ | ||
368 | #define XFRM_POLICY_ICMP 2 | ||
365 | __u8 share; | 369 | __u8 share; |
366 | }; | 370 | }; |
367 | 371 | ||