diff options
| author | Patrick McHardy <kaber@trash.net> | 2011-01-14 08:12:37 -0500 |
|---|---|---|
| committer | Patrick McHardy <kaber@trash.net> | 2011-01-14 08:12:37 -0500 |
| commit | 0134e89c7bcc9fde1da962c82a120691e185619f (patch) | |
| tree | 3e03335cf001019a2687d161e956de4f73379984 /include/net | |
| parent | c7066f70d9610df0b9406cc635fc09e86136e714 (diff) | |
| parent | 6faee60a4e82075853a437831768cc9e2e563e4e (diff) | |
Merge branch 'master' of git://1984.lsi.us.es/net-next-2.6
Conflicts:
net/ipv4/route.c
Signed-off-by: Patrick McHardy <kaber@trash.net>
Diffstat (limited to 'include/net')
55 files changed, 1161 insertions, 939 deletions
diff --git a/include/net/addrconf.h b/include/net/addrconf.h index a9441249306c..23710aa6a181 100644 --- a/include/net/addrconf.h +++ b/include/net/addrconf.h | |||
| @@ -1,8 +1,6 @@ | |||
| 1 | #ifndef _ADDRCONF_H | 1 | #ifndef _ADDRCONF_H |
| 2 | #define _ADDRCONF_H | 2 | #define _ADDRCONF_H |
| 3 | 3 | ||
| 4 | #define RETRANS_TIMER HZ | ||
| 5 | |||
| 6 | #define MAX_RTR_SOLICITATIONS 3 | 4 | #define MAX_RTR_SOLICITATIONS 3 |
| 7 | #define RTR_SOLICITATION_INTERVAL (4*HZ) | 5 | #define RTR_SOLICITATION_INTERVAL (4*HZ) |
| 8 | 6 | ||
diff --git a/include/net/af_unix.h b/include/net/af_unix.h index 90c9e2872f27..18e5c3f67580 100644 --- a/include/net/af_unix.h +++ b/include/net/af_unix.h | |||
| @@ -10,6 +10,7 @@ extern void unix_inflight(struct file *fp); | |||
| 10 | extern void unix_notinflight(struct file *fp); | 10 | extern void unix_notinflight(struct file *fp); |
| 11 | extern void unix_gc(void); | 11 | extern void unix_gc(void); |
| 12 | extern void wait_for_unix_gc(void); | 12 | extern void wait_for_unix_gc(void); |
| 13 | extern struct sock *unix_get_socket(struct file *filp); | ||
| 13 | 14 | ||
| 14 | #define UNIX_HASH_SIZE 256 | 15 | #define UNIX_HASH_SIZE 256 |
| 15 | 16 | ||
| @@ -56,6 +57,7 @@ struct unix_sock { | |||
| 56 | spinlock_t lock; | 57 | spinlock_t lock; |
| 57 | unsigned int gc_candidate : 1; | 58 | unsigned int gc_candidate : 1; |
| 58 | unsigned int gc_maybe_cycle : 1; | 59 | unsigned int gc_maybe_cycle : 1; |
| 60 | unsigned char recursion_level; | ||
| 59 | struct socket_wq peer_wq; | 61 | struct socket_wq peer_wq; |
| 60 | }; | 62 | }; |
| 61 | #define unix_sk(__sk) ((struct unix_sock *)__sk) | 63 | #define unix_sk(__sk) ((struct unix_sock *)__sk) |
diff --git a/include/net/bluetooth/bluetooth.h b/include/net/bluetooth/bluetooth.h index d81ea7997701..0c5e72503b77 100644 --- a/include/net/bluetooth/bluetooth.h +++ b/include/net/bluetooth/bluetooth.h | |||
| @@ -144,6 +144,7 @@ struct bt_skb_cb { | |||
| 144 | __u8 tx_seq; | 144 | __u8 tx_seq; |
| 145 | __u8 retries; | 145 | __u8 retries; |
| 146 | __u8 sar; | 146 | __u8 sar; |
| 147 | unsigned short channel; | ||
| 147 | }; | 148 | }; |
| 148 | #define bt_cb(skb) ((struct bt_skb_cb *)((skb)->cb)) | 149 | #define bt_cb(skb) ((struct bt_skb_cb *)((skb)->cb)) |
| 149 | 150 | ||
diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h index e30e00834340..29a7a8ca0438 100644 --- a/include/net/bluetooth/hci.h +++ b/include/net/bluetooth/hci.h | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* | 1 | /* |
| 2 | BlueZ - Bluetooth protocol stack for Linux | 2 | BlueZ - Bluetooth protocol stack for Linux |
| 3 | Copyright (C) 2000-2001 Qualcomm Incorporated | 3 | Copyright (C) 2000-2001 Qualcomm Incorporated |
| 4 | 4 | ||
| @@ -12,13 +12,13 @@ | |||
| 12 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | 12 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 13 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. | 13 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. |
| 14 | IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY | 14 | IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY |
| 15 | CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES | 15 | CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES |
| 16 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | 16 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
| 17 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | 17 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
| 18 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | 18 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
| 19 | 19 | ||
| 20 | ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, | 20 | ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, |
| 21 | COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS | 21 | COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS |
| 22 | SOFTWARE IS DISCLAIMED. | 22 | SOFTWARE IS DISCLAIMED. |
| 23 | */ | 23 | */ |
| 24 | 24 | ||
| @@ -489,7 +489,7 @@ struct hci_rp_read_local_name { | |||
| 489 | 489 | ||
| 490 | #define HCI_OP_WRITE_PG_TIMEOUT 0x0c18 | 490 | #define HCI_OP_WRITE_PG_TIMEOUT 0x0c18 |
| 491 | 491 | ||
| 492 | #define HCI_OP_WRITE_SCAN_ENABLE 0x0c1a | 492 | #define HCI_OP_WRITE_SCAN_ENABLE 0x0c1a |
| 493 | #define SCAN_DISABLED 0x00 | 493 | #define SCAN_DISABLED 0x00 |
| 494 | #define SCAN_INQUIRY 0x01 | 494 | #define SCAN_INQUIRY 0x01 |
| 495 | #define SCAN_PAGE 0x02 | 495 | #define SCAN_PAGE 0x02 |
| @@ -874,7 +874,7 @@ struct hci_ev_si_security { | |||
| 874 | 874 | ||
| 875 | struct hci_command_hdr { | 875 | struct hci_command_hdr { |
| 876 | __le16 opcode; /* OCF & OGF */ | 876 | __le16 opcode; /* OCF & OGF */ |
| 877 | __u8 plen; | 877 | __u8 plen; |
| 878 | } __packed; | 878 | } __packed; |
| 879 | 879 | ||
| 880 | struct hci_event_hdr { | 880 | struct hci_event_hdr { |
| @@ -934,9 +934,13 @@ static inline struct hci_sco_hdr *hci_sco_hdr(const struct sk_buff *skb) | |||
| 934 | struct sockaddr_hci { | 934 | struct sockaddr_hci { |
| 935 | sa_family_t hci_family; | 935 | sa_family_t hci_family; |
| 936 | unsigned short hci_dev; | 936 | unsigned short hci_dev; |
| 937 | unsigned short hci_channel; | ||
| 937 | }; | 938 | }; |
| 938 | #define HCI_DEV_NONE 0xffff | 939 | #define HCI_DEV_NONE 0xffff |
| 939 | 940 | ||
| 941 | #define HCI_CHANNEL_RAW 0 | ||
| 942 | #define HCI_CHANNEL_CONTROL 1 | ||
| 943 | |||
| 940 | struct hci_filter { | 944 | struct hci_filter { |
| 941 | unsigned long type_mask; | 945 | unsigned long type_mask; |
| 942 | unsigned long event_mask[2]; | 946 | unsigned long event_mask[2]; |
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h index ebec8c9a929d..a29feb01854e 100644 --- a/include/net/bluetooth/hci_core.h +++ b/include/net/bluetooth/hci_core.h | |||
| @@ -44,15 +44,15 @@ struct inquiry_data { | |||
| 44 | }; | 44 | }; |
| 45 | 45 | ||
| 46 | struct inquiry_entry { | 46 | struct inquiry_entry { |
| 47 | struct inquiry_entry *next; | 47 | struct inquiry_entry *next; |
| 48 | __u32 timestamp; | 48 | __u32 timestamp; |
| 49 | struct inquiry_data data; | 49 | struct inquiry_data data; |
| 50 | }; | 50 | }; |
| 51 | 51 | ||
| 52 | struct inquiry_cache { | 52 | struct inquiry_cache { |
| 53 | spinlock_t lock; | 53 | spinlock_t lock; |
| 54 | __u32 timestamp; | 54 | __u32 timestamp; |
| 55 | struct inquiry_entry *list; | 55 | struct inquiry_entry *list; |
| 56 | }; | 56 | }; |
| 57 | 57 | ||
| 58 | struct hci_conn_hash { | 58 | struct hci_conn_hash { |
| @@ -129,6 +129,7 @@ struct hci_dev { | |||
| 129 | wait_queue_head_t req_wait_q; | 129 | wait_queue_head_t req_wait_q; |
| 130 | __u32 req_status; | 130 | __u32 req_status; |
| 131 | __u32 req_result; | 131 | __u32 req_result; |
| 132 | __u16 req_last_cmd; | ||
| 132 | 133 | ||
| 133 | struct inquiry_cache inq_cache; | 134 | struct inquiry_cache inq_cache; |
| 134 | struct hci_conn_hash conn_hash; | 135 | struct hci_conn_hash conn_hash; |
| @@ -141,7 +142,7 @@ struct hci_dev { | |||
| 141 | void *driver_data; | 142 | void *driver_data; |
| 142 | void *core_data; | 143 | void *core_data; |
| 143 | 144 | ||
| 144 | atomic_t promisc; | 145 | atomic_t promisc; |
| 145 | 146 | ||
| 146 | struct dentry *debugfs; | 147 | struct dentry *debugfs; |
| 147 | 148 | ||
| @@ -150,7 +151,7 @@ struct hci_dev { | |||
| 150 | 151 | ||
| 151 | struct rfkill *rfkill; | 152 | struct rfkill *rfkill; |
| 152 | 153 | ||
| 153 | struct module *owner; | 154 | struct module *owner; |
| 154 | 155 | ||
| 155 | int (*open)(struct hci_dev *hdev); | 156 | int (*open)(struct hci_dev *hdev); |
| 156 | int (*close)(struct hci_dev *hdev); | 157 | int (*close)(struct hci_dev *hdev); |
| @@ -215,8 +216,8 @@ extern rwlock_t hci_dev_list_lock; | |||
| 215 | extern rwlock_t hci_cb_list_lock; | 216 | extern rwlock_t hci_cb_list_lock; |
| 216 | 217 | ||
| 217 | /* ----- Inquiry cache ----- */ | 218 | /* ----- Inquiry cache ----- */ |
| 218 | #define INQUIRY_CACHE_AGE_MAX (HZ*30) // 30 seconds | 219 | #define INQUIRY_CACHE_AGE_MAX (HZ*30) /* 30 seconds */ |
| 219 | #define INQUIRY_ENTRY_AGE_MAX (HZ*60) // 60 seconds | 220 | #define INQUIRY_ENTRY_AGE_MAX (HZ*60) /* 60 seconds */ |
| 220 | 221 | ||
| 221 | #define inquiry_cache_lock(c) spin_lock(&c->lock) | 222 | #define inquiry_cache_lock(c) spin_lock(&c->lock) |
| 222 | #define inquiry_cache_unlock(c) spin_unlock(&c->lock) | 223 | #define inquiry_cache_unlock(c) spin_unlock(&c->lock) |
| @@ -660,6 +661,11 @@ void hci_si_event(struct hci_dev *hdev, int type, int dlen, void *data); | |||
| 660 | /* ----- HCI Sockets ----- */ | 661 | /* ----- HCI Sockets ----- */ |
| 661 | void hci_send_to_sock(struct hci_dev *hdev, struct sk_buff *skb); | 662 | void hci_send_to_sock(struct hci_dev *hdev, struct sk_buff *skb); |
| 662 | 663 | ||
| 664 | /* Management interface */ | ||
| 665 | int mgmt_control(struct sock *sk, struct msghdr *msg, size_t len); | ||
| 666 | int mgmt_index_added(u16 index); | ||
| 667 | int mgmt_index_removed(u16 index); | ||
| 668 | |||
| 663 | /* HCI info for socket */ | 669 | /* HCI info for socket */ |
| 664 | #define hci_pi(sk) ((struct hci_pinfo *) sk) | 670 | #define hci_pi(sk) ((struct hci_pinfo *) sk) |
| 665 | 671 | ||
| @@ -668,6 +674,7 @@ struct hci_pinfo { | |||
| 668 | struct hci_dev *hdev; | 674 | struct hci_dev *hdev; |
| 669 | struct hci_filter filter; | 675 | struct hci_filter filter; |
| 670 | __u32 cmsg_mask; | 676 | __u32 cmsg_mask; |
| 677 | unsigned short channel; | ||
| 671 | }; | 678 | }; |
| 672 | 679 | ||
| 673 | /* HCI security filter */ | 680 | /* HCI security filter */ |
| @@ -687,6 +694,6 @@ struct hci_sec_filter { | |||
| 687 | #define hci_req_lock(d) mutex_lock(&d->req_lock) | 694 | #define hci_req_lock(d) mutex_lock(&d->req_lock) |
| 688 | #define hci_req_unlock(d) mutex_unlock(&d->req_lock) | 695 | #define hci_req_unlock(d) mutex_unlock(&d->req_lock) |
| 689 | 696 | ||
| 690 | void hci_req_complete(struct hci_dev *hdev, int result); | 697 | void hci_req_complete(struct hci_dev *hdev, __u16 cmd, int result); |
| 691 | 698 | ||
| 692 | #endif /* __HCI_CORE_H */ | 699 | #endif /* __HCI_CORE_H */ |
diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h index c819c8bf9b68..7ad25ca60ec0 100644 --- a/include/net/bluetooth/l2cap.h +++ b/include/net/bluetooth/l2cap.h | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* | 1 | /* |
| 2 | BlueZ - Bluetooth protocol stack for Linux | 2 | BlueZ - Bluetooth protocol stack for Linux |
| 3 | Copyright (C) 2000-2001 Qualcomm Incorporated | 3 | Copyright (C) 2000-2001 Qualcomm Incorporated |
| 4 | Copyright (C) 2009-2010 Gustavo F. Padovan <gustavo@padovan.org> | 4 | Copyright (C) 2009-2010 Gustavo F. Padovan <gustavo@padovan.org> |
| @@ -14,13 +14,13 @@ | |||
| 14 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | 14 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. | 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. |
| 16 | IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY | 16 | IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY |
| 17 | CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES | 17 | CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES |
| 18 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | 18 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
| 19 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | 19 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
| 20 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | 20 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
| 21 | 21 | ||
| 22 | ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, | 22 | ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, |
| 23 | COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS | 23 | COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS |
| 24 | SOFTWARE IS DISCLAIMED. | 24 | SOFTWARE IS DISCLAIMED. |
| 25 | */ | 25 | */ |
| 26 | 26 | ||
| @@ -417,11 +417,11 @@ static inline int l2cap_tx_window_full(struct sock *sk) | |||
| 417 | return sub == pi->remote_tx_win; | 417 | return sub == pi->remote_tx_win; |
| 418 | } | 418 | } |
| 419 | 419 | ||
| 420 | #define __get_txseq(ctrl) ((ctrl) & L2CAP_CTRL_TXSEQ) >> 1 | 420 | #define __get_txseq(ctrl) (((ctrl) & L2CAP_CTRL_TXSEQ) >> 1) |
| 421 | #define __get_reqseq(ctrl) ((ctrl) & L2CAP_CTRL_REQSEQ) >> 8 | 421 | #define __get_reqseq(ctrl) (((ctrl) & L2CAP_CTRL_REQSEQ) >> 8) |
| 422 | #define __is_iframe(ctrl) !((ctrl) & L2CAP_CTRL_FRAME_TYPE) | 422 | #define __is_iframe(ctrl) (!((ctrl) & L2CAP_CTRL_FRAME_TYPE)) |
| 423 | #define __is_sframe(ctrl) (ctrl) & L2CAP_CTRL_FRAME_TYPE | 423 | #define __is_sframe(ctrl) ((ctrl) & L2CAP_CTRL_FRAME_TYPE) |
| 424 | #define __is_sar_start(ctrl) ((ctrl) & L2CAP_CTRL_SAR) == L2CAP_SDU_START | 424 | #define __is_sar_start(ctrl) (((ctrl) & L2CAP_CTRL_SAR) == L2CAP_SDU_START) |
| 425 | 425 | ||
| 426 | void l2cap_load(void); | 426 | void l2cap_load(void); |
| 427 | 427 | ||
diff --git a/include/net/bluetooth/mgmt.h b/include/net/bluetooth/mgmt.h new file mode 100644 index 000000000000..ca29c1367ffd --- /dev/null +++ b/include/net/bluetooth/mgmt.h | |||
| @@ -0,0 +1,87 @@ | |||
| 1 | /* | ||
| 2 | BlueZ - Bluetooth protocol stack for Linux | ||
| 3 | |||
| 4 | Copyright (C) 2010 Nokia Corporation | ||
| 5 | |||
| 6 | This program is free software; you can redistribute it and/or modify | ||
| 7 | it under the terms of the GNU General Public License version 2 as | ||
| 8 | published by the Free Software Foundation; | ||
| 9 | |||
| 10 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS | ||
| 11 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| 12 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. | ||
| 13 | IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY | ||
| 14 | CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES | ||
| 15 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | ||
| 16 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | ||
| 17 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
| 18 | |||
| 19 | ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, | ||
| 20 | COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS | ||
| 21 | SOFTWARE IS DISCLAIMED. | ||
| 22 | */ | ||
| 23 | |||
| 24 | struct mgmt_hdr { | ||
| 25 | __le16 opcode; | ||
| 26 | __le16 len; | ||
| 27 | } __packed; | ||
| 28 | #define MGMT_HDR_SIZE 4 | ||
| 29 | |||
| 30 | #define MGMT_OP_READ_VERSION 0x0001 | ||
| 31 | struct mgmt_rp_read_version { | ||
| 32 | __u8 version; | ||
| 33 | __le16 revision; | ||
| 34 | } __packed; | ||
| 35 | |||
| 36 | #define MGMT_OP_READ_INDEX_LIST 0x0003 | ||
| 37 | struct mgmt_rp_read_index_list { | ||
| 38 | __le16 num_controllers; | ||
| 39 | __le16 index[0]; | ||
| 40 | } __packed; | ||
| 41 | |||
| 42 | #define MGMT_OP_READ_INFO 0x0004 | ||
| 43 | struct mgmt_cp_read_info { | ||
| 44 | __le16 index; | ||
| 45 | } __packed; | ||
| 46 | struct mgmt_rp_read_info { | ||
| 47 | __le16 index; | ||
| 48 | __u8 type; | ||
| 49 | __u8 powered; | ||
| 50 | __u8 discoverable; | ||
| 51 | __u8 pairable; | ||
| 52 | __u8 sec_mode; | ||
| 53 | bdaddr_t bdaddr; | ||
| 54 | __u8 dev_class[3]; | ||
| 55 | __u8 features[8]; | ||
| 56 | __u16 manufacturer; | ||
| 57 | __u8 hci_ver; | ||
| 58 | __u16 hci_rev; | ||
| 59 | } __packed; | ||
| 60 | |||
| 61 | #define MGMT_EV_CMD_COMPLETE 0x0001 | ||
| 62 | struct mgmt_ev_cmd_complete { | ||
| 63 | __le16 opcode; | ||
| 64 | __u8 data[0]; | ||
| 65 | } __packed; | ||
| 66 | |||
| 67 | #define MGMT_EV_CMD_STATUS 0x0002 | ||
| 68 | struct mgmt_ev_cmd_status { | ||
| 69 | __u8 status; | ||
| 70 | __le16 opcode; | ||
| 71 | } __packed; | ||
| 72 | |||
| 73 | #define MGMT_EV_CONTROLLER_ERROR 0x0003 | ||
| 74 | struct mgmt_ev_controller_error { | ||
| 75 | __le16 index; | ||
| 76 | __u8 error_code; | ||
| 77 | } __packed; | ||
| 78 | |||
| 79 | #define MGMT_EV_INDEX_ADDED 0x0004 | ||
| 80 | struct mgmt_ev_index_added { | ||
| 81 | __le16 index; | ||
| 82 | } __packed; | ||
| 83 | |||
| 84 | #define MGMT_EV_INDEX_REMOVED 0x0005 | ||
| 85 | struct mgmt_ev_index_removed { | ||
| 86 | __le16 index; | ||
| 87 | } __packed; | ||
diff --git a/include/net/bluetooth/rfcomm.h b/include/net/bluetooth/rfcomm.h index 71047bc0af84..6eac4a760c3b 100644 --- a/include/net/bluetooth/rfcomm.h +++ b/include/net/bluetooth/rfcomm.h | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | RFCOMM implementation for Linux Bluetooth stack (BlueZ). | 2 | RFCOMM implementation for Linux Bluetooth stack (BlueZ) |
| 3 | Copyright (C) 2002 Maxim Krasnyansky <maxk@qualcomm.com> | 3 | Copyright (C) 2002 Maxim Krasnyansky <maxk@qualcomm.com> |
| 4 | Copyright (C) 2002 Marcel Holtmann <marcel@holtmann.org> | 4 | Copyright (C) 2002 Marcel Holtmann <marcel@holtmann.org> |
| 5 | 5 | ||
| @@ -11,13 +11,13 @@ | |||
| 11 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | 11 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 12 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. | 12 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. |
| 13 | IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY | 13 | IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY |
| 14 | CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES | 14 | CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES |
| 15 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | 15 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
| 16 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | 16 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
| 17 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | 17 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
| 18 | 18 | ||
| 19 | ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, | 19 | ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, |
| 20 | COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS | 20 | COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS |
| 21 | SOFTWARE IS DISCLAIMED. | 21 | SOFTWARE IS DISCLAIMED. |
| 22 | */ | 22 | */ |
| 23 | 23 | ||
| @@ -105,7 +105,7 @@ | |||
| 105 | struct rfcomm_hdr { | 105 | struct rfcomm_hdr { |
| 106 | u8 addr; | 106 | u8 addr; |
| 107 | u8 ctrl; | 107 | u8 ctrl; |
| 108 | u8 len; // Actual size can be 2 bytes | 108 | u8 len; /* Actual size can be 2 bytes */ |
| 109 | } __packed; | 109 | } __packed; |
| 110 | 110 | ||
| 111 | struct rfcomm_cmd { | 111 | struct rfcomm_cmd { |
| @@ -228,7 +228,7 @@ struct rfcomm_dlc { | |||
| 228 | /* ---- RFCOMM SEND RPN ---- */ | 228 | /* ---- RFCOMM SEND RPN ---- */ |
| 229 | int rfcomm_send_rpn(struct rfcomm_session *s, int cr, u8 dlci, | 229 | int rfcomm_send_rpn(struct rfcomm_session *s, int cr, u8 dlci, |
| 230 | u8 bit_rate, u8 data_bits, u8 stop_bits, | 230 | u8 bit_rate, u8 data_bits, u8 stop_bits, |
| 231 | u8 parity, u8 flow_ctrl_settings, | 231 | u8 parity, u8 flow_ctrl_settings, |
| 232 | u8 xon_char, u8 xoff_char, u16 param_mask); | 232 | u8 xon_char, u8 xoff_char, u16 param_mask); |
| 233 | 233 | ||
| 234 | /* ---- RFCOMM DLCs (channels) ---- */ | 234 | /* ---- RFCOMM DLCs (channels) ---- */ |
diff --git a/include/net/bluetooth/sco.h b/include/net/bluetooth/sco.h index e28a2a771471..1e35c43657c8 100644 --- a/include/net/bluetooth/sco.h +++ b/include/net/bluetooth/sco.h | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* | 1 | /* |
| 2 | BlueZ - Bluetooth protocol stack for Linux | 2 | BlueZ - Bluetooth protocol stack for Linux |
| 3 | Copyright (C) 2000-2001 Qualcomm Incorporated | 3 | Copyright (C) 2000-2001 Qualcomm Incorporated |
| 4 | 4 | ||
| @@ -12,13 +12,13 @@ | |||
| 12 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | 12 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 13 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. | 13 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. |
| 14 | IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY | 14 | IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY |
| 15 | CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES | 15 | CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES |
| 16 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | 16 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
| 17 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | 17 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
| 18 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | 18 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
| 19 | 19 | ||
| 20 | ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, | 20 | ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, |
| 21 | COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS | 21 | COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS |
| 22 | SOFTWARE IS DISCLAIMED. | 22 | SOFTWARE IS DISCLAIMED. |
| 23 | */ | 23 | */ |
| 24 | 24 | ||
| @@ -55,11 +55,11 @@ struct sco_conninfo { | |||
| 55 | struct sco_conn { | 55 | struct sco_conn { |
| 56 | struct hci_conn *hcon; | 56 | struct hci_conn *hcon; |
| 57 | 57 | ||
| 58 | bdaddr_t *dst; | 58 | bdaddr_t *dst; |
| 59 | bdaddr_t *src; | 59 | bdaddr_t *src; |
| 60 | 60 | ||
| 61 | spinlock_t lock; | 61 | spinlock_t lock; |
| 62 | struct sock *sk; | 62 | struct sock *sk; |
| 63 | 63 | ||
| 64 | unsigned int mtu; | 64 | unsigned int mtu; |
| 65 | }; | 65 | }; |
diff --git a/include/net/caif/cfctrl.h b/include/net/caif/cfctrl.h index 9402543fc20d..e54f6396fa4c 100644 --- a/include/net/caif/cfctrl.h +++ b/include/net/caif/cfctrl.h | |||
| @@ -51,7 +51,7 @@ struct cfctrl_rsp { | |||
| 51 | void (*restart_rsp)(void); | 51 | void (*restart_rsp)(void); |
| 52 | void (*radioset_rsp)(void); | 52 | void (*radioset_rsp)(void); |
| 53 | void (*reject_rsp)(struct cflayer *layer, u8 linkid, | 53 | void (*reject_rsp)(struct cflayer *layer, u8 linkid, |
| 54 | struct cflayer *client_layer);; | 54 | struct cflayer *client_layer); |
| 55 | }; | 55 | }; |
| 56 | 56 | ||
| 57 | /* Link Setup Parameters for CAIF-Links. */ | 57 | /* Link Setup Parameters for CAIF-Links. */ |
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index 2a7936d7851d..bcc9f448ec4e 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h | |||
| @@ -258,13 +258,9 @@ struct ieee80211_supported_band { | |||
| 258 | 258 | ||
| 259 | /** | 259 | /** |
| 260 | * struct vif_params - describes virtual interface parameters | 260 | * struct vif_params - describes virtual interface parameters |
| 261 | * @mesh_id: mesh ID to use | ||
| 262 | * @mesh_id_len: length of the mesh ID | ||
| 263 | * @use_4addr: use 4-address frames | 261 | * @use_4addr: use 4-address frames |
| 264 | */ | 262 | */ |
| 265 | struct vif_params { | 263 | struct vif_params { |
| 266 | u8 *mesh_id; | ||
| 267 | int mesh_id_len; | ||
| 268 | int use_4addr; | 264 | int use_4addr; |
| 269 | }; | 265 | }; |
| 270 | 266 | ||
| @@ -424,6 +420,7 @@ struct station_parameters { | |||
| 424 | * @STATION_INFO_TX_RETRIES: @tx_retries filled | 420 | * @STATION_INFO_TX_RETRIES: @tx_retries filled |
| 425 | * @STATION_INFO_TX_FAILED: @tx_failed filled | 421 | * @STATION_INFO_TX_FAILED: @tx_failed filled |
| 426 | * @STATION_INFO_RX_DROP_MISC: @rx_dropped_misc filled | 422 | * @STATION_INFO_RX_DROP_MISC: @rx_dropped_misc filled |
| 423 | * @STATION_INFO_SIGNAL_AVG: @signal_avg filled | ||
| 427 | */ | 424 | */ |
| 428 | enum station_info_flags { | 425 | enum station_info_flags { |
| 429 | STATION_INFO_INACTIVE_TIME = 1<<0, | 426 | STATION_INFO_INACTIVE_TIME = 1<<0, |
| @@ -439,6 +436,7 @@ enum station_info_flags { | |||
| 439 | STATION_INFO_TX_RETRIES = 1<<10, | 436 | STATION_INFO_TX_RETRIES = 1<<10, |
| 440 | STATION_INFO_TX_FAILED = 1<<11, | 437 | STATION_INFO_TX_FAILED = 1<<11, |
| 441 | STATION_INFO_RX_DROP_MISC = 1<<12, | 438 | STATION_INFO_RX_DROP_MISC = 1<<12, |
| 439 | STATION_INFO_SIGNAL_AVG = 1<<13, | ||
| 442 | }; | 440 | }; |
| 443 | 441 | ||
| 444 | /** | 442 | /** |
| @@ -485,6 +483,7 @@ struct rate_info { | |||
| 485 | * @plid: mesh peer link id | 483 | * @plid: mesh peer link id |
| 486 | * @plink_state: mesh peer link state | 484 | * @plink_state: mesh peer link state |
| 487 | * @signal: signal strength of last received packet in dBm | 485 | * @signal: signal strength of last received packet in dBm |
| 486 | * @signal_avg: signal strength average in dBm | ||
| 488 | * @txrate: current unicast bitrate to this station | 487 | * @txrate: current unicast bitrate to this station |
| 489 | * @rx_packets: packets received from this station | 488 | * @rx_packets: packets received from this station |
| 490 | * @tx_packets: packets transmitted to this station | 489 | * @tx_packets: packets transmitted to this station |
| @@ -505,6 +504,7 @@ struct station_info { | |||
| 505 | u16 plid; | 504 | u16 plid; |
| 506 | u8 plink_state; | 505 | u8 plink_state; |
| 507 | s8 signal; | 506 | s8 signal; |
| 507 | s8 signal_avg; | ||
| 508 | struct rate_info txrate; | 508 | struct rate_info txrate; |
| 509 | u32 rx_packets; | 509 | u32 rx_packets; |
| 510 | u32 tx_packets; | 510 | u32 tx_packets; |
| @@ -605,6 +605,8 @@ struct mpath_info { | |||
| 605 | * (or NULL for no change) | 605 | * (or NULL for no change) |
| 606 | * @basic_rates_len: number of basic rates | 606 | * @basic_rates_len: number of basic rates |
| 607 | * @ap_isolate: do not forward packets between connected stations | 607 | * @ap_isolate: do not forward packets between connected stations |
| 608 | * @ht_opmode: HT Operation mode | ||
| 609 | * (u16 = opmode, -1 = do not change) | ||
| 608 | */ | 610 | */ |
| 609 | struct bss_parameters { | 611 | struct bss_parameters { |
| 610 | int use_cts_prot; | 612 | int use_cts_prot; |
| @@ -613,8 +615,14 @@ struct bss_parameters { | |||
| 613 | u8 *basic_rates; | 615 | u8 *basic_rates; |
| 614 | u8 basic_rates_len; | 616 | u8 basic_rates_len; |
| 615 | int ap_isolate; | 617 | int ap_isolate; |
| 618 | int ht_opmode; | ||
| 616 | }; | 619 | }; |
| 617 | 620 | ||
| 621 | /* | ||
| 622 | * struct mesh_config - 802.11s mesh configuration | ||
| 623 | * | ||
| 624 | * These parameters can be changed while the mesh is active. | ||
| 625 | */ | ||
| 618 | struct mesh_config { | 626 | struct mesh_config { |
| 619 | /* Timeouts in ms */ | 627 | /* Timeouts in ms */ |
| 620 | /* Mesh plink management parameters */ | 628 | /* Mesh plink management parameters */ |
| @@ -624,6 +632,8 @@ struct mesh_config { | |||
| 624 | u16 dot11MeshMaxPeerLinks; | 632 | u16 dot11MeshMaxPeerLinks; |
| 625 | u8 dot11MeshMaxRetries; | 633 | u8 dot11MeshMaxRetries; |
| 626 | u8 dot11MeshTTL; | 634 | u8 dot11MeshTTL; |
| 635 | /* ttl used in path selection information elements */ | ||
| 636 | u8 element_ttl; | ||
| 627 | bool auto_open_plinks; | 637 | bool auto_open_plinks; |
| 628 | /* HWMP parameters */ | 638 | /* HWMP parameters */ |
| 629 | u8 dot11MeshHWMPmaxPREQretries; | 639 | u8 dot11MeshHWMPmaxPREQretries; |
| @@ -636,6 +646,26 @@ struct mesh_config { | |||
| 636 | }; | 646 | }; |
| 637 | 647 | ||
| 638 | /** | 648 | /** |
| 649 | * struct mesh_setup - 802.11s mesh setup configuration | ||
| 650 | * @mesh_id: the mesh ID | ||
| 651 | * @mesh_id_len: length of the mesh ID, at least 1 and at most 32 bytes | ||
| 652 | * @path_sel_proto: which path selection protocol to use | ||
| 653 | * @path_metric: which metric to use | ||
| 654 | * @vendor_ie: vendor information elements (optional) | ||
| 655 | * @vendor_ie_len: length of vendor information elements | ||
| 656 | * | ||
| 657 | * These parameters are fixed when the mesh is created. | ||
| 658 | */ | ||
| 659 | struct mesh_setup { | ||
| 660 | const u8 *mesh_id; | ||
| 661 | u8 mesh_id_len; | ||
| 662 | u8 path_sel_proto; | ||
| 663 | u8 path_metric; | ||
| 664 | const u8 *vendor_ie; | ||
| 665 | u8 vendor_ie_len; | ||
| 666 | }; | ||
| 667 | |||
| 668 | /** | ||
| 639 | * struct ieee80211_txq_params - TX queue parameters | 669 | * struct ieee80211_txq_params - TX queue parameters |
| 640 | * @queue: TX queue identifier (NL80211_TXQ_Q_*) | 670 | * @queue: TX queue identifier (NL80211_TXQ_Q_*) |
| 641 | * @txop: Maximum burst time in units of 32 usecs, 0 meaning disabled | 671 | * @txop: Maximum burst time in units of 32 usecs, 0 meaning disabled |
| @@ -923,6 +953,7 @@ struct cfg80211_disassoc_request { | |||
| 923 | * @privacy: this is a protected network, keys will be configured | 953 | * @privacy: this is a protected network, keys will be configured |
| 924 | * after joining | 954 | * after joining |
| 925 | * @basic_rates: bitmap of basic rates to use when creating the IBSS | 955 | * @basic_rates: bitmap of basic rates to use when creating the IBSS |
| 956 | * @mcast_rate: per-band multicast rate index + 1 (0: disabled) | ||
| 926 | */ | 957 | */ |
| 927 | struct cfg80211_ibss_params { | 958 | struct cfg80211_ibss_params { |
| 928 | u8 *ssid; | 959 | u8 *ssid; |
| @@ -934,6 +965,7 @@ struct cfg80211_ibss_params { | |||
| 934 | u32 basic_rates; | 965 | u32 basic_rates; |
| 935 | bool channel_fixed; | 966 | bool channel_fixed; |
| 936 | bool privacy; | 967 | bool privacy; |
| 968 | int mcast_rate[IEEE80211_NUM_BANDS]; | ||
| 937 | }; | 969 | }; |
| 938 | 970 | ||
| 939 | /** | 971 | /** |
| @@ -1029,7 +1061,8 @@ struct cfg80211_pmksa { | |||
| 1029 | * | 1061 | * |
| 1030 | * @add_virtual_intf: create a new virtual interface with the given name, | 1062 | * @add_virtual_intf: create a new virtual interface with the given name, |
| 1031 | * must set the struct wireless_dev's iftype. Beware: You must create | 1063 | * must set the struct wireless_dev's iftype. Beware: You must create |
| 1032 | * the new netdev in the wiphy's network namespace! | 1064 | * the new netdev in the wiphy's network namespace! Returns the netdev, |
| 1065 | * or an ERR_PTR. | ||
| 1033 | * | 1066 | * |
| 1034 | * @del_virtual_intf: remove the virtual interface determined by ifindex. | 1067 | * @del_virtual_intf: remove the virtual interface determined by ifindex. |
| 1035 | * | 1068 | * |
| @@ -1071,9 +1104,9 @@ struct cfg80211_pmksa { | |||
| 1071 | * @get_mpath: get a mesh path for the given parameters | 1104 | * @get_mpath: get a mesh path for the given parameters |
| 1072 | * @dump_mpath: dump mesh path callback -- resume dump at index @idx | 1105 | * @dump_mpath: dump mesh path callback -- resume dump at index @idx |
| 1073 | * | 1106 | * |
| 1074 | * @get_mesh_params: Put the current mesh parameters into *params | 1107 | * @get_mesh_config: Get the current mesh configuration |
| 1075 | * | 1108 | * |
| 1076 | * @set_mesh_params: Set mesh parameters. | 1109 | * @update_mesh_config: Update mesh parameters on a running mesh. |
| 1077 | * The mask is a bitfield which tells us which parameters to | 1110 | * The mask is a bitfield which tells us which parameters to |
| 1078 | * set, and which to leave alone. | 1111 | * set, and which to leave alone. |
| 1079 | * | 1112 | * |
| @@ -1132,7 +1165,9 @@ struct cfg80211_pmksa { | |||
| 1132 | * @cancel_remain_on_channel: Cancel an on-going remain-on-channel operation. | 1165 | * @cancel_remain_on_channel: Cancel an on-going remain-on-channel operation. |
| 1133 | * This allows the operation to be terminated prior to timeout based on | 1166 | * This allows the operation to be terminated prior to timeout based on |
| 1134 | * the duration value. | 1167 | * the duration value. |
| 1135 | * @mgmt_tx: Transmit a management frame | 1168 | * @mgmt_tx: Transmit a management frame. |
| 1169 | * @mgmt_tx_cancel_wait: Cancel the wait time from transmitting a management | ||
| 1170 | * frame on another channel | ||
| 1136 | * | 1171 | * |
| 1137 | * @testmode_cmd: run a test mode command | 1172 | * @testmode_cmd: run a test mode command |
| 1138 | * | 1173 | * |
| @@ -1150,14 +1185,23 @@ struct cfg80211_pmksa { | |||
| 1150 | * @mgmt_frame_register: Notify driver that a management frame type was | 1185 | * @mgmt_frame_register: Notify driver that a management frame type was |
| 1151 | * registered. Note that this callback may not sleep, and cannot run | 1186 | * registered. Note that this callback may not sleep, and cannot run |
| 1152 | * concurrently with itself. | 1187 | * concurrently with itself. |
| 1188 | * | ||
| 1189 | * @set_antenna: Set antenna configuration (tx_ant, rx_ant) on the device. | ||
| 1190 | * Parameters are bitmaps of allowed antennas to use for TX/RX. Drivers may | ||
| 1191 | * reject TX/RX mask combinations they cannot support by returning -EINVAL | ||
| 1192 | * (also see nl80211.h @NL80211_ATTR_WIPHY_ANTENNA_TX). | ||
| 1193 | * | ||
| 1194 | * @get_antenna: Get current antenna configuration from device (tx_ant, rx_ant). | ||
| 1153 | */ | 1195 | */ |
| 1154 | struct cfg80211_ops { | 1196 | struct cfg80211_ops { |
| 1155 | int (*suspend)(struct wiphy *wiphy); | 1197 | int (*suspend)(struct wiphy *wiphy); |
| 1156 | int (*resume)(struct wiphy *wiphy); | 1198 | int (*resume)(struct wiphy *wiphy); |
| 1157 | 1199 | ||
| 1158 | int (*add_virtual_intf)(struct wiphy *wiphy, char *name, | 1200 | struct net_device * (*add_virtual_intf)(struct wiphy *wiphy, |
| 1159 | enum nl80211_iftype type, u32 *flags, | 1201 | char *name, |
| 1160 | struct vif_params *params); | 1202 | enum nl80211_iftype type, |
| 1203 | u32 *flags, | ||
| 1204 | struct vif_params *params); | ||
| 1161 | int (*del_virtual_intf)(struct wiphy *wiphy, struct net_device *dev); | 1205 | int (*del_virtual_intf)(struct wiphy *wiphy, struct net_device *dev); |
| 1162 | int (*change_virtual_intf)(struct wiphy *wiphy, | 1206 | int (*change_virtual_intf)(struct wiphy *wiphy, |
| 1163 | struct net_device *dev, | 1207 | struct net_device *dev, |
| @@ -1175,7 +1219,7 @@ struct cfg80211_ops { | |||
| 1175 | u8 key_index, bool pairwise, const u8 *mac_addr); | 1219 | u8 key_index, bool pairwise, const u8 *mac_addr); |
| 1176 | int (*set_default_key)(struct wiphy *wiphy, | 1220 | int (*set_default_key)(struct wiphy *wiphy, |
| 1177 | struct net_device *netdev, | 1221 | struct net_device *netdev, |
| 1178 | u8 key_index); | 1222 | u8 key_index, bool unicast, bool multicast); |
| 1179 | int (*set_default_mgmt_key)(struct wiphy *wiphy, | 1223 | int (*set_default_mgmt_key)(struct wiphy *wiphy, |
| 1180 | struct net_device *netdev, | 1224 | struct net_device *netdev, |
| 1181 | u8 key_index); | 1225 | u8 key_index); |
| @@ -1210,12 +1254,17 @@ struct cfg80211_ops { | |||
| 1210 | int (*dump_mpath)(struct wiphy *wiphy, struct net_device *dev, | 1254 | int (*dump_mpath)(struct wiphy *wiphy, struct net_device *dev, |
| 1211 | int idx, u8 *dst, u8 *next_hop, | 1255 | int idx, u8 *dst, u8 *next_hop, |
| 1212 | struct mpath_info *pinfo); | 1256 | struct mpath_info *pinfo); |
| 1213 | int (*get_mesh_params)(struct wiphy *wiphy, | 1257 | int (*get_mesh_config)(struct wiphy *wiphy, |
| 1214 | struct net_device *dev, | 1258 | struct net_device *dev, |
| 1215 | struct mesh_config *conf); | 1259 | struct mesh_config *conf); |
| 1216 | int (*set_mesh_params)(struct wiphy *wiphy, | 1260 | int (*update_mesh_config)(struct wiphy *wiphy, |
| 1217 | struct net_device *dev, | 1261 | struct net_device *dev, u32 mask, |
| 1218 | const struct mesh_config *nconf, u32 mask); | 1262 | const struct mesh_config *nconf); |
| 1263 | int (*join_mesh)(struct wiphy *wiphy, struct net_device *dev, | ||
| 1264 | const struct mesh_config *conf, | ||
| 1265 | const struct mesh_setup *setup); | ||
| 1266 | int (*leave_mesh)(struct wiphy *wiphy, struct net_device *dev); | ||
| 1267 | |||
| 1219 | int (*change_bss)(struct wiphy *wiphy, struct net_device *dev, | 1268 | int (*change_bss)(struct wiphy *wiphy, struct net_device *dev, |
| 1220 | struct bss_parameters *params); | 1269 | struct bss_parameters *params); |
| 1221 | 1270 | ||
| @@ -1289,10 +1338,13 @@ struct cfg80211_ops { | |||
| 1289 | u64 cookie); | 1338 | u64 cookie); |
| 1290 | 1339 | ||
| 1291 | int (*mgmt_tx)(struct wiphy *wiphy, struct net_device *dev, | 1340 | int (*mgmt_tx)(struct wiphy *wiphy, struct net_device *dev, |
| 1292 | struct ieee80211_channel *chan, | 1341 | struct ieee80211_channel *chan, bool offchan, |
| 1293 | enum nl80211_channel_type channel_type, | 1342 | enum nl80211_channel_type channel_type, |
| 1294 | bool channel_type_valid, | 1343 | bool channel_type_valid, unsigned int wait, |
| 1295 | const u8 *buf, size_t len, u64 *cookie); | 1344 | const u8 *buf, size_t len, u64 *cookie); |
| 1345 | int (*mgmt_tx_cancel_wait)(struct wiphy *wiphy, | ||
| 1346 | struct net_device *dev, | ||
| 1347 | u64 cookie); | ||
| 1296 | 1348 | ||
| 1297 | int (*set_power_mgmt)(struct wiphy *wiphy, struct net_device *dev, | 1349 | int (*set_power_mgmt)(struct wiphy *wiphy, struct net_device *dev, |
| 1298 | bool enabled, int timeout); | 1350 | bool enabled, int timeout); |
| @@ -1304,6 +1356,9 @@ struct cfg80211_ops { | |||
| 1304 | void (*mgmt_frame_register)(struct wiphy *wiphy, | 1356 | void (*mgmt_frame_register)(struct wiphy *wiphy, |
| 1305 | struct net_device *dev, | 1357 | struct net_device *dev, |
| 1306 | u16 frame_type, bool reg); | 1358 | u16 frame_type, bool reg); |
| 1359 | |||
| 1360 | int (*set_antenna)(struct wiphy *wiphy, u32 tx_ant, u32 rx_ant); | ||
| 1361 | int (*get_antenna)(struct wiphy *wiphy, u32 *tx_ant, u32 *rx_ant); | ||
| 1307 | }; | 1362 | }; |
| 1308 | 1363 | ||
| 1309 | /* | 1364 | /* |
| @@ -1321,13 +1376,14 @@ struct cfg80211_ops { | |||
| 1321 | * initiator is %REGDOM_SET_BY_CORE). | 1376 | * initiator is %REGDOM_SET_BY_CORE). |
| 1322 | * @WIPHY_FLAG_STRICT_REGULATORY: tells us the driver for this device will | 1377 | * @WIPHY_FLAG_STRICT_REGULATORY: tells us the driver for this device will |
| 1323 | * ignore regulatory domain settings until it gets its own regulatory | 1378 | * ignore regulatory domain settings until it gets its own regulatory |
| 1324 | * domain via its regulatory_hint(). After its gets its own regulatory | 1379 | * domain via its regulatory_hint() unless the regulatory hint is |
| 1325 | * domain it will only allow further regulatory domain settings to | 1380 | * from a country IE. After its gets its own regulatory domain it will |
| 1326 | * further enhance compliance. For example if channel 13 and 14 are | 1381 | * only allow further regulatory domain settings to further enhance |
| 1327 | * disabled by this regulatory domain no user regulatory domain can | 1382 | * compliance. For example if channel 13 and 14 are disabled by this |
| 1328 | * enable these channels at a later time. This can be used for devices | 1383 | * regulatory domain no user regulatory domain can enable these channels |
| 1329 | * which do not have calibration information gauranteed for frequencies | 1384 | * at a later time. This can be used for devices which do not have |
| 1330 | * or settings outside of its regulatory domain. | 1385 | * calibration information guaranteed for frequencies or settings |
| 1386 | * outside of its regulatory domain. | ||
| 1331 | * @WIPHY_FLAG_DISABLE_BEACON_HINTS: enable this if your driver needs to ensure | 1387 | * @WIPHY_FLAG_DISABLE_BEACON_HINTS: enable this if your driver needs to ensure |
| 1332 | * that passive scan flags and beaconing flags may not be lifted by | 1388 | * that passive scan flags and beaconing flags may not be lifted by |
| 1333 | * cfg80211 due to regulatory beacon hints. For more information on beacon | 1389 | * cfg80211 due to regulatory beacon hints. For more information on beacon |
| @@ -1345,6 +1401,8 @@ struct cfg80211_ops { | |||
| 1345 | * control port protocol ethertype. The device also honours the | 1401 | * control port protocol ethertype. The device also honours the |
| 1346 | * control_port_no_encrypt flag. | 1402 | * control_port_no_encrypt flag. |
| 1347 | * @WIPHY_FLAG_IBSS_RSN: The device supports IBSS RSN. | 1403 | * @WIPHY_FLAG_IBSS_RSN: The device supports IBSS RSN. |
| 1404 | * @WIPHY_FLAG_SUPPORTS_SEPARATE_DEFAULT_KEYS: The device supports separate | ||
| 1405 | * unicast and multicast TX keys. | ||
| 1348 | */ | 1406 | */ |
| 1349 | enum wiphy_flags { | 1407 | enum wiphy_flags { |
| 1350 | WIPHY_FLAG_CUSTOM_REGULATORY = BIT(0), | 1408 | WIPHY_FLAG_CUSTOM_REGULATORY = BIT(0), |
| @@ -1355,7 +1413,8 @@ enum wiphy_flags { | |||
| 1355 | WIPHY_FLAG_4ADDR_AP = BIT(5), | 1413 | WIPHY_FLAG_4ADDR_AP = BIT(5), |
| 1356 | WIPHY_FLAG_4ADDR_STATION = BIT(6), | 1414 | WIPHY_FLAG_4ADDR_STATION = BIT(6), |
| 1357 | WIPHY_FLAG_CONTROL_PORT_PROTOCOL = BIT(7), | 1415 | WIPHY_FLAG_CONTROL_PORT_PROTOCOL = BIT(7), |
| 1358 | WIPHY_FLAG_IBSS_RSN = BIT(7), | 1416 | WIPHY_FLAG_IBSS_RSN = BIT(8), |
| 1417 | WIPHY_FLAG_SUPPORTS_SEPARATE_DEFAULT_KEYS= BIT(9), | ||
| 1359 | }; | 1418 | }; |
| 1360 | 1419 | ||
| 1361 | struct mac_address { | 1420 | struct mac_address { |
| @@ -1368,7 +1427,9 @@ struct ieee80211_txrx_stypes { | |||
| 1368 | 1427 | ||
| 1369 | /** | 1428 | /** |
| 1370 | * struct wiphy - wireless hardware description | 1429 | * struct wiphy - wireless hardware description |
| 1371 | * @reg_notifier: the driver's regulatory notification callback | 1430 | * @reg_notifier: the driver's regulatory notification callback, |
| 1431 | * note that if your driver uses wiphy_apply_custom_regulatory() | ||
| 1432 | * the reg_notifier's request can be passed as NULL | ||
| 1372 | * @regd: the driver's regulatory domain, if one was requested via | 1433 | * @regd: the driver's regulatory domain, if one was requested via |
| 1373 | * the regulatory_hint() API. This can be used by the driver | 1434 | * the regulatory_hint() API. This can be used by the driver |
| 1374 | * on the reg_notifier() if it chooses to ignore future | 1435 | * on the reg_notifier() if it chooses to ignore future |
| @@ -1420,6 +1481,17 @@ struct ieee80211_txrx_stypes { | |||
| 1420 | * @mgmt_stypes: bitmasks of frame subtypes that can be subscribed to or | 1481 | * @mgmt_stypes: bitmasks of frame subtypes that can be subscribed to or |
| 1421 | * transmitted through nl80211, points to an array indexed by interface | 1482 | * transmitted through nl80211, points to an array indexed by interface |
| 1422 | * type | 1483 | * type |
| 1484 | * | ||
| 1485 | * @available_antennas_tx: bitmap of antennas which are available to be | ||
| 1486 | * configured as TX antennas. Antenna configuration commands will be | ||
| 1487 | * rejected unless this or @available_antennas_rx is set. | ||
| 1488 | * | ||
| 1489 | * @available_antennas_rx: bitmap of antennas which are available to be | ||
| 1490 | * configured as RX antennas. Antenna configuration commands will be | ||
| 1491 | * rejected unless this or @available_antennas_tx is set. | ||
| 1492 | * | ||
| 1493 | * @max_remain_on_channel_duration: Maximum time a remain-on-channel operation | ||
| 1494 | * may request, if implemented. | ||
| 1423 | */ | 1495 | */ |
| 1424 | struct wiphy { | 1496 | struct wiphy { |
| 1425 | /* assign these fields before you register the wiphy */ | 1497 | /* assign these fields before you register the wiphy */ |
| @@ -1457,8 +1529,13 @@ struct wiphy { | |||
| 1457 | char fw_version[ETHTOOL_BUSINFO_LEN]; | 1529 | char fw_version[ETHTOOL_BUSINFO_LEN]; |
| 1458 | u32 hw_version; | 1530 | u32 hw_version; |
| 1459 | 1531 | ||
| 1532 | u16 max_remain_on_channel_duration; | ||
| 1533 | |||
| 1460 | u8 max_num_pmkids; | 1534 | u8 max_num_pmkids; |
| 1461 | 1535 | ||
| 1536 | u32 available_antennas_tx; | ||
| 1537 | u32 available_antennas_rx; | ||
| 1538 | |||
| 1462 | /* If multiple wiphys are registered and you're handed e.g. | 1539 | /* If multiple wiphys are registered and you're handed e.g. |
| 1463 | * a regular netdev with assigned ieee80211_ptr, you won't | 1540 | * a regular netdev with assigned ieee80211_ptr, you won't |
| 1464 | * know whether it points to a wiphy your driver has registered | 1541 | * know whether it points to a wiphy your driver has registered |
| @@ -1624,6 +1701,8 @@ struct cfg80211_cached_keys; | |||
| 1624 | * @bssid: (private) Used by the internal configuration code | 1701 | * @bssid: (private) Used by the internal configuration code |
| 1625 | * @ssid: (private) Used by the internal configuration code | 1702 | * @ssid: (private) Used by the internal configuration code |
| 1626 | * @ssid_len: (private) Used by the internal configuration code | 1703 | * @ssid_len: (private) Used by the internal configuration code |
| 1704 | * @mesh_id_len: (private) Used by the internal configuration code | ||
| 1705 | * @mesh_id_up_len: (private) Used by the internal configuration code | ||
| 1627 | * @wext: (private) Used by the internal wireless extensions compat code | 1706 | * @wext: (private) Used by the internal wireless extensions compat code |
| 1628 | * @use_4addr: indicates 4addr mode is used on this interface, must be | 1707 | * @use_4addr: indicates 4addr mode is used on this interface, must be |
| 1629 | * set by driver (if supported) on add_interface BEFORE registering the | 1708 | * set by driver (if supported) on add_interface BEFORE registering the |
| @@ -1653,7 +1732,7 @@ struct wireless_dev { | |||
| 1653 | 1732 | ||
| 1654 | /* currently used for IBSS and SME - might be rearranged later */ | 1733 | /* currently used for IBSS and SME - might be rearranged later */ |
| 1655 | u8 ssid[IEEE80211_MAX_SSID_LEN]; | 1734 | u8 ssid[IEEE80211_MAX_SSID_LEN]; |
| 1656 | u8 ssid_len; | 1735 | u8 ssid_len, mesh_id_len, mesh_id_up_len; |
| 1657 | enum { | 1736 | enum { |
| 1658 | CFG80211_SME_IDLE, | 1737 | CFG80211_SME_IDLE, |
| 1659 | CFG80211_SME_CONNECTING, | 1738 | CFG80211_SME_CONNECTING, |
| @@ -2297,6 +2376,32 @@ void __cfg80211_send_disassoc(struct net_device *dev, const u8 *buf, | |||
| 2297 | size_t len); | 2376 | size_t len); |
| 2298 | 2377 | ||
| 2299 | /** | 2378 | /** |
| 2379 | * cfg80211_send_unprot_deauth - notification of unprotected deauthentication | ||
| 2380 | * @dev: network device | ||
| 2381 | * @buf: deauthentication frame (header + body) | ||
| 2382 | * @len: length of the frame data | ||
| 2383 | * | ||
| 2384 | * This function is called whenever a received Deauthentication frame has been | ||
| 2385 | * dropped in station mode because of MFP being used but the Deauthentication | ||
| 2386 | * frame was not protected. This function may sleep. | ||
| 2387 | */ | ||
| 2388 | void cfg80211_send_unprot_deauth(struct net_device *dev, const u8 *buf, | ||
| 2389 | size_t len); | ||
| 2390 | |||
| 2391 | /** | ||
| 2392 | * cfg80211_send_unprot_disassoc - notification of unprotected disassociation | ||
| 2393 | * @dev: network device | ||
| 2394 | * @buf: disassociation frame (header + body) | ||
| 2395 | * @len: length of the frame data | ||
| 2396 | * | ||
| 2397 | * This function is called whenever a received Disassociation frame has been | ||
| 2398 | * dropped in station mode because of MFP being used but the Disassociation | ||
| 2399 | * frame was not protected. This function may sleep. | ||
| 2400 | */ | ||
| 2401 | void cfg80211_send_unprot_disassoc(struct net_device *dev, const u8 *buf, | ||
| 2402 | size_t len); | ||
| 2403 | |||
| 2404 | /** | ||
| 2300 | * cfg80211_michael_mic_failure - notification of Michael MIC failure (TKIP) | 2405 | * cfg80211_michael_mic_failure - notification of Michael MIC failure (TKIP) |
| 2301 | * @dev: network device | 2406 | * @dev: network device |
| 2302 | * @addr: The source MAC address of the frame | 2407 | * @addr: The source MAC address of the frame |
| @@ -2595,6 +2700,18 @@ void cfg80211_cqm_rssi_notify(struct net_device *dev, | |||
| 2595 | enum nl80211_cqm_rssi_threshold_event rssi_event, | 2700 | enum nl80211_cqm_rssi_threshold_event rssi_event, |
| 2596 | gfp_t gfp); | 2701 | gfp_t gfp); |
| 2597 | 2702 | ||
| 2703 | /** | ||
| 2704 | * cfg80211_cqm_pktloss_notify - notify userspace about packetloss to peer | ||
| 2705 | * @dev: network device | ||
| 2706 | * @peer: peer's MAC address | ||
| 2707 | * @num_packets: how many packets were lost -- should be a fixed threshold | ||
| 2708 | * but probably no less than maybe 50, or maybe a throughput dependent | ||
| 2709 | * threshold (to account for temporary interference) | ||
| 2710 | * @gfp: context flags | ||
| 2711 | */ | ||
| 2712 | void cfg80211_cqm_pktloss_notify(struct net_device *dev, | ||
| 2713 | const u8 *peer, u32 num_packets, gfp_t gfp); | ||
| 2714 | |||
| 2598 | /* Logging, debugging and troubleshooting/diagnostic helpers. */ | 2715 | /* Logging, debugging and troubleshooting/diagnostic helpers. */ |
| 2599 | 2716 | ||
| 2600 | /* wiphy_printk helpers, similar to dev_printk */ | 2717 | /* wiphy_printk helpers, similar to dev_printk */ |
diff --git a/include/net/dcbevent.h b/include/net/dcbevent.h new file mode 100644 index 000000000000..bc1e7ef40171 --- /dev/null +++ b/include/net/dcbevent.h | |||
| @@ -0,0 +1,31 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (c) 2010, Intel Corporation. | ||
| 3 | * | ||
| 4 | * This program is free software; you can redistribute it and/or modify it | ||
| 5 | * under the terms and conditions of the GNU General Public License, | ||
| 6 | * version 2, as published by the Free Software Foundation. | ||
| 7 | * | ||
| 8 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
| 9 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
| 10 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
| 11 | * more details. | ||
| 12 | * | ||
| 13 | * You should have received a copy of the GNU General Public License along with | ||
| 14 | * this program; if not, write to the Free Software Foundation, Inc., 59 Temple | ||
| 15 | * Place - Suite 330, Boston, MA 02111-1307 USA. | ||
| 16 | * | ||
| 17 | * Author: John Fastabend <john.r.fastabend@intel.com> | ||
| 18 | */ | ||
| 19 | |||
| 20 | #ifndef _DCB_EVENT_H | ||
| 21 | #define _DCB_EVENT_H | ||
| 22 | |||
| 23 | enum dcbevent_notif_type { | ||
| 24 | DCB_APP_EVENT = 1, | ||
| 25 | }; | ||
| 26 | |||
| 27 | extern int register_dcbevent_notifier(struct notifier_block *nb); | ||
| 28 | extern int unregister_dcbevent_notifier(struct notifier_block *nb); | ||
| 29 | extern int call_dcbevent_notifiers(unsigned long val, void *v); | ||
| 30 | |||
| 31 | #endif | ||
diff --git a/include/net/dcbnl.h b/include/net/dcbnl.h index b36ac7e0914d..a8e7852b10ab 100644 --- a/include/net/dcbnl.h +++ b/include/net/dcbnl.h | |||
| @@ -20,11 +20,31 @@ | |||
| 20 | #ifndef __NET_DCBNL_H__ | 20 | #ifndef __NET_DCBNL_H__ |
| 21 | #define __NET_DCBNL_H__ | 21 | #define __NET_DCBNL_H__ |
| 22 | 22 | ||
| 23 | #include <linux/dcbnl.h> | ||
| 24 | |||
| 25 | struct dcb_app_type { | ||
| 26 | char name[IFNAMSIZ]; | ||
| 27 | struct dcb_app app; | ||
| 28 | struct list_head list; | ||
| 29 | }; | ||
| 30 | |||
| 31 | u8 dcb_setapp(struct net_device *, struct dcb_app *); | ||
| 32 | u8 dcb_getapp(struct net_device *, struct dcb_app *); | ||
| 33 | |||
| 23 | /* | 34 | /* |
| 24 | * Ops struct for the netlink callbacks. Used by DCB-enabled drivers through | 35 | * Ops struct for the netlink callbacks. Used by DCB-enabled drivers through |
| 25 | * the netdevice struct. | 36 | * the netdevice struct. |
| 26 | */ | 37 | */ |
| 27 | struct dcbnl_rtnl_ops { | 38 | struct dcbnl_rtnl_ops { |
| 39 | /* IEEE 802.1Qaz std */ | ||
| 40 | int (*ieee_getets) (struct net_device *, struct ieee_ets *); | ||
| 41 | int (*ieee_setets) (struct net_device *, struct ieee_ets *); | ||
| 42 | int (*ieee_getpfc) (struct net_device *, struct ieee_pfc *); | ||
| 43 | int (*ieee_setpfc) (struct net_device *, struct ieee_pfc *); | ||
| 44 | int (*ieee_getapp) (struct net_device *, struct dcb_app *); | ||
| 45 | int (*ieee_setapp) (struct net_device *, struct dcb_app *); | ||
| 46 | |||
| 47 | /* CEE std */ | ||
| 28 | u8 (*getstate)(struct net_device *); | 48 | u8 (*getstate)(struct net_device *); |
| 29 | u8 (*setstate)(struct net_device *, u8); | 49 | u8 (*setstate)(struct net_device *, u8); |
| 30 | void (*getpermhwaddr)(struct net_device *, u8 *); | 50 | void (*getpermhwaddr)(struct net_device *, u8 *); |
| @@ -50,6 +70,14 @@ struct dcbnl_rtnl_ops { | |||
| 50 | void (*setbcnrp)(struct net_device *, int, u8); | 70 | void (*setbcnrp)(struct net_device *, int, u8); |
| 51 | u8 (*setapp)(struct net_device *, u8, u16, u8); | 71 | u8 (*setapp)(struct net_device *, u8, u16, u8); |
| 52 | u8 (*getapp)(struct net_device *, u8, u16); | 72 | u8 (*getapp)(struct net_device *, u8, u16); |
| 73 | u8 (*getfeatcfg)(struct net_device *, int, u8 *); | ||
| 74 | u8 (*setfeatcfg)(struct net_device *, int, u8); | ||
| 75 | |||
| 76 | /* DCBX configuration */ | ||
| 77 | u8 (*getdcbx)(struct net_device *); | ||
| 78 | u8 (*setdcbx)(struct net_device *, u8); | ||
| 79 | |||
| 80 | |||
| 53 | }; | 81 | }; |
| 54 | 82 | ||
| 55 | #endif /* __NET_DCBNL_H__ */ | 83 | #endif /* __NET_DCBNL_H__ */ |
diff --git a/include/net/dn.h b/include/net/dn.h index e5469f7b67a3..a514a3cf4573 100644 --- a/include/net/dn.h +++ b/include/net/dn.h | |||
| @@ -225,7 +225,7 @@ extern int decnet_di_count; | |||
| 225 | extern int decnet_dr_count; | 225 | extern int decnet_dr_count; |
| 226 | extern int decnet_no_fc_max_cwnd; | 226 | extern int decnet_no_fc_max_cwnd; |
| 227 | 227 | ||
| 228 | extern int sysctl_decnet_mem[3]; | 228 | extern long sysctl_decnet_mem[3]; |
| 229 | extern int sysctl_decnet_wmem[3]; | 229 | extern int sysctl_decnet_wmem[3]; |
| 230 | extern int sysctl_decnet_rmem[3]; | 230 | extern int sysctl_decnet_rmem[3]; |
| 231 | 231 | ||
diff --git a/include/net/dst.h b/include/net/dst.h index 6baba836ad8b..be5a0d4c491d 100644 --- a/include/net/dst.h +++ b/include/net/dst.h | |||
| @@ -70,7 +70,7 @@ struct dst_entry { | |||
| 70 | 70 | ||
| 71 | struct dst_ops *ops; | 71 | struct dst_ops *ops; |
| 72 | 72 | ||
| 73 | u32 metrics[RTAX_MAX]; | 73 | u32 _metrics[RTAX_MAX]; |
| 74 | 74 | ||
| 75 | #ifdef CONFIG_IP_ROUTE_CLASSID | 75 | #ifdef CONFIG_IP_ROUTE_CLASSID |
| 76 | __u32 tclassid; | 76 | __u32 tclassid; |
| @@ -104,9 +104,49 @@ struct dst_entry { | |||
| 104 | #ifdef __KERNEL__ | 104 | #ifdef __KERNEL__ |
| 105 | 105 | ||
| 106 | static inline u32 | 106 | static inline u32 |
| 107 | dst_metric(const struct dst_entry *dst, int metric) | 107 | dst_metric_raw(const struct dst_entry *dst, const int metric) |
| 108 | { | 108 | { |
| 109 | return dst->metrics[metric-1]; | 109 | return dst->_metrics[metric-1]; |
| 110 | } | ||
| 111 | |||
| 112 | static inline u32 | ||
| 113 | dst_metric(const struct dst_entry *dst, const int metric) | ||
| 114 | { | ||
| 115 | WARN_ON_ONCE(metric == RTAX_HOPLIMIT || | ||
| 116 | metric == RTAX_ADVMSS || | ||
| 117 | metric == RTAX_MTU); | ||
| 118 | return dst_metric_raw(dst, metric); | ||
| 119 | } | ||
| 120 | |||
| 121 | static inline u32 | ||
| 122 | dst_metric_advmss(const struct dst_entry *dst) | ||
| 123 | { | ||
| 124 | u32 advmss = dst_metric_raw(dst, RTAX_ADVMSS); | ||
| 125 | |||
| 126 | if (!advmss) | ||
| 127 | advmss = dst->ops->default_advmss(dst); | ||
| 128 | |||
| 129 | return advmss; | ||
| 130 | } | ||
| 131 | |||
| 132 | static inline void dst_metric_set(struct dst_entry *dst, int metric, u32 val) | ||
| 133 | { | ||
| 134 | dst->_metrics[metric-1] = val; | ||
| 135 | } | ||
| 136 | |||
| 137 | static inline void dst_import_metrics(struct dst_entry *dst, const u32 *src_metrics) | ||
| 138 | { | ||
| 139 | memcpy(dst->_metrics, src_metrics, RTAX_MAX * sizeof(u32)); | ||
| 140 | } | ||
| 141 | |||
| 142 | static inline void dst_copy_metrics(struct dst_entry *dest, const struct dst_entry *src) | ||
| 143 | { | ||
| 144 | dst_import_metrics(dest, src->_metrics); | ||
| 145 | } | ||
| 146 | |||
| 147 | static inline u32 *dst_metrics_ptr(struct dst_entry *dst) | ||
| 148 | { | ||
| 149 | return dst->_metrics; | ||
| 110 | } | 150 | } |
| 111 | 151 | ||
| 112 | static inline u32 | 152 | static inline u32 |
| @@ -117,11 +157,11 @@ dst_feature(const struct dst_entry *dst, u32 feature) | |||
| 117 | 157 | ||
| 118 | static inline u32 dst_mtu(const struct dst_entry *dst) | 158 | static inline u32 dst_mtu(const struct dst_entry *dst) |
| 119 | { | 159 | { |
| 120 | u32 mtu = dst_metric(dst, RTAX_MTU); | 160 | u32 mtu = dst_metric_raw(dst, RTAX_MTU); |
| 121 | /* | 161 | |
| 122 | * Alexey put it here, so ask him about it :) | 162 | if (!mtu) |
| 123 | */ | 163 | mtu = dst->ops->default_mtu(dst); |
| 124 | barrier(); | 164 | |
| 125 | return mtu; | 165 | return mtu; |
| 126 | } | 166 | } |
| 127 | 167 | ||
| @@ -134,7 +174,7 @@ static inline unsigned long dst_metric_rtt(const struct dst_entry *dst, int metr | |||
| 134 | static inline void set_dst_metric_rtt(struct dst_entry *dst, int metric, | 174 | static inline void set_dst_metric_rtt(struct dst_entry *dst, int metric, |
| 135 | unsigned long rtt) | 175 | unsigned long rtt) |
| 136 | { | 176 | { |
| 137 | dst->metrics[metric-1] = jiffies_to_msecs(rtt); | 177 | dst_metric_set(dst, metric, jiffies_to_msecs(rtt)); |
| 138 | } | 178 | } |
| 139 | 179 | ||
| 140 | static inline u32 | 180 | static inline u32 |
| @@ -147,7 +187,7 @@ dst_allfrag(const struct dst_entry *dst) | |||
| 147 | } | 187 | } |
| 148 | 188 | ||
| 149 | static inline int | 189 | static inline int |
| 150 | dst_metric_locked(struct dst_entry *dst, int metric) | 190 | dst_metric_locked(const struct dst_entry *dst, int metric) |
| 151 | { | 191 | { |
| 152 | return dst_metric(dst, RTAX_LOCK) & (1<<metric); | 192 | return dst_metric(dst, RTAX_LOCK) & (1<<metric); |
| 153 | } | 193 | } |
diff --git a/include/net/dst_ops.h b/include/net/dst_ops.h index 51665b3461b8..21a320b8708e 100644 --- a/include/net/dst_ops.h +++ b/include/net/dst_ops.h | |||
| @@ -16,6 +16,8 @@ struct dst_ops { | |||
| 16 | 16 | ||
| 17 | int (*gc)(struct dst_ops *ops); | 17 | int (*gc)(struct dst_ops *ops); |
| 18 | struct dst_entry * (*check)(struct dst_entry *, __u32 cookie); | 18 | struct dst_entry * (*check)(struct dst_entry *, __u32 cookie); |
| 19 | unsigned int (*default_advmss)(const struct dst_entry *); | ||
| 20 | unsigned int (*default_mtu)(const struct dst_entry *); | ||
| 19 | void (*destroy)(struct dst_entry *); | 21 | void (*destroy)(struct dst_entry *); |
| 20 | void (*ifdown)(struct dst_entry *, | 22 | void (*ifdown)(struct dst_entry *, |
| 21 | struct net_device *dev, int how); | 23 | struct net_device *dev, int how); |
diff --git a/include/net/flow.h b/include/net/flow.h index 0ac3fb5e0973..240b7f356c71 100644 --- a/include/net/flow.h +++ b/include/net/flow.h | |||
| @@ -49,7 +49,6 @@ struct flowi { | |||
| 49 | __u8 proto; | 49 | __u8 proto; |
| 50 | __u8 flags; | 50 | __u8 flags; |
| 51 | #define FLOWI_FLAG_ANYSRC 0x01 | 51 | #define FLOWI_FLAG_ANYSRC 0x01 |
| 52 | #define FLOWI_FLAG_MATCH_ANY_IIF 0x02 | ||
| 53 | union { | 52 | union { |
| 54 | struct { | 53 | struct { |
| 55 | __be16 sport; | 54 | __be16 sport; |
| @@ -67,6 +66,7 @@ struct flowi { | |||
| 67 | } dnports; | 66 | } dnports; |
| 68 | 67 | ||
| 69 | __be32 spi; | 68 | __be32 spi; |
| 69 | __be32 gre_key; | ||
| 70 | 70 | ||
| 71 | struct { | 71 | struct { |
| 72 | __u8 type; | 72 | __u8 type; |
| @@ -78,6 +78,7 @@ struct flowi { | |||
| 78 | #define fl_icmp_code uli_u.icmpt.code | 78 | #define fl_icmp_code uli_u.icmpt.code |
| 79 | #define fl_ipsec_spi uli_u.spi | 79 | #define fl_ipsec_spi uli_u.spi |
| 80 | #define fl_mh_type uli_u.mht.type | 80 | #define fl_mh_type uli_u.mht.type |
| 81 | #define fl_gre_key uli_u.gre_key | ||
| 81 | __u32 secid; /* used by xfrm; see secid.txt */ | 82 | __u32 secid; /* used by xfrm; see secid.txt */ |
| 82 | } __attribute__((__aligned__(BITS_PER_LONG/8))); | 83 | } __attribute__((__aligned__(BITS_PER_LONG/8))); |
| 83 | 84 | ||
diff --git a/include/net/if_inet6.h b/include/net/if_inet6.h index f95ff8d9aa47..04977eefb0ee 100644 --- a/include/net/if_inet6.h +++ b/include/net/if_inet6.h | |||
| @@ -89,10 +89,11 @@ struct ip6_sf_socklist { | |||
| 89 | struct ipv6_mc_socklist { | 89 | struct ipv6_mc_socklist { |
| 90 | struct in6_addr addr; | 90 | struct in6_addr addr; |
| 91 | int ifindex; | 91 | int ifindex; |
| 92 | struct ipv6_mc_socklist *next; | 92 | struct ipv6_mc_socklist __rcu *next; |
| 93 | rwlock_t sflock; | 93 | rwlock_t sflock; |
| 94 | unsigned int sfmode; /* MCAST_{INCLUDE,EXCLUDE} */ | 94 | unsigned int sfmode; /* MCAST_{INCLUDE,EXCLUDE} */ |
| 95 | struct ip6_sf_socklist *sflist; | 95 | struct ip6_sf_socklist *sflist; |
| 96 | struct rcu_head rcu; | ||
| 96 | }; | 97 | }; |
| 97 | 98 | ||
| 98 | struct ip6_sf_list { | 99 | struct ip6_sf_list { |
diff --git a/include/net/inet6_connection_sock.h b/include/net/inet6_connection_sock.h index aae08f686633..ff013505236b 100644 --- a/include/net/inet6_connection_sock.h +++ b/include/net/inet6_connection_sock.h | |||
| @@ -25,6 +25,9 @@ struct sockaddr; | |||
| 25 | extern int inet6_csk_bind_conflict(const struct sock *sk, | 25 | extern int inet6_csk_bind_conflict(const struct sock *sk, |
| 26 | const struct inet_bind_bucket *tb); | 26 | const struct inet_bind_bucket *tb); |
| 27 | 27 | ||
| 28 | extern struct dst_entry* inet6_csk_route_req(struct sock *sk, | ||
| 29 | const struct request_sock *req); | ||
| 30 | |||
| 28 | extern struct request_sock *inet6_csk_search_req(const struct sock *sk, | 31 | extern struct request_sock *inet6_csk_search_req(const struct sock *sk, |
| 29 | struct request_sock ***prevp, | 32 | struct request_sock ***prevp, |
| 30 | const __be16 rport, | 33 | const __be16 rport, |
diff --git a/include/net/inet_connection_sock.h b/include/net/inet_connection_sock.h index e4f494b42e06..6ac4e3b5007f 100644 --- a/include/net/inet_connection_sock.h +++ b/include/net/inet_connection_sock.h | |||
| @@ -43,7 +43,7 @@ struct inet_connection_sock_af_ops { | |||
| 43 | struct sock *(*syn_recv_sock)(struct sock *sk, struct sk_buff *skb, | 43 | struct sock *(*syn_recv_sock)(struct sock *sk, struct sk_buff *skb, |
| 44 | struct request_sock *req, | 44 | struct request_sock *req, |
| 45 | struct dst_entry *dst); | 45 | struct dst_entry *dst); |
| 46 | int (*remember_stamp)(struct sock *sk); | 46 | struct inet_peer *(*get_peer)(struct sock *sk, bool *release_it); |
| 47 | u16 net_header_len; | 47 | u16 net_header_len; |
| 48 | u16 sockaddr_len; | 48 | u16 sockaddr_len; |
| 49 | int (*setsockopt)(struct sock *sk, int level, int optname, | 49 | int (*setsockopt)(struct sock *sk, int level, int optname, |
| @@ -132,7 +132,6 @@ struct inet_connection_sock { | |||
| 132 | #define ICSK_TIME_RETRANS 1 /* Retransmit timer */ | 132 | #define ICSK_TIME_RETRANS 1 /* Retransmit timer */ |
| 133 | #define ICSK_TIME_DACK 2 /* Delayed ack timer */ | 133 | #define ICSK_TIME_DACK 2 /* Delayed ack timer */ |
| 134 | #define ICSK_TIME_PROBE0 3 /* Zero window probe timer */ | 134 | #define ICSK_TIME_PROBE0 3 /* Zero window probe timer */ |
| 135 | #define ICSK_TIME_KEEPOPEN 4 /* Keepalive timer */ | ||
| 136 | 135 | ||
| 137 | static inline struct inet_connection_sock *inet_csk(const struct sock *sk) | 136 | static inline struct inet_connection_sock *inet_csk(const struct sock *sk) |
| 138 | { | 137 | { |
diff --git a/include/net/inet_sock.h b/include/net/inet_sock.h index 1989cfd7405f..8181498fa96c 100644 --- a/include/net/inet_sock.h +++ b/include/net/inet_sock.h | |||
| @@ -116,8 +116,9 @@ struct inet_sock { | |||
| 116 | struct ipv6_pinfo *pinet6; | 116 | struct ipv6_pinfo *pinet6; |
| 117 | #endif | 117 | #endif |
| 118 | /* Socket demultiplex comparisons on incoming packets. */ | 118 | /* Socket demultiplex comparisons on incoming packets. */ |
| 119 | __be32 inet_daddr; | 119 | #define inet_daddr sk.__sk_common.skc_daddr |
| 120 | __be32 inet_rcv_saddr; | 120 | #define inet_rcv_saddr sk.__sk_common.skc_rcv_saddr |
| 121 | |||
| 121 | __be16 inet_dport; | 122 | __be16 inet_dport; |
| 122 | __u16 inet_num; | 123 | __u16 inet_num; |
| 123 | __be32 inet_saddr; | 124 | __be32 inet_saddr; |
| @@ -141,7 +142,7 @@ struct inet_sock { | |||
| 141 | nodefrag:1; | 142 | nodefrag:1; |
| 142 | int mc_index; | 143 | int mc_index; |
| 143 | __be32 mc_addr; | 144 | __be32 mc_addr; |
| 144 | struct ip_mc_socklist *mc_list; | 145 | struct ip_mc_socklist __rcu *mc_list; |
| 145 | struct { | 146 | struct { |
| 146 | unsigned int flags; | 147 | unsigned int flags; |
| 147 | unsigned int fragsize; | 148 | unsigned int fragsize; |
diff --git a/include/net/inet_timewait_sock.h b/include/net/inet_timewait_sock.h index a066fdd50da6..17404b5388a7 100644 --- a/include/net/inet_timewait_sock.h +++ b/include/net/inet_timewait_sock.h | |||
| @@ -88,12 +88,6 @@ extern void inet_twdr_hangman(unsigned long data); | |||
| 88 | extern void inet_twdr_twkill_work(struct work_struct *work); | 88 | extern void inet_twdr_twkill_work(struct work_struct *work); |
| 89 | extern void inet_twdr_twcal_tick(unsigned long data); | 89 | extern void inet_twdr_twcal_tick(unsigned long data); |
| 90 | 90 | ||
| 91 | #if (BITS_PER_LONG == 64) | ||
| 92 | #define INET_TIMEWAIT_ADDRCMP_ALIGN_BYTES 8 | ||
| 93 | #else | ||
| 94 | #define INET_TIMEWAIT_ADDRCMP_ALIGN_BYTES 4 | ||
| 95 | #endif | ||
| 96 | |||
| 97 | struct inet_bind_bucket; | 91 | struct inet_bind_bucket; |
| 98 | 92 | ||
| 99 | /* | 93 | /* |
| @@ -117,15 +111,15 @@ struct inet_timewait_sock { | |||
| 117 | #define tw_hash __tw_common.skc_hash | 111 | #define tw_hash __tw_common.skc_hash |
| 118 | #define tw_prot __tw_common.skc_prot | 112 | #define tw_prot __tw_common.skc_prot |
| 119 | #define tw_net __tw_common.skc_net | 113 | #define tw_net __tw_common.skc_net |
| 114 | #define tw_daddr __tw_common.skc_daddr | ||
| 115 | #define tw_rcv_saddr __tw_common.skc_rcv_saddr | ||
| 120 | int tw_timeout; | 116 | int tw_timeout; |
| 121 | volatile unsigned char tw_substate; | 117 | volatile unsigned char tw_substate; |
| 122 | /* 3 bits hole, try to pack */ | ||
| 123 | unsigned char tw_rcv_wscale; | 118 | unsigned char tw_rcv_wscale; |
| 119 | |||
| 124 | /* Socket demultiplex comparisons on incoming packets. */ | 120 | /* Socket demultiplex comparisons on incoming packets. */ |
| 125 | /* these five are in inet_sock */ | 121 | /* these three are in inet_sock */ |
| 126 | __be16 tw_sport; | 122 | __be16 tw_sport; |
| 127 | __be32 tw_daddr __attribute__((aligned(INET_TIMEWAIT_ADDRCMP_ALIGN_BYTES))); | ||
| 128 | __be32 tw_rcv_saddr; | ||
| 129 | __be16 tw_dport; | 123 | __be16 tw_dport; |
| 130 | __u16 tw_num; | 124 | __u16 tw_num; |
| 131 | kmemcheck_bitfield_begin(flags); | 125 | kmemcheck_bitfield_begin(flags); |
| @@ -191,10 +185,10 @@ static inline struct inet_timewait_sock *inet_twsk(const struct sock *sk) | |||
| 191 | return (struct inet_timewait_sock *)sk; | 185 | return (struct inet_timewait_sock *)sk; |
| 192 | } | 186 | } |
| 193 | 187 | ||
| 194 | static inline __be32 inet_rcv_saddr(const struct sock *sk) | 188 | static inline __be32 sk_rcv_saddr(const struct sock *sk) |
| 195 | { | 189 | { |
| 196 | return likely(sk->sk_state != TCP_TIME_WAIT) ? | 190 | /* both inet_sk() and inet_twsk() store rcv_saddr in skc_rcv_saddr */ |
| 197 | inet_sk(sk)->inet_rcv_saddr : inet_twsk(sk)->tw_rcv_saddr; | 191 | return sk->__sk_common.skc_rcv_saddr; |
| 198 | } | 192 | } |
| 199 | 193 | ||
| 200 | extern void inet_twsk_put(struct inet_timewait_sock *tw); | 194 | extern void inet_twsk_put(struct inet_timewait_sock *tw); |
diff --git a/include/net/inetpeer.h b/include/net/inetpeer.h index fe239bfe5f7f..599d96e74114 100644 --- a/include/net/inetpeer.h +++ b/include/net/inetpeer.h | |||
| @@ -11,12 +11,21 @@ | |||
| 11 | #include <linux/init.h> | 11 | #include <linux/init.h> |
| 12 | #include <linux/jiffies.h> | 12 | #include <linux/jiffies.h> |
| 13 | #include <linux/spinlock.h> | 13 | #include <linux/spinlock.h> |
| 14 | #include <net/ipv6.h> | ||
| 14 | #include <asm/atomic.h> | 15 | #include <asm/atomic.h> |
| 15 | 16 | ||
| 17 | struct inetpeer_addr { | ||
| 18 | union { | ||
| 19 | __be32 a4; | ||
| 20 | __be32 a6[4]; | ||
| 21 | }; | ||
| 22 | __u16 family; | ||
| 23 | }; | ||
| 24 | |||
| 16 | struct inet_peer { | 25 | struct inet_peer { |
| 17 | /* group together avl_left,avl_right,v4daddr to speedup lookups */ | 26 | /* group together avl_left,avl_right,v4daddr to speedup lookups */ |
| 18 | struct inet_peer __rcu *avl_left, *avl_right; | 27 | struct inet_peer __rcu *avl_left, *avl_right; |
| 19 | __be32 v4daddr; /* peer's address */ | 28 | struct inetpeer_addr daddr; |
| 20 | __u32 avl_height; | 29 | __u32 avl_height; |
| 21 | struct list_head unused; | 30 | struct list_head unused; |
| 22 | __u32 dtime; /* the time of last use of not | 31 | __u32 dtime; /* the time of last use of not |
| @@ -26,7 +35,6 @@ struct inet_peer { | |||
| 26 | * Once inet_peer is queued for deletion (refcnt == -1), following fields | 35 | * Once inet_peer is queued for deletion (refcnt == -1), following fields |
| 27 | * are not available: rid, ip_id_count, tcp_ts, tcp_ts_stamp | 36 | * are not available: rid, ip_id_count, tcp_ts, tcp_ts_stamp |
| 28 | * We can share memory with rcu_head to keep inet_peer small | 37 | * We can share memory with rcu_head to keep inet_peer small |
| 29 | * (less then 64 bytes) | ||
| 30 | */ | 38 | */ |
| 31 | union { | 39 | union { |
| 32 | struct { | 40 | struct { |
| @@ -42,7 +50,25 @@ struct inet_peer { | |||
| 42 | void inet_initpeers(void) __init; | 50 | void inet_initpeers(void) __init; |
| 43 | 51 | ||
| 44 | /* can be called with or without local BH being disabled */ | 52 | /* can be called with or without local BH being disabled */ |
| 45 | struct inet_peer *inet_getpeer(__be32 daddr, int create); | 53 | struct inet_peer *inet_getpeer(struct inetpeer_addr *daddr, int create); |
| 54 | |||
| 55 | static inline struct inet_peer *inet_getpeer_v4(__be32 v4daddr, int create) | ||
| 56 | { | ||
| 57 | struct inetpeer_addr daddr; | ||
| 58 | |||
| 59 | daddr.a4 = v4daddr; | ||
| 60 | daddr.family = AF_INET; | ||
| 61 | return inet_getpeer(&daddr, create); | ||
| 62 | } | ||
| 63 | |||
| 64 | static inline struct inet_peer *inet_getpeer_v6(struct in6_addr *v6daddr, int create) | ||
| 65 | { | ||
| 66 | struct inetpeer_addr daddr; | ||
| 67 | |||
| 68 | ipv6_addr_copy((struct in6_addr *)daddr.a6, v6daddr); | ||
| 69 | daddr.family = AF_INET6; | ||
| 70 | return inet_getpeer(&daddr, create); | ||
| 71 | } | ||
| 46 | 72 | ||
| 47 | /* can be called from BH context or outside */ | 73 | /* can be called from BH context or outside */ |
| 48 | extern void inet_putpeer(struct inet_peer *p); | 74 | extern void inet_putpeer(struct inet_peer *p); |
diff --git a/include/net/ip.h b/include/net/ip.h index 86e2b182a0c0..67fac78a186b 100644 --- a/include/net/ip.h +++ b/include/net/ip.h | |||
| @@ -201,7 +201,6 @@ static inline int inet_is_reserved_local_port(int port) | |||
| 201 | return test_bit(port, sysctl_local_reserved_ports); | 201 | return test_bit(port, sysctl_local_reserved_ports); |
| 202 | } | 202 | } |
| 203 | 203 | ||
| 204 | extern int sysctl_ip_default_ttl; | ||
| 205 | extern int sysctl_ip_nonlocal_bind; | 204 | extern int sysctl_ip_nonlocal_bind; |
| 206 | 205 | ||
| 207 | extern struct ctl_path net_core_path[]; | 206 | extern struct ctl_path net_core_path[]; |
| @@ -428,15 +427,6 @@ extern void ip_icmp_error(struct sock *sk, struct sk_buff *skb, int err, | |||
| 428 | extern void ip_local_error(struct sock *sk, int err, __be32 daddr, __be16 dport, | 427 | extern void ip_local_error(struct sock *sk, int err, __be32 daddr, __be16 dport, |
| 429 | u32 info); | 428 | u32 info); |
| 430 | 429 | ||
| 431 | /* sysctl helpers - any sysctl which holds a value that ends up being | ||
| 432 | * fed into the routing cache should use these handlers. | ||
| 433 | */ | ||
| 434 | int ipv4_doint_and_flush(ctl_table *ctl, int write, | ||
| 435 | void __user *buffer, | ||
| 436 | size_t *lenp, loff_t *ppos); | ||
| 437 | int ipv4_doint_and_flush_strategy(ctl_table *table, | ||
| 438 | void __user *oldval, size_t __user *oldlenp, | ||
| 439 | void __user *newval, size_t newlen); | ||
| 440 | #ifdef CONFIG_PROC_FS | 430 | #ifdef CONFIG_PROC_FS |
| 441 | extern int ip_misc_proc_init(void); | 431 | extern int ip_misc_proc_init(void); |
| 442 | #endif | 432 | #endif |
diff --git a/include/net/ip6_fib.h b/include/net/ip6_fib.h index 062a823d311c..708ff7cb8806 100644 --- a/include/net/ip6_fib.h +++ b/include/net/ip6_fib.h | |||
| @@ -21,6 +21,7 @@ | |||
| 21 | #include <net/dst.h> | 21 | #include <net/dst.h> |
| 22 | #include <net/flow.h> | 22 | #include <net/flow.h> |
| 23 | #include <net/netlink.h> | 23 | #include <net/netlink.h> |
| 24 | #include <net/inetpeer.h> | ||
| 24 | 25 | ||
| 25 | #ifdef CONFIG_IPV6_MULTIPLE_TABLES | 26 | #ifdef CONFIG_IPV6_MULTIPLE_TABLES |
| 26 | #define FIB6_TABLE_HASHSZ 256 | 27 | #define FIB6_TABLE_HASHSZ 256 |
| @@ -109,6 +110,7 @@ struct rt6_info { | |||
| 109 | u32 rt6i_metric; | 110 | u32 rt6i_metric; |
| 110 | 111 | ||
| 111 | struct inet6_dev *rt6i_idev; | 112 | struct inet6_dev *rt6i_idev; |
| 113 | struct inet_peer *rt6i_peer; | ||
| 112 | 114 | ||
| 113 | #ifdef CONFIG_XFRM | 115 | #ifdef CONFIG_XFRM |
| 114 | u32 rt6i_flow_cache_genid; | 116 | u32 rt6i_flow_cache_genid; |
diff --git a/include/net/ip6_route.h b/include/net/ip6_route.h index 278312c95f96..8552f0a2e854 100644 --- a/include/net/ip6_route.h +++ b/include/net/ip6_route.h | |||
| @@ -3,7 +3,6 @@ | |||
| 3 | 3 | ||
| 4 | #define IP6_RT_PRIO_USER 1024 | 4 | #define IP6_RT_PRIO_USER 1024 |
| 5 | #define IP6_RT_PRIO_ADDRCONF 256 | 5 | #define IP6_RT_PRIO_ADDRCONF 256 |
| 6 | #define IP6_RT_PRIO_KERN 512 | ||
| 7 | 6 | ||
| 8 | struct route_info { | 7 | struct route_info { |
| 9 | __u8 type; | 8 | __u8 type; |
| @@ -56,6 +55,18 @@ static inline unsigned int rt6_flags2srcprefs(int flags) | |||
| 56 | return (flags >> 3) & 7; | 55 | return (flags >> 3) & 7; |
| 57 | } | 56 | } |
| 58 | 57 | ||
| 58 | extern void rt6_bind_peer(struct rt6_info *rt, | ||
| 59 | int create); | ||
| 60 | |||
| 61 | static inline struct inet_peer *rt6_get_peer(struct rt6_info *rt) | ||
| 62 | { | ||
| 63 | if (rt->rt6i_peer) | ||
| 64 | return rt->rt6i_peer; | ||
| 65 | |||
| 66 | rt6_bind_peer(rt, 0); | ||
| 67 | return rt->rt6i_peer; | ||
| 68 | } | ||
| 69 | |||
| 59 | extern void ip6_route_input(struct sk_buff *skb); | 70 | extern void ip6_route_input(struct sk_buff *skb); |
| 60 | 71 | ||
| 61 | extern struct dst_entry * ip6_route_output(struct net *net, | 72 | extern struct dst_entry * ip6_route_output(struct net *net, |
| @@ -164,5 +175,15 @@ static inline int ipv6_unicast_destination(struct sk_buff *skb) | |||
| 164 | return rt->rt6i_flags & RTF_LOCAL; | 175 | return rt->rt6i_flags & RTF_LOCAL; |
| 165 | } | 176 | } |
| 166 | 177 | ||
| 178 | int ip6_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *)); | ||
| 179 | |||
| 180 | static inline int ip6_skb_dst_mtu(struct sk_buff *skb) | ||
| 181 | { | ||
| 182 | struct ipv6_pinfo *np = skb->sk ? inet6_sk(skb->sk) : NULL; | ||
| 183 | |||
| 184 | return (np && np->pmtudisc == IPV6_PMTUDISC_PROBE) ? | ||
| 185 | skb_dst(skb)->dev->mtu : dst_mtu(skb_dst(skb)); | ||
| 186 | } | ||
| 187 | |||
| 167 | #endif | 188 | #endif |
| 168 | #endif | 189 | #endif |
diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h index d858264217ba..b23bea62f708 100644 --- a/include/net/ip_vs.h +++ b/include/net/ip_vs.h | |||
| @@ -28,6 +28,80 @@ | |||
| 28 | #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) | 28 | #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) |
| 29 | #include <net/netfilter/nf_conntrack.h> | 29 | #include <net/netfilter/nf_conntrack.h> |
| 30 | #endif | 30 | #endif |
| 31 | #include <net/net_namespace.h> /* Netw namespace */ | ||
| 32 | |||
| 33 | /* | ||
| 34 | * Generic access of ipvs struct | ||
| 35 | */ | ||
| 36 | static inline struct netns_ipvs *net_ipvs(struct net* net) | ||
| 37 | { | ||
| 38 | return net->ipvs; | ||
| 39 | } | ||
| 40 | /* | ||
| 41 | * Get net ptr from skb in traffic cases | ||
| 42 | * use skb_sknet when call is from userland (ioctl or netlink) | ||
| 43 | */ | ||
| 44 | static inline struct net *skb_net(const struct sk_buff *skb) | ||
| 45 | { | ||
| 46 | #ifdef CONFIG_NET_NS | ||
| 47 | #ifdef CONFIG_IP_VS_DEBUG | ||
| 48 | /* | ||
| 49 | * This is used for debug only. | ||
| 50 | * Start with the most likely hit | ||
| 51 | * End with BUG | ||
| 52 | */ | ||
| 53 | if (likely(skb->dev && skb->dev->nd_net)) | ||
| 54 | return dev_net(skb->dev); | ||
| 55 | if (skb_dst(skb)->dev) | ||
| 56 | return dev_net(skb_dst(skb)->dev); | ||
| 57 | WARN(skb->sk, "Maybe skb_sknet should be used in %s() at line:%d\n", | ||
| 58 | __func__, __LINE__); | ||
| 59 | if (likely(skb->sk && skb->sk->sk_net)) | ||
| 60 | return sock_net(skb->sk); | ||
| 61 | pr_err("There is no net ptr to find in the skb in %s() line:%d\n", | ||
| 62 | __func__, __LINE__); | ||
| 63 | BUG(); | ||
| 64 | #else | ||
| 65 | return dev_net(skb->dev ? : skb_dst(skb)->dev); | ||
| 66 | #endif | ||
| 67 | #else | ||
| 68 | return &init_net; | ||
| 69 | #endif | ||
| 70 | } | ||
| 71 | |||
| 72 | static inline struct net *skb_sknet(const struct sk_buff *skb) | ||
| 73 | { | ||
| 74 | #ifdef CONFIG_NET_NS | ||
| 75 | #ifdef CONFIG_IP_VS_DEBUG | ||
| 76 | /* Start with the most likely hit */ | ||
| 77 | if (likely(skb->sk && skb->sk->sk_net)) | ||
| 78 | return sock_net(skb->sk); | ||
| 79 | WARN(skb->dev, "Maybe skb_net should be used instead in %s() line:%d\n", | ||
| 80 | __func__, __LINE__); | ||
| 81 | if (likely(skb->dev && skb->dev->nd_net)) | ||
| 82 | return dev_net(skb->dev); | ||
| 83 | pr_err("There is no net ptr to find in the skb in %s() line:%d\n", | ||
| 84 | __func__, __LINE__); | ||
| 85 | BUG(); | ||
| 86 | #else | ||
| 87 | return sock_net(skb->sk); | ||
| 88 | #endif | ||
| 89 | #else | ||
| 90 | return &init_net; | ||
| 91 | #endif | ||
| 92 | } | ||
| 93 | /* | ||
| 94 | * This one needed for single_open_net since net is stored directly in | ||
| 95 | * private not as a struct i.e. seq_file_net cant be used. | ||
| 96 | */ | ||
| 97 | static inline struct net *seq_file_single_net(struct seq_file *seq) | ||
| 98 | { | ||
| 99 | #ifdef CONFIG_NET_NS | ||
| 100 | return (struct net *)seq->private; | ||
| 101 | #else | ||
| 102 | return &init_net; | ||
| 103 | #endif | ||
| 104 | } | ||
| 31 | 105 | ||
| 32 | /* Connections' size value needed by ip_vs_ctl.c */ | 106 | /* Connections' size value needed by ip_vs_ctl.c */ |
| 33 | extern int ip_vs_conn_tab_size; | 107 | extern int ip_vs_conn_tab_size; |
| @@ -258,6 +332,23 @@ struct ip_vs_seq { | |||
| 258 | before last resized pkt */ | 332 | before last resized pkt */ |
| 259 | }; | 333 | }; |
| 260 | 334 | ||
| 335 | /* | ||
| 336 | * counters per cpu | ||
| 337 | */ | ||
| 338 | struct ip_vs_counters { | ||
| 339 | __u32 conns; /* connections scheduled */ | ||
| 340 | __u32 inpkts; /* incoming packets */ | ||
| 341 | __u32 outpkts; /* outgoing packets */ | ||
| 342 | __u64 inbytes; /* incoming bytes */ | ||
| 343 | __u64 outbytes; /* outgoing bytes */ | ||
| 344 | }; | ||
| 345 | /* | ||
| 346 | * Stats per cpu | ||
| 347 | */ | ||
| 348 | struct ip_vs_cpu_stats { | ||
| 349 | struct ip_vs_counters ustats; | ||
| 350 | struct u64_stats_sync syncp; | ||
| 351 | }; | ||
| 261 | 352 | ||
| 262 | /* | 353 | /* |
| 263 | * IPVS statistics objects | 354 | * IPVS statistics objects |
| @@ -279,17 +370,34 @@ struct ip_vs_estimator { | |||
| 279 | }; | 370 | }; |
| 280 | 371 | ||
| 281 | struct ip_vs_stats { | 372 | struct ip_vs_stats { |
| 282 | struct ip_vs_stats_user ustats; /* statistics */ | 373 | struct ip_vs_stats_user ustats; /* statistics */ |
| 283 | struct ip_vs_estimator est; /* estimator */ | 374 | struct ip_vs_estimator est; /* estimator */ |
| 284 | 375 | struct ip_vs_cpu_stats *cpustats; /* per cpu counters */ | |
| 285 | spinlock_t lock; /* spin lock */ | 376 | spinlock_t lock; /* spin lock */ |
| 286 | }; | 377 | }; |
| 287 | 378 | ||
| 379 | /* | ||
| 380 | * Helper Macros for per cpu | ||
| 381 | * ipvs->tot_stats->ustats.count | ||
| 382 | */ | ||
| 383 | #define IPVS_STAT_INC(ipvs, count) \ | ||
| 384 | __this_cpu_inc((ipvs)->ustats->count) | ||
| 385 | |||
| 386 | #define IPVS_STAT_ADD(ipvs, count, value) \ | ||
| 387 | do {\ | ||
| 388 | write_seqcount_begin(per_cpu_ptr((ipvs)->ustats_seq, \ | ||
| 389 | raw_smp_processor_id())); \ | ||
| 390 | __this_cpu_add((ipvs)->ustats->count, value); \ | ||
| 391 | write_seqcount_end(per_cpu_ptr((ipvs)->ustats_seq, \ | ||
| 392 | raw_smp_processor_id())); \ | ||
| 393 | } while (0) | ||
| 394 | |||
| 288 | struct dst_entry; | 395 | struct dst_entry; |
| 289 | struct iphdr; | 396 | struct iphdr; |
| 290 | struct ip_vs_conn; | 397 | struct ip_vs_conn; |
| 291 | struct ip_vs_app; | 398 | struct ip_vs_app; |
| 292 | struct sk_buff; | 399 | struct sk_buff; |
| 400 | struct ip_vs_proto_data; | ||
| 293 | 401 | ||
| 294 | struct ip_vs_protocol { | 402 | struct ip_vs_protocol { |
| 295 | struct ip_vs_protocol *next; | 403 | struct ip_vs_protocol *next; |
| @@ -297,21 +405,22 @@ struct ip_vs_protocol { | |||
| 297 | u16 protocol; | 405 | u16 protocol; |
| 298 | u16 num_states; | 406 | u16 num_states; |
| 299 | int dont_defrag; | 407 | int dont_defrag; |
| 300 | atomic_t appcnt; /* counter of proto app incs */ | ||
| 301 | int *timeout_table; /* protocol timeout table */ | ||
| 302 | 408 | ||
| 303 | void (*init)(struct ip_vs_protocol *pp); | 409 | void (*init)(struct ip_vs_protocol *pp); |
| 304 | 410 | ||
| 305 | void (*exit)(struct ip_vs_protocol *pp); | 411 | void (*exit)(struct ip_vs_protocol *pp); |
| 306 | 412 | ||
| 413 | void (*init_netns)(struct net *net, struct ip_vs_proto_data *pd); | ||
| 414 | |||
| 415 | void (*exit_netns)(struct net *net, struct ip_vs_proto_data *pd); | ||
| 416 | |||
| 307 | int (*conn_schedule)(int af, struct sk_buff *skb, | 417 | int (*conn_schedule)(int af, struct sk_buff *skb, |
| 308 | struct ip_vs_protocol *pp, | 418 | struct ip_vs_proto_data *pd, |
| 309 | int *verdict, struct ip_vs_conn **cpp); | 419 | int *verdict, struct ip_vs_conn **cpp); |
| 310 | 420 | ||
| 311 | struct ip_vs_conn * | 421 | struct ip_vs_conn * |
| 312 | (*conn_in_get)(int af, | 422 | (*conn_in_get)(int af, |
| 313 | const struct sk_buff *skb, | 423 | const struct sk_buff *skb, |
| 314 | struct ip_vs_protocol *pp, | ||
| 315 | const struct ip_vs_iphdr *iph, | 424 | const struct ip_vs_iphdr *iph, |
| 316 | unsigned int proto_off, | 425 | unsigned int proto_off, |
| 317 | int inverse); | 426 | int inverse); |
| @@ -319,7 +428,6 @@ struct ip_vs_protocol { | |||
| 319 | struct ip_vs_conn * | 428 | struct ip_vs_conn * |
| 320 | (*conn_out_get)(int af, | 429 | (*conn_out_get)(int af, |
| 321 | const struct sk_buff *skb, | 430 | const struct sk_buff *skb, |
| 322 | struct ip_vs_protocol *pp, | ||
| 323 | const struct ip_vs_iphdr *iph, | 431 | const struct ip_vs_iphdr *iph, |
| 324 | unsigned int proto_off, | 432 | unsigned int proto_off, |
| 325 | int inverse); | 433 | int inverse); |
| @@ -337,11 +445,11 @@ struct ip_vs_protocol { | |||
| 337 | 445 | ||
| 338 | int (*state_transition)(struct ip_vs_conn *cp, int direction, | 446 | int (*state_transition)(struct ip_vs_conn *cp, int direction, |
| 339 | const struct sk_buff *skb, | 447 | const struct sk_buff *skb, |
| 340 | struct ip_vs_protocol *pp); | 448 | struct ip_vs_proto_data *pd); |
| 341 | 449 | ||
| 342 | int (*register_app)(struct ip_vs_app *inc); | 450 | int (*register_app)(struct net *net, struct ip_vs_app *inc); |
| 343 | 451 | ||
| 344 | void (*unregister_app)(struct ip_vs_app *inc); | 452 | void (*unregister_app)(struct net *net, struct ip_vs_app *inc); |
| 345 | 453 | ||
| 346 | int (*app_conn_bind)(struct ip_vs_conn *cp); | 454 | int (*app_conn_bind)(struct ip_vs_conn *cp); |
| 347 | 455 | ||
| @@ -350,14 +458,26 @@ struct ip_vs_protocol { | |||
| 350 | int offset, | 458 | int offset, |
| 351 | const char *msg); | 459 | const char *msg); |
| 352 | 460 | ||
| 353 | void (*timeout_change)(struct ip_vs_protocol *pp, int flags); | 461 | void (*timeout_change)(struct ip_vs_proto_data *pd, int flags); |
| 462 | }; | ||
| 354 | 463 | ||
| 355 | int (*set_state_timeout)(struct ip_vs_protocol *pp, char *sname, int to); | 464 | /* |
| 465 | * protocol data per netns | ||
| 466 | */ | ||
| 467 | struct ip_vs_proto_data { | ||
| 468 | struct ip_vs_proto_data *next; | ||
| 469 | struct ip_vs_protocol *pp; | ||
| 470 | int *timeout_table; /* protocol timeout table */ | ||
| 471 | atomic_t appcnt; /* counter of proto app incs. */ | ||
| 472 | struct tcp_states_t *tcp_state_table; | ||
| 356 | }; | 473 | }; |
| 357 | 474 | ||
| 358 | extern struct ip_vs_protocol * ip_vs_proto_get(unsigned short proto); | 475 | extern struct ip_vs_protocol *ip_vs_proto_get(unsigned short proto); |
| 476 | extern struct ip_vs_proto_data *ip_vs_proto_data_get(struct net *net, | ||
| 477 | unsigned short proto); | ||
| 359 | 478 | ||
| 360 | struct ip_vs_conn_param { | 479 | struct ip_vs_conn_param { |
| 480 | struct net *net; | ||
| 361 | const union nf_inet_addr *caddr; | 481 | const union nf_inet_addr *caddr; |
| 362 | const union nf_inet_addr *vaddr; | 482 | const union nf_inet_addr *vaddr; |
| 363 | __be16 cport; | 483 | __be16 cport; |
| @@ -375,17 +495,19 @@ struct ip_vs_conn_param { | |||
| 375 | */ | 495 | */ |
| 376 | struct ip_vs_conn { | 496 | struct ip_vs_conn { |
| 377 | struct list_head c_list; /* hashed list heads */ | 497 | struct list_head c_list; /* hashed list heads */ |
| 378 | 498 | #ifdef CONFIG_NET_NS | |
| 499 | struct net *net; /* Name space */ | ||
| 500 | #endif | ||
| 379 | /* Protocol, addresses and port numbers */ | 501 | /* Protocol, addresses and port numbers */ |
| 380 | u16 af; /* address family */ | 502 | u16 af; /* address family */ |
| 381 | union nf_inet_addr caddr; /* client address */ | 503 | __be16 cport; |
| 382 | union nf_inet_addr vaddr; /* virtual address */ | 504 | __be16 vport; |
| 383 | union nf_inet_addr daddr; /* destination address */ | 505 | __be16 dport; |
| 384 | volatile __u32 flags; /* status flags */ | 506 | __u32 fwmark; /* Fire wall mark from skb */ |
| 385 | __u32 fwmark; /* Fire wall mark from skb */ | 507 | union nf_inet_addr caddr; /* client address */ |
| 386 | __be16 cport; | 508 | union nf_inet_addr vaddr; /* virtual address */ |
| 387 | __be16 vport; | 509 | union nf_inet_addr daddr; /* destination address */ |
| 388 | __be16 dport; | 510 | volatile __u32 flags; /* status flags */ |
| 389 | __u16 protocol; /* Which protocol (TCP/UDP) */ | 511 | __u16 protocol; /* Which protocol (TCP/UDP) */ |
| 390 | 512 | ||
| 391 | /* counter and timer */ | 513 | /* counter and timer */ |
| @@ -428,6 +550,33 @@ struct ip_vs_conn { | |||
| 428 | __u8 pe_data_len; | 550 | __u8 pe_data_len; |
| 429 | }; | 551 | }; |
| 430 | 552 | ||
| 553 | /* | ||
| 554 | * To save some memory in conn table when name space is disabled. | ||
| 555 | */ | ||
| 556 | static inline struct net *ip_vs_conn_net(const struct ip_vs_conn *cp) | ||
| 557 | { | ||
| 558 | #ifdef CONFIG_NET_NS | ||
| 559 | return cp->net; | ||
| 560 | #else | ||
| 561 | return &init_net; | ||
| 562 | #endif | ||
| 563 | } | ||
| 564 | static inline void ip_vs_conn_net_set(struct ip_vs_conn *cp, struct net *net) | ||
| 565 | { | ||
| 566 | #ifdef CONFIG_NET_NS | ||
| 567 | cp->net = net; | ||
| 568 | #endif | ||
| 569 | } | ||
| 570 | |||
| 571 | static inline int ip_vs_conn_net_eq(const struct ip_vs_conn *cp, | ||
| 572 | struct net *net) | ||
| 573 | { | ||
| 574 | #ifdef CONFIG_NET_NS | ||
| 575 | return cp->net == net; | ||
| 576 | #else | ||
| 577 | return 1; | ||
| 578 | #endif | ||
| 579 | } | ||
| 431 | 580 | ||
| 432 | /* | 581 | /* |
| 433 | * Extended internal versions of struct ip_vs_service_user and | 582 | * Extended internal versions of struct ip_vs_service_user and |
| @@ -487,6 +636,7 @@ struct ip_vs_service { | |||
| 487 | unsigned flags; /* service status flags */ | 636 | unsigned flags; /* service status flags */ |
| 488 | unsigned timeout; /* persistent timeout in ticks */ | 637 | unsigned timeout; /* persistent timeout in ticks */ |
| 489 | __be32 netmask; /* grouping granularity */ | 638 | __be32 netmask; /* grouping granularity */ |
| 639 | struct net *net; | ||
| 490 | 640 | ||
| 491 | struct list_head destinations; /* real server d-linked list */ | 641 | struct list_head destinations; /* real server d-linked list */ |
| 492 | __u32 num_dests; /* number of servers */ | 642 | __u32 num_dests; /* number of servers */ |
| @@ -512,8 +662,8 @@ struct ip_vs_dest { | |||
| 512 | struct list_head d_list; /* for table with all the dests */ | 662 | struct list_head d_list; /* for table with all the dests */ |
| 513 | 663 | ||
| 514 | u16 af; /* address family */ | 664 | u16 af; /* address family */ |
| 515 | union nf_inet_addr addr; /* IP address of the server */ | ||
| 516 | __be16 port; /* port number of the server */ | 665 | __be16 port; /* port number of the server */ |
| 666 | union nf_inet_addr addr; /* IP address of the server */ | ||
| 517 | volatile unsigned flags; /* dest status flags */ | 667 | volatile unsigned flags; /* dest status flags */ |
| 518 | atomic_t conn_flags; /* flags to copy to conn */ | 668 | atomic_t conn_flags; /* flags to copy to conn */ |
| 519 | atomic_t weight; /* server weight */ | 669 | atomic_t weight; /* server weight */ |
| @@ -540,8 +690,8 @@ struct ip_vs_dest { | |||
| 540 | /* for virtual service */ | 690 | /* for virtual service */ |
| 541 | struct ip_vs_service *svc; /* service it belongs to */ | 691 | struct ip_vs_service *svc; /* service it belongs to */ |
| 542 | __u16 protocol; /* which protocol (TCP/UDP) */ | 692 | __u16 protocol; /* which protocol (TCP/UDP) */ |
| 543 | union nf_inet_addr vaddr; /* virtual IP address */ | ||
| 544 | __be16 vport; /* virtual port number */ | 693 | __be16 vport; /* virtual port number */ |
| 694 | union nf_inet_addr vaddr; /* virtual IP address */ | ||
| 545 | __u32 vfwmark; /* firewall mark of service */ | 695 | __u32 vfwmark; /* firewall mark of service */ |
| 546 | }; | 696 | }; |
| 547 | 697 | ||
| @@ -676,13 +826,14 @@ enum { | |||
| 676 | IP_VS_DIR_LAST, | 826 | IP_VS_DIR_LAST, |
| 677 | }; | 827 | }; |
| 678 | 828 | ||
| 679 | static inline void ip_vs_conn_fill_param(int af, int protocol, | 829 | static inline void ip_vs_conn_fill_param(struct net *net, int af, int protocol, |
| 680 | const union nf_inet_addr *caddr, | 830 | const union nf_inet_addr *caddr, |
| 681 | __be16 cport, | 831 | __be16 cport, |
| 682 | const union nf_inet_addr *vaddr, | 832 | const union nf_inet_addr *vaddr, |
| 683 | __be16 vport, | 833 | __be16 vport, |
| 684 | struct ip_vs_conn_param *p) | 834 | struct ip_vs_conn_param *p) |
| 685 | { | 835 | { |
| 836 | p->net = net; | ||
| 686 | p->af = af; | 837 | p->af = af; |
| 687 | p->protocol = protocol; | 838 | p->protocol = protocol; |
| 688 | p->caddr = caddr; | 839 | p->caddr = caddr; |
| @@ -697,7 +848,6 @@ struct ip_vs_conn *ip_vs_conn_in_get(const struct ip_vs_conn_param *p); | |||
| 697 | struct ip_vs_conn *ip_vs_ct_in_get(const struct ip_vs_conn_param *p); | 848 | struct ip_vs_conn *ip_vs_ct_in_get(const struct ip_vs_conn_param *p); |
| 698 | 849 | ||
| 699 | struct ip_vs_conn * ip_vs_conn_in_get_proto(int af, const struct sk_buff *skb, | 850 | struct ip_vs_conn * ip_vs_conn_in_get_proto(int af, const struct sk_buff *skb, |
| 700 | struct ip_vs_protocol *pp, | ||
| 701 | const struct ip_vs_iphdr *iph, | 851 | const struct ip_vs_iphdr *iph, |
| 702 | unsigned int proto_off, | 852 | unsigned int proto_off, |
| 703 | int inverse); | 853 | int inverse); |
| @@ -705,7 +855,6 @@ struct ip_vs_conn * ip_vs_conn_in_get_proto(int af, const struct sk_buff *skb, | |||
| 705 | struct ip_vs_conn *ip_vs_conn_out_get(const struct ip_vs_conn_param *p); | 855 | struct ip_vs_conn *ip_vs_conn_out_get(const struct ip_vs_conn_param *p); |
| 706 | 856 | ||
| 707 | struct ip_vs_conn * ip_vs_conn_out_get_proto(int af, const struct sk_buff *skb, | 857 | struct ip_vs_conn * ip_vs_conn_out_get_proto(int af, const struct sk_buff *skb, |
| 708 | struct ip_vs_protocol *pp, | ||
| 709 | const struct ip_vs_iphdr *iph, | 858 | const struct ip_vs_iphdr *iph, |
| 710 | unsigned int proto_off, | 859 | unsigned int proto_off, |
| 711 | int inverse); | 860 | int inverse); |
| @@ -726,9 +875,9 @@ extern void ip_vs_conn_expire_now(struct ip_vs_conn *cp); | |||
| 726 | 875 | ||
| 727 | extern const char * ip_vs_state_name(__u16 proto, int state); | 876 | extern const char * ip_vs_state_name(__u16 proto, int state); |
| 728 | 877 | ||
| 729 | extern void ip_vs_tcp_conn_listen(struct ip_vs_conn *cp); | 878 | extern void ip_vs_tcp_conn_listen(struct net *net, struct ip_vs_conn *cp); |
| 730 | extern int ip_vs_check_template(struct ip_vs_conn *ct); | 879 | extern int ip_vs_check_template(struct ip_vs_conn *ct); |
| 731 | extern void ip_vs_random_dropentry(void); | 880 | extern void ip_vs_random_dropentry(struct net *net); |
| 732 | extern int ip_vs_conn_init(void); | 881 | extern int ip_vs_conn_init(void); |
| 733 | extern void ip_vs_conn_cleanup(void); | 882 | extern void ip_vs_conn_cleanup(void); |
| 734 | 883 | ||
| @@ -798,12 +947,12 @@ ip_vs_control_add(struct ip_vs_conn *cp, struct ip_vs_conn *ctl_cp) | |||
| 798 | * (from ip_vs_app.c) | 947 | * (from ip_vs_app.c) |
| 799 | */ | 948 | */ |
| 800 | #define IP_VS_APP_MAX_PORTS 8 | 949 | #define IP_VS_APP_MAX_PORTS 8 |
| 801 | extern int register_ip_vs_app(struct ip_vs_app *app); | 950 | extern int register_ip_vs_app(struct net *net, struct ip_vs_app *app); |
| 802 | extern void unregister_ip_vs_app(struct ip_vs_app *app); | 951 | extern void unregister_ip_vs_app(struct net *net, struct ip_vs_app *app); |
| 803 | extern int ip_vs_bind_app(struct ip_vs_conn *cp, struct ip_vs_protocol *pp); | 952 | extern int ip_vs_bind_app(struct ip_vs_conn *cp, struct ip_vs_protocol *pp); |
| 804 | extern void ip_vs_unbind_app(struct ip_vs_conn *cp); | 953 | extern void ip_vs_unbind_app(struct ip_vs_conn *cp); |
| 805 | extern int | 954 | extern int register_ip_vs_app_inc(struct net *net, struct ip_vs_app *app, |
| 806 | register_ip_vs_app_inc(struct ip_vs_app *app, __u16 proto, __u16 port); | 955 | __u16 proto, __u16 port); |
| 807 | extern int ip_vs_app_inc_get(struct ip_vs_app *inc); | 956 | extern int ip_vs_app_inc_get(struct ip_vs_app *inc); |
| 808 | extern void ip_vs_app_inc_put(struct ip_vs_app *inc); | 957 | extern void ip_vs_app_inc_put(struct ip_vs_app *inc); |
| 809 | 958 | ||
| @@ -836,7 +985,7 @@ static inline void ip_vs_pe_put(const struct ip_vs_pe *pe) | |||
| 836 | */ | 985 | */ |
| 837 | extern int ip_vs_protocol_init(void); | 986 | extern int ip_vs_protocol_init(void); |
| 838 | extern void ip_vs_protocol_cleanup(void); | 987 | extern void ip_vs_protocol_cleanup(void); |
| 839 | extern void ip_vs_protocol_timeout_change(int flags); | 988 | extern void ip_vs_protocol_timeout_change(struct netns_ipvs *ipvs, int flags); |
| 840 | extern int *ip_vs_create_timeout_table(int *table, int size); | 989 | extern int *ip_vs_create_timeout_table(int *table, int size); |
| 841 | extern int | 990 | extern int |
| 842 | ip_vs_set_state_timeout(int *table, int num, const char *const *names, | 991 | ip_vs_set_state_timeout(int *table, int num, const char *const *names, |
| @@ -866,28 +1015,21 @@ extern struct ip_vs_scheduler *ip_vs_scheduler_get(const char *sched_name); | |||
| 866 | extern void ip_vs_scheduler_put(struct ip_vs_scheduler *scheduler); | 1015 | extern void ip_vs_scheduler_put(struct ip_vs_scheduler *scheduler); |
| 867 | extern struct ip_vs_conn * | 1016 | extern struct ip_vs_conn * |
| 868 | ip_vs_schedule(struct ip_vs_service *svc, struct sk_buff *skb, | 1017 | ip_vs_schedule(struct ip_vs_service *svc, struct sk_buff *skb, |
| 869 | struct ip_vs_protocol *pp, int *ignored); | 1018 | struct ip_vs_proto_data *pd, int *ignored); |
| 870 | extern int ip_vs_leave(struct ip_vs_service *svc, struct sk_buff *skb, | 1019 | extern int ip_vs_leave(struct ip_vs_service *svc, struct sk_buff *skb, |
| 871 | struct ip_vs_protocol *pp); | 1020 | struct ip_vs_proto_data *pd); |
| 872 | 1021 | ||
| 873 | 1022 | ||
| 874 | /* | 1023 | /* |
| 875 | * IPVS control data and functions (from ip_vs_ctl.c) | 1024 | * IPVS control data and functions (from ip_vs_ctl.c) |
| 876 | */ | 1025 | */ |
| 877 | extern int sysctl_ip_vs_cache_bypass; | ||
| 878 | extern int sysctl_ip_vs_expire_nodest_conn; | ||
| 879 | extern int sysctl_ip_vs_expire_quiescent_template; | ||
| 880 | extern int sysctl_ip_vs_sync_threshold[2]; | ||
| 881 | extern int sysctl_ip_vs_nat_icmp_send; | ||
| 882 | extern int sysctl_ip_vs_conntrack; | ||
| 883 | extern int sysctl_ip_vs_snat_reroute; | ||
| 884 | extern struct ip_vs_stats ip_vs_stats; | 1026 | extern struct ip_vs_stats ip_vs_stats; |
| 885 | extern const struct ctl_path net_vs_ctl_path[]; | 1027 | extern const struct ctl_path net_vs_ctl_path[]; |
| 886 | extern int sysctl_ip_vs_sync_ver; | 1028 | extern int sysctl_ip_vs_sync_ver; |
| 887 | 1029 | ||
| 888 | extern void ip_vs_sync_switch_mode(int mode); | 1030 | extern void ip_vs_sync_switch_mode(struct net *net, int mode); |
| 889 | extern struct ip_vs_service * | 1031 | extern struct ip_vs_service * |
| 890 | ip_vs_service_get(int af, __u32 fwmark, __u16 protocol, | 1032 | ip_vs_service_get(struct net *net, int af, __u32 fwmark, __u16 protocol, |
| 891 | const union nf_inet_addr *vaddr, __be16 vport); | 1033 | const union nf_inet_addr *vaddr, __be16 vport); |
| 892 | 1034 | ||
| 893 | static inline void ip_vs_service_put(struct ip_vs_service *svc) | 1035 | static inline void ip_vs_service_put(struct ip_vs_service *svc) |
| @@ -896,7 +1038,7 @@ static inline void ip_vs_service_put(struct ip_vs_service *svc) | |||
| 896 | } | 1038 | } |
| 897 | 1039 | ||
| 898 | extern struct ip_vs_dest * | 1040 | extern struct ip_vs_dest * |
| 899 | ip_vs_lookup_real_service(int af, __u16 protocol, | 1041 | ip_vs_lookup_real_service(struct net *net, int af, __u16 protocol, |
| 900 | const union nf_inet_addr *daddr, __be16 dport); | 1042 | const union nf_inet_addr *daddr, __be16 dport); |
| 901 | 1043 | ||
| 902 | extern int ip_vs_use_count_inc(void); | 1044 | extern int ip_vs_use_count_inc(void); |
| @@ -904,9 +1046,9 @@ extern void ip_vs_use_count_dec(void); | |||
| 904 | extern int ip_vs_control_init(void); | 1046 | extern int ip_vs_control_init(void); |
| 905 | extern void ip_vs_control_cleanup(void); | 1047 | extern void ip_vs_control_cleanup(void); |
| 906 | extern struct ip_vs_dest * | 1048 | extern struct ip_vs_dest * |
| 907 | ip_vs_find_dest(int af, const union nf_inet_addr *daddr, __be16 dport, | 1049 | ip_vs_find_dest(struct net *net, int af, const union nf_inet_addr *daddr, |
| 908 | const union nf_inet_addr *vaddr, __be16 vport, __u16 protocol, | 1050 | __be16 dport, const union nf_inet_addr *vaddr, __be16 vport, |
| 909 | __u32 fwmark); | 1051 | __u16 protocol, __u32 fwmark); |
| 910 | extern struct ip_vs_dest *ip_vs_try_bind_dest(struct ip_vs_conn *cp); | 1052 | extern struct ip_vs_dest *ip_vs_try_bind_dest(struct ip_vs_conn *cp); |
| 911 | 1053 | ||
| 912 | 1054 | ||
| @@ -914,14 +1056,12 @@ extern struct ip_vs_dest *ip_vs_try_bind_dest(struct ip_vs_conn *cp); | |||
| 914 | * IPVS sync daemon data and function prototypes | 1056 | * IPVS sync daemon data and function prototypes |
| 915 | * (from ip_vs_sync.c) | 1057 | * (from ip_vs_sync.c) |
| 916 | */ | 1058 | */ |
| 917 | extern volatile int ip_vs_sync_state; | 1059 | extern int start_sync_thread(struct net *net, int state, char *mcast_ifn, |
| 918 | extern volatile int ip_vs_master_syncid; | 1060 | __u8 syncid); |
| 919 | extern volatile int ip_vs_backup_syncid; | 1061 | extern int stop_sync_thread(struct net *net, int state); |
| 920 | extern char ip_vs_master_mcast_ifn[IP_VS_IFNAME_MAXLEN]; | 1062 | extern void ip_vs_sync_conn(struct net *net, struct ip_vs_conn *cp); |
| 921 | extern char ip_vs_backup_mcast_ifn[IP_VS_IFNAME_MAXLEN]; | 1063 | extern int ip_vs_sync_init(void); |
| 922 | extern int start_sync_thread(int state, char *mcast_ifn, __u8 syncid); | 1064 | extern void ip_vs_sync_cleanup(void); |
| 923 | extern int stop_sync_thread(int state); | ||
| 924 | extern void ip_vs_sync_conn(struct ip_vs_conn *cp); | ||
| 925 | 1065 | ||
| 926 | 1066 | ||
| 927 | /* | 1067 | /* |
| @@ -929,8 +1069,8 @@ extern void ip_vs_sync_conn(struct ip_vs_conn *cp); | |||
| 929 | */ | 1069 | */ |
| 930 | extern int ip_vs_estimator_init(void); | 1070 | extern int ip_vs_estimator_init(void); |
| 931 | extern void ip_vs_estimator_cleanup(void); | 1071 | extern void ip_vs_estimator_cleanup(void); |
| 932 | extern void ip_vs_new_estimator(struct ip_vs_stats *stats); | 1072 | extern void ip_vs_new_estimator(struct net *net, struct ip_vs_stats *stats); |
| 933 | extern void ip_vs_kill_estimator(struct ip_vs_stats *stats); | 1073 | extern void ip_vs_kill_estimator(struct net *net, struct ip_vs_stats *stats); |
| 934 | extern void ip_vs_zero_estimator(struct ip_vs_stats *stats); | 1074 | extern void ip_vs_zero_estimator(struct ip_vs_stats *stats); |
| 935 | 1075 | ||
| 936 | /* | 1076 | /* |
| @@ -972,11 +1112,13 @@ extern int ip_vs_icmp_xmit_v6 | |||
| 972 | extern int ip_vs_drop_rate; | 1112 | extern int ip_vs_drop_rate; |
| 973 | extern int ip_vs_drop_counter; | 1113 | extern int ip_vs_drop_counter; |
| 974 | 1114 | ||
| 975 | static __inline__ int ip_vs_todrop(void) | 1115 | static inline int ip_vs_todrop(struct netns_ipvs *ipvs) |
| 976 | { | 1116 | { |
| 977 | if (!ip_vs_drop_rate) return 0; | 1117 | if (!ipvs->drop_rate) |
| 978 | if (--ip_vs_drop_counter > 0) return 0; | 1118 | return 0; |
| 979 | ip_vs_drop_counter = ip_vs_drop_rate; | 1119 | if (--ipvs->drop_counter > 0) |
| 1120 | return 0; | ||
| 1121 | ipvs->drop_counter = ipvs->drop_rate; | ||
| 980 | return 1; | 1122 | return 1; |
| 981 | } | 1123 | } |
| 982 | 1124 | ||
| @@ -1064,9 +1206,9 @@ static inline void ip_vs_notrack(struct sk_buff *skb) | |||
| 1064 | * Netfilter connection tracking | 1206 | * Netfilter connection tracking |
| 1065 | * (from ip_vs_nfct.c) | 1207 | * (from ip_vs_nfct.c) |
| 1066 | */ | 1208 | */ |
| 1067 | static inline int ip_vs_conntrack_enabled(void) | 1209 | static inline int ip_vs_conntrack_enabled(struct netns_ipvs *ipvs) |
| 1068 | { | 1210 | { |
| 1069 | return sysctl_ip_vs_conntrack; | 1211 | return ipvs->sysctl_conntrack; |
| 1070 | } | 1212 | } |
| 1071 | 1213 | ||
| 1072 | extern void ip_vs_update_conntrack(struct sk_buff *skb, struct ip_vs_conn *cp, | 1214 | extern void ip_vs_update_conntrack(struct sk_buff *skb, struct ip_vs_conn *cp, |
| @@ -1079,7 +1221,7 @@ extern void ip_vs_conn_drop_conntrack(struct ip_vs_conn *cp); | |||
| 1079 | 1221 | ||
| 1080 | #else | 1222 | #else |
| 1081 | 1223 | ||
| 1082 | static inline int ip_vs_conntrack_enabled(void) | 1224 | static inline int ip_vs_conntrack_enabled(struct netns_ipvs *ipvs) |
| 1083 | { | 1225 | { |
| 1084 | return 0; | 1226 | return 0; |
| 1085 | } | 1227 | } |
diff --git a/include/net/mac80211.h b/include/net/mac80211.h index 9fdf982d1286..5b3fd5add7a4 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h | |||
| @@ -97,6 +97,20 @@ enum ieee80211_max_queues { | |||
| 97 | }; | 97 | }; |
| 98 | 98 | ||
| 99 | /** | 99 | /** |
| 100 | * enum ieee80211_ac_numbers - AC numbers as used in mac80211 | ||
| 101 | * @IEEE80211_AC_VO: voice | ||
| 102 | * @IEEE80211_AC_VI: video | ||
| 103 | * @IEEE80211_AC_BE: best effort | ||
| 104 | * @IEEE80211_AC_BK: background | ||
| 105 | */ | ||
| 106 | enum ieee80211_ac_numbers { | ||
| 107 | IEEE80211_AC_VO = 0, | ||
| 108 | IEEE80211_AC_VI = 1, | ||
| 109 | IEEE80211_AC_BE = 2, | ||
| 110 | IEEE80211_AC_BK = 3, | ||
| 111 | }; | ||
| 112 | |||
| 113 | /** | ||
| 100 | * struct ieee80211_tx_queue_params - transmit queue configuration | 114 | * struct ieee80211_tx_queue_params - transmit queue configuration |
| 101 | * | 115 | * |
| 102 | * The information provided in this structure is required for QoS | 116 | * The information provided in this structure is required for QoS |
| @@ -205,6 +219,7 @@ enum ieee80211_bss_change { | |||
| 205 | * @basic_rates: bitmap of basic rates, each bit stands for an | 219 | * @basic_rates: bitmap of basic rates, each bit stands for an |
| 206 | * index into the rate table configured by the driver in | 220 | * index into the rate table configured by the driver in |
| 207 | * the current band. | 221 | * the current band. |
| 222 | * @mcast_rate: per-band multicast rate index + 1 (0: disabled) | ||
| 208 | * @bssid: The BSSID for this BSS | 223 | * @bssid: The BSSID for this BSS |
| 209 | * @enable_beacon: whether beaconing should be enabled or not | 224 | * @enable_beacon: whether beaconing should be enabled or not |
| 210 | * @channel_type: Channel type for this BSS -- the hardware might be | 225 | * @channel_type: Channel type for this BSS -- the hardware might be |
| @@ -244,6 +259,7 @@ struct ieee80211_bss_conf { | |||
| 244 | u16 assoc_capability; | 259 | u16 assoc_capability; |
| 245 | u64 timestamp; | 260 | u64 timestamp; |
| 246 | u32 basic_rates; | 261 | u32 basic_rates; |
| 262 | int mcast_rate[IEEE80211_NUM_BANDS]; | ||
| 247 | u16 ht_operation_mode; | 263 | u16 ht_operation_mode; |
| 248 | s32 cqm_rssi_thold; | 264 | s32 cqm_rssi_thold; |
| 249 | u32 cqm_rssi_hyst; | 265 | u32 cqm_rssi_hyst; |
| @@ -349,6 +365,7 @@ enum mac80211_tx_control_flags { | |||
| 349 | IEEE80211_TX_INTFL_NL80211_FRAME_TX = BIT(21), | 365 | IEEE80211_TX_INTFL_NL80211_FRAME_TX = BIT(21), |
| 350 | IEEE80211_TX_CTL_LDPC = BIT(22), | 366 | IEEE80211_TX_CTL_LDPC = BIT(22), |
| 351 | IEEE80211_TX_CTL_STBC = BIT(23) | BIT(24), | 367 | IEEE80211_TX_CTL_STBC = BIT(23) | BIT(24), |
| 368 | IEEE80211_TX_CTL_TX_OFFCHAN = BIT(25), | ||
| 352 | }; | 369 | }; |
| 353 | 370 | ||
| 354 | #define IEEE80211_TX_CTL_STBC_SHIFT 23 | 371 | #define IEEE80211_TX_CTL_STBC_SHIFT 23 |
| @@ -1652,6 +1669,11 @@ enum ieee80211_ampdu_mlme_action { | |||
| 1652 | * and IV16) for the given key from hardware. | 1669 | * and IV16) for the given key from hardware. |
| 1653 | * The callback must be atomic. | 1670 | * The callback must be atomic. |
| 1654 | * | 1671 | * |
| 1672 | * @set_frag_threshold: Configuration of fragmentation threshold. Assign this | ||
| 1673 | * if the device does fragmentation by itself; if this callback is | ||
| 1674 | * implemented then the stack will not do fragmentation. | ||
| 1675 | * The callback can sleep. | ||
| 1676 | * | ||
| 1655 | * @set_rts_threshold: Configuration of RTS threshold (if device needs it) | 1677 | * @set_rts_threshold: Configuration of RTS threshold (if device needs it) |
| 1656 | * The callback can sleep. | 1678 | * The callback can sleep. |
| 1657 | * | 1679 | * |
| @@ -1724,6 +1746,13 @@ enum ieee80211_ampdu_mlme_action { | |||
| 1724 | * completion of the channel switch. | 1746 | * completion of the channel switch. |
| 1725 | * | 1747 | * |
| 1726 | * @napi_poll: Poll Rx queue for incoming data frames. | 1748 | * @napi_poll: Poll Rx queue for incoming data frames. |
| 1749 | * | ||
| 1750 | * @set_antenna: Set antenna configuration (tx_ant, rx_ant) on the device. | ||
| 1751 | * Parameters are bitmaps of allowed antennas to use for TX/RX. Drivers may | ||
| 1752 | * reject TX/RX mask combinations they cannot support by returning -EINVAL | ||
| 1753 | * (also see nl80211.h @NL80211_ATTR_WIPHY_ANTENNA_TX). | ||
| 1754 | * | ||
| 1755 | * @get_antenna: Get current antenna configuration from device (tx_ant, rx_ant). | ||
| 1727 | */ | 1756 | */ |
| 1728 | struct ieee80211_ops { | 1757 | struct ieee80211_ops { |
| 1729 | int (*tx)(struct ieee80211_hw *hw, struct sk_buff *skb); | 1758 | int (*tx)(struct ieee80211_hw *hw, struct sk_buff *skb); |
| @@ -1765,6 +1794,7 @@ struct ieee80211_ops { | |||
| 1765 | struct ieee80211_low_level_stats *stats); | 1794 | struct ieee80211_low_level_stats *stats); |
| 1766 | void (*get_tkip_seq)(struct ieee80211_hw *hw, u8 hw_key_idx, | 1795 | void (*get_tkip_seq)(struct ieee80211_hw *hw, u8 hw_key_idx, |
| 1767 | u32 *iv32, u16 *iv16); | 1796 | u32 *iv32, u16 *iv16); |
| 1797 | int (*set_frag_threshold)(struct ieee80211_hw *hw, u32 value); | ||
| 1768 | int (*set_rts_threshold)(struct ieee80211_hw *hw, u32 value); | 1798 | int (*set_rts_threshold)(struct ieee80211_hw *hw, u32 value); |
| 1769 | int (*sta_add)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, | 1799 | int (*sta_add)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, |
| 1770 | struct ieee80211_sta *sta); | 1800 | struct ieee80211_sta *sta); |
| @@ -1793,6 +1823,14 @@ struct ieee80211_ops { | |||
| 1793 | void (*channel_switch)(struct ieee80211_hw *hw, | 1823 | void (*channel_switch)(struct ieee80211_hw *hw, |
| 1794 | struct ieee80211_channel_switch *ch_switch); | 1824 | struct ieee80211_channel_switch *ch_switch); |
| 1795 | int (*napi_poll)(struct ieee80211_hw *hw, int budget); | 1825 | int (*napi_poll)(struct ieee80211_hw *hw, int budget); |
| 1826 | int (*set_antenna)(struct ieee80211_hw *hw, u32 tx_ant, u32 rx_ant); | ||
| 1827 | int (*get_antenna)(struct ieee80211_hw *hw, u32 *tx_ant, u32 *rx_ant); | ||
| 1828 | |||
| 1829 | int (*remain_on_channel)(struct ieee80211_hw *hw, | ||
| 1830 | struct ieee80211_channel *chan, | ||
| 1831 | enum nl80211_channel_type channel_type, | ||
| 1832 | int duration); | ||
| 1833 | int (*cancel_remain_on_channel)(struct ieee80211_hw *hw); | ||
| 1796 | }; | 1834 | }; |
| 1797 | 1835 | ||
| 1798 | /** | 1836 | /** |
| @@ -1821,11 +1859,39 @@ struct ieee80211_hw *ieee80211_alloc_hw(size_t priv_data_len, | |||
| 1821 | */ | 1859 | */ |
| 1822 | int ieee80211_register_hw(struct ieee80211_hw *hw); | 1860 | int ieee80211_register_hw(struct ieee80211_hw *hw); |
| 1823 | 1861 | ||
| 1862 | /** | ||
| 1863 | * struct ieee80211_tpt_blink - throughput blink description | ||
| 1864 | * @throughput: throughput in Kbit/sec | ||
| 1865 | * @blink_time: blink time in milliseconds | ||
| 1866 | * (full cycle, ie. one off + one on period) | ||
| 1867 | */ | ||
| 1868 | struct ieee80211_tpt_blink { | ||
| 1869 | int throughput; | ||
| 1870 | int blink_time; | ||
| 1871 | }; | ||
| 1872 | |||
| 1873 | /** | ||
| 1874 | * enum ieee80211_tpt_led_trigger_flags - throughput trigger flags | ||
| 1875 | * @IEEE80211_TPT_LEDTRIG_FL_RADIO: enable blinking with radio | ||
| 1876 | * @IEEE80211_TPT_LEDTRIG_FL_WORK: enable blinking when working | ||
| 1877 | * @IEEE80211_TPT_LEDTRIG_FL_CONNECTED: enable blinking when at least one | ||
| 1878 | * interface is connected in some way, including being an AP | ||
| 1879 | */ | ||
| 1880 | enum ieee80211_tpt_led_trigger_flags { | ||
| 1881 | IEEE80211_TPT_LEDTRIG_FL_RADIO = BIT(0), | ||
| 1882 | IEEE80211_TPT_LEDTRIG_FL_WORK = BIT(1), | ||
| 1883 | IEEE80211_TPT_LEDTRIG_FL_CONNECTED = BIT(2), | ||
| 1884 | }; | ||
| 1885 | |||
| 1824 | #ifdef CONFIG_MAC80211_LEDS | 1886 | #ifdef CONFIG_MAC80211_LEDS |
| 1825 | extern char *__ieee80211_get_tx_led_name(struct ieee80211_hw *hw); | 1887 | extern char *__ieee80211_get_tx_led_name(struct ieee80211_hw *hw); |
| 1826 | extern char *__ieee80211_get_rx_led_name(struct ieee80211_hw *hw); | 1888 | extern char *__ieee80211_get_rx_led_name(struct ieee80211_hw *hw); |
| 1827 | extern char *__ieee80211_get_assoc_led_name(struct ieee80211_hw *hw); | 1889 | extern char *__ieee80211_get_assoc_led_name(struct ieee80211_hw *hw); |
| 1828 | extern char *__ieee80211_get_radio_led_name(struct ieee80211_hw *hw); | 1890 | extern char *__ieee80211_get_radio_led_name(struct ieee80211_hw *hw); |
| 1891 | extern char *__ieee80211_create_tpt_led_trigger( | ||
| 1892 | struct ieee80211_hw *hw, unsigned int flags, | ||
| 1893 | const struct ieee80211_tpt_blink *blink_table, | ||
| 1894 | unsigned int blink_table_len); | ||
| 1829 | #endif | 1895 | #endif |
| 1830 | /** | 1896 | /** |
| 1831 | * ieee80211_get_tx_led_name - get name of TX LED | 1897 | * ieee80211_get_tx_led_name - get name of TX LED |
| @@ -1904,6 +1970,30 @@ static inline char *ieee80211_get_radio_led_name(struct ieee80211_hw *hw) | |||
| 1904 | } | 1970 | } |
| 1905 | 1971 | ||
| 1906 | /** | 1972 | /** |
| 1973 | * ieee80211_create_tpt_led_trigger - create throughput LED trigger | ||
| 1974 | * @hw: the hardware to create the trigger for | ||
| 1975 | * @flags: trigger flags, see &enum ieee80211_tpt_led_trigger_flags | ||
| 1976 | * @blink_table: the blink table -- needs to be ordered by throughput | ||
| 1977 | * @blink_table_len: size of the blink table | ||
| 1978 | * | ||
| 1979 | * This function returns %NULL (in case of error, or if no LED | ||
| 1980 | * triggers are configured) or the name of the new trigger. | ||
| 1981 | * This function must be called before ieee80211_register_hw(). | ||
| 1982 | */ | ||
| 1983 | static inline char * | ||
| 1984 | ieee80211_create_tpt_led_trigger(struct ieee80211_hw *hw, unsigned int flags, | ||
| 1985 | const struct ieee80211_tpt_blink *blink_table, | ||
| 1986 | unsigned int blink_table_len) | ||
| 1987 | { | ||
| 1988 | #ifdef CONFIG_MAC80211_LEDS | ||
| 1989 | return __ieee80211_create_tpt_led_trigger(hw, flags, blink_table, | ||
| 1990 | blink_table_len); | ||
| 1991 | #else | ||
| 1992 | return NULL; | ||
| 1993 | #endif | ||
| 1994 | } | ||
| 1995 | |||
| 1996 | /** | ||
| 1907 | * ieee80211_unregister_hw - Unregister a hardware device | 1997 | * ieee80211_unregister_hw - Unregister a hardware device |
| 1908 | * | 1998 | * |
| 1909 | * This function instructs mac80211 to free allocated resources | 1999 | * This function instructs mac80211 to free allocated resources |
| @@ -2024,8 +2114,8 @@ static inline void ieee80211_rx_ni(struct ieee80211_hw *hw, | |||
| 2024 | * | 2114 | * |
| 2025 | * This function may not be called in IRQ context. Calls to this function | 2115 | * This function may not be called in IRQ context. Calls to this function |
| 2026 | * for a single hardware must be synchronized against each other. Calls | 2116 | * for a single hardware must be synchronized against each other. Calls |
| 2027 | * to this function and ieee80211_tx_status_irqsafe() may not be mixed | 2117 | * to this function, ieee80211_tx_status_ni() and ieee80211_tx_status_irqsafe() |
| 2028 | * for a single hardware. | 2118 | * may not be mixed for a single hardware. |
| 2029 | * | 2119 | * |
| 2030 | * @hw: the hardware the frame was transmitted by | 2120 | * @hw: the hardware the frame was transmitted by |
| 2031 | * @skb: the frame that was transmitted, owned by mac80211 after this call | 2121 | * @skb: the frame that was transmitted, owned by mac80211 after this call |
| @@ -2034,13 +2124,33 @@ void ieee80211_tx_status(struct ieee80211_hw *hw, | |||
| 2034 | struct sk_buff *skb); | 2124 | struct sk_buff *skb); |
| 2035 | 2125 | ||
| 2036 | /** | 2126 | /** |
| 2127 | * ieee80211_tx_status_ni - transmit status callback (in process context) | ||
| 2128 | * | ||
| 2129 | * Like ieee80211_tx_status() but can be called in process context. | ||
| 2130 | * | ||
| 2131 | * Calls to this function, ieee80211_tx_status() and | ||
| 2132 | * ieee80211_tx_status_irqsafe() may not be mixed | ||
| 2133 | * for a single hardware. | ||
| 2134 | * | ||
| 2135 | * @hw: the hardware the frame was transmitted by | ||
| 2136 | * @skb: the frame that was transmitted, owned by mac80211 after this call | ||
| 2137 | */ | ||
| 2138 | static inline void ieee80211_tx_status_ni(struct ieee80211_hw *hw, | ||
| 2139 | struct sk_buff *skb) | ||
| 2140 | { | ||
| 2141 | local_bh_disable(); | ||
| 2142 | ieee80211_tx_status(hw, skb); | ||
| 2143 | local_bh_enable(); | ||
| 2144 | } | ||
| 2145 | |||
| 2146 | /** | ||
| 2037 | * ieee80211_tx_status_irqsafe - IRQ-safe transmit status callback | 2147 | * ieee80211_tx_status_irqsafe - IRQ-safe transmit status callback |
| 2038 | * | 2148 | * |
| 2039 | * Like ieee80211_tx_status() but can be called in IRQ context | 2149 | * Like ieee80211_tx_status() but can be called in IRQ context |
| 2040 | * (internally defers to a tasklet.) | 2150 | * (internally defers to a tasklet.) |
| 2041 | * | 2151 | * |
| 2042 | * Calls to this function and ieee80211_tx_status() may not be mixed for a | 2152 | * Calls to this function, ieee80211_tx_status() and |
| 2043 | * single hardware. | 2153 | * ieee80211_tx_status_ni() may not be mixed for a single hardware. |
| 2044 | * | 2154 | * |
| 2045 | * @hw: the hardware the frame was transmitted by | 2155 | * @hw: the hardware the frame was transmitted by |
| 2046 | * @skb: the frame that was transmitted, owned by mac80211 after this call | 2156 | * @skb: the frame that was transmitted, owned by mac80211 after this call |
| @@ -2384,6 +2494,7 @@ void ieee80211_queue_delayed_work(struct ieee80211_hw *hw, | |||
| 2384 | * ieee80211_start_tx_ba_session - Start a tx Block Ack session. | 2494 | * ieee80211_start_tx_ba_session - Start a tx Block Ack session. |
| 2385 | * @sta: the station for which to start a BA session | 2495 | * @sta: the station for which to start a BA session |
| 2386 | * @tid: the TID to BA on. | 2496 | * @tid: the TID to BA on. |
| 2497 | * @timeout: session timeout value (in TUs) | ||
| 2387 | * | 2498 | * |
| 2388 | * Return: success if addBA request was sent, failure otherwise | 2499 | * Return: success if addBA request was sent, failure otherwise |
| 2389 | * | 2500 | * |
| @@ -2391,7 +2502,8 @@ void ieee80211_queue_delayed_work(struct ieee80211_hw *hw, | |||
| 2391 | * the need to start aggregation on a certain RA/TID, the session level | 2502 | * the need to start aggregation on a certain RA/TID, the session level |
| 2392 | * will be managed by the mac80211. | 2503 | * will be managed by the mac80211. |
| 2393 | */ | 2504 | */ |
| 2394 | int ieee80211_start_tx_ba_session(struct ieee80211_sta *sta, u16 tid); | 2505 | int ieee80211_start_tx_ba_session(struct ieee80211_sta *sta, u16 tid, |
| 2506 | u16 timeout); | ||
| 2395 | 2507 | ||
| 2396 | /** | 2508 | /** |
| 2397 | * ieee80211_start_tx_ba_cb_irqsafe - low level driver ready to aggregate. | 2509 | * ieee80211_start_tx_ba_cb_irqsafe - low level driver ready to aggregate. |
| @@ -2501,6 +2613,21 @@ void ieee80211_sta_block_awake(struct ieee80211_hw *hw, | |||
| 2501 | struct ieee80211_sta *pubsta, bool block); | 2613 | struct ieee80211_sta *pubsta, bool block); |
| 2502 | 2614 | ||
| 2503 | /** | 2615 | /** |
| 2616 | * ieee80211_ap_probereq_get - retrieve a Probe Request template | ||
| 2617 | * @hw: pointer obtained from ieee80211_alloc_hw(). | ||
| 2618 | * @vif: &struct ieee80211_vif pointer from the add_interface callback. | ||
| 2619 | * | ||
| 2620 | * Creates a Probe Request template which can, for example, be uploaded to | ||
| 2621 | * hardware. The template is filled with bssid, ssid and supported rate | ||
| 2622 | * information. This function must only be called from within the | ||
| 2623 | * .bss_info_changed callback function and only in managed mode. The function | ||
| 2624 | * is only useful when the interface is associated, otherwise it will return | ||
| 2625 | * NULL. | ||
| 2626 | */ | ||
| 2627 | struct sk_buff *ieee80211_ap_probereq_get(struct ieee80211_hw *hw, | ||
| 2628 | struct ieee80211_vif *vif); | ||
| 2629 | |||
| 2630 | /** | ||
| 2504 | * ieee80211_beacon_loss - inform hardware does not receive beacons | 2631 | * ieee80211_beacon_loss - inform hardware does not receive beacons |
| 2505 | * | 2632 | * |
| 2506 | * @vif: &struct ieee80211_vif pointer from the add_interface callback. | 2633 | * @vif: &struct ieee80211_vif pointer from the add_interface callback. |
| @@ -2609,6 +2736,18 @@ void ieee80211_request_smps(struct ieee80211_vif *vif, | |||
| 2609 | */ | 2736 | */ |
| 2610 | void ieee80211_key_removed(struct ieee80211_key_conf *key_conf); | 2737 | void ieee80211_key_removed(struct ieee80211_key_conf *key_conf); |
| 2611 | 2738 | ||
| 2739 | /** | ||
| 2740 | * ieee80211_ready_on_channel - notification of remain-on-channel start | ||
| 2741 | * @hw: pointer as obtained from ieee80211_alloc_hw() | ||
| 2742 | */ | ||
| 2743 | void ieee80211_ready_on_channel(struct ieee80211_hw *hw); | ||
| 2744 | |||
| 2745 | /** | ||
| 2746 | * ieee80211_remain_on_channel_expired - remain_on_channel duration expired | ||
| 2747 | * @hw: pointer as obtained from ieee80211_alloc_hw() | ||
| 2748 | */ | ||
| 2749 | void ieee80211_remain_on_channel_expired(struct ieee80211_hw *hw); | ||
| 2750 | |||
| 2612 | /* Rate control API */ | 2751 | /* Rate control API */ |
| 2613 | 2752 | ||
| 2614 | /** | 2753 | /** |
| @@ -2640,7 +2779,7 @@ enum rate_control_changed { | |||
| 2640 | * @rate_idx_mask: user-requested rate mask (not MCS for now) | 2779 | * @rate_idx_mask: user-requested rate mask (not MCS for now) |
| 2641 | * @skb: the skb that will be transmitted, the control information in it needs | 2780 | * @skb: the skb that will be transmitted, the control information in it needs |
| 2642 | * to be filled in | 2781 | * to be filled in |
| 2643 | * @ap: whether this frame is sent out in AP mode | 2782 | * @bss: whether this frame is sent out in AP or IBSS mode |
| 2644 | */ | 2783 | */ |
| 2645 | struct ieee80211_tx_rate_control { | 2784 | struct ieee80211_tx_rate_control { |
| 2646 | struct ieee80211_hw *hw; | 2785 | struct ieee80211_hw *hw; |
| @@ -2651,7 +2790,7 @@ struct ieee80211_tx_rate_control { | |||
| 2651 | bool rts, short_preamble; | 2790 | bool rts, short_preamble; |
| 2652 | u8 max_rate_idx; | 2791 | u8 max_rate_idx; |
| 2653 | u32 rate_idx_mask; | 2792 | u32 rate_idx_mask; |
| 2654 | bool ap; | 2793 | bool bss; |
| 2655 | }; | 2794 | }; |
| 2656 | 2795 | ||
| 2657 | struct rate_control_ops { | 2796 | struct rate_control_ops { |
diff --git a/include/net/ndisc.h b/include/net/ndisc.h index 895997bc2ead..e0e594f8e9d9 100644 --- a/include/net/ndisc.h +++ b/include/net/ndisc.h | |||
| @@ -42,9 +42,6 @@ enum { | |||
| 42 | #define ND_REACHABLE_TIME (30*HZ) | 42 | #define ND_REACHABLE_TIME (30*HZ) |
| 43 | #define ND_RETRANS_TIMER HZ | 43 | #define ND_RETRANS_TIMER HZ |
| 44 | 44 | ||
| 45 | #define ND_MIN_RANDOM_FACTOR (1/2) | ||
| 46 | #define ND_MAX_RANDOM_FACTOR (3/2) | ||
| 47 | |||
| 48 | #ifdef __KERNEL__ | 45 | #ifdef __KERNEL__ |
| 49 | 46 | ||
| 50 | #include <linux/compiler.h> | 47 | #include <linux/compiler.h> |
diff --git a/include/net/neighbour.h b/include/net/neighbour.h index 815b2ce9f4a4..4014b623880c 100644 --- a/include/net/neighbour.h +++ b/include/net/neighbour.h | |||
| @@ -303,7 +303,7 @@ static inline void neigh_confirm(struct neighbour *neigh) | |||
| 303 | 303 | ||
| 304 | static inline int neigh_event_send(struct neighbour *neigh, struct sk_buff *skb) | 304 | static inline int neigh_event_send(struct neighbour *neigh, struct sk_buff *skb) |
| 305 | { | 305 | { |
| 306 | unsigned long now = ACCESS_ONCE(jiffies); | 306 | unsigned long now = jiffies; |
| 307 | 307 | ||
| 308 | if (neigh->used != now) | 308 | if (neigh->used != now) |
| 309 | neigh->used = now; | 309 | neigh->used = now; |
diff --git a/include/net/net_namespace.h b/include/net/net_namespace.h index 1bf812b21fb7..b3b4a34cb2cc 100644 --- a/include/net/net_namespace.h +++ b/include/net/net_namespace.h | |||
| @@ -20,6 +20,7 @@ | |||
| 20 | #include <net/netns/conntrack.h> | 20 | #include <net/netns/conntrack.h> |
| 21 | #endif | 21 | #endif |
| 22 | #include <net/netns/xfrm.h> | 22 | #include <net/netns/xfrm.h> |
| 23 | #include <net/netns/ip_vs.h> | ||
| 23 | 24 | ||
| 24 | struct proc_dir_entry; | 25 | struct proc_dir_entry; |
| 25 | struct net_device; | 26 | struct net_device; |
| @@ -94,6 +95,7 @@ struct net { | |||
| 94 | #ifdef CONFIG_XFRM | 95 | #ifdef CONFIG_XFRM |
| 95 | struct netns_xfrm xfrm; | 96 | struct netns_xfrm xfrm; |
| 96 | #endif | 97 | #endif |
| 98 | struct netns_ipvs *ipvs; | ||
| 97 | }; | 99 | }; |
| 98 | 100 | ||
| 99 | 101 | ||
diff --git a/include/net/netfilter/nf_conntrack.h b/include/net/netfilter/nf_conntrack.h index 8a58901c96d3..2bc344c98215 100644 --- a/include/net/netfilter/nf_conntrack.h +++ b/include/net/netfilter/nf_conntrack.h | |||
| @@ -311,6 +311,8 @@ static inline int nf_ct_is_untracked(const struct nf_conn *ct) | |||
| 311 | extern int nf_conntrack_set_hashsize(const char *val, struct kernel_param *kp); | 311 | extern int nf_conntrack_set_hashsize(const char *val, struct kernel_param *kp); |
| 312 | extern unsigned int nf_conntrack_htable_size; | 312 | extern unsigned int nf_conntrack_htable_size; |
| 313 | extern unsigned int nf_conntrack_max; | 313 | extern unsigned int nf_conntrack_max; |
| 314 | extern unsigned int nf_conntrack_hash_rnd; | ||
| 315 | void init_nf_conntrack_hash_rnd(void); | ||
| 314 | 316 | ||
| 315 | #define NF_CT_STAT_INC(net, count) \ | 317 | #define NF_CT_STAT_INC(net, count) \ |
| 316 | __this_cpu_inc((net)->ct.stat->count) | 318 | __this_cpu_inc((net)->ct.stat->count) |
diff --git a/include/net/netlink.h b/include/net/netlink.h index 9801c55de5d6..373f1a900cf4 100644 --- a/include/net/netlink.h +++ b/include/net/netlink.h | |||
| @@ -225,13 +225,15 @@ extern int nlmsg_notify(struct sock *sk, struct sk_buff *skb, | |||
| 225 | u32 pid, unsigned int group, int report, | 225 | u32 pid, unsigned int group, int report, |
| 226 | gfp_t flags); | 226 | gfp_t flags); |
| 227 | 227 | ||
| 228 | extern int nla_validate(struct nlattr *head, int len, int maxtype, | 228 | extern int nla_validate(const struct nlattr *head, |
| 229 | int len, int maxtype, | ||
| 229 | const struct nla_policy *policy); | 230 | const struct nla_policy *policy); |
| 230 | extern int nla_parse(struct nlattr *tb[], int maxtype, | 231 | extern int nla_parse(struct nlattr **tb, int maxtype, |
| 231 | struct nlattr *head, int len, | 232 | const struct nlattr *head, int len, |
| 232 | const struct nla_policy *policy); | 233 | const struct nla_policy *policy); |
| 233 | extern int nla_policy_len(const struct nla_policy *, int); | 234 | extern int nla_policy_len(const struct nla_policy *, int); |
| 234 | extern struct nlattr * nla_find(struct nlattr *head, int len, int attrtype); | 235 | extern struct nlattr * nla_find(const struct nlattr *head, |
| 236 | int len, int attrtype); | ||
| 235 | extern size_t nla_strlcpy(char *dst, const struct nlattr *nla, | 237 | extern size_t nla_strlcpy(char *dst, const struct nlattr *nla, |
| 236 | size_t dstsize); | 238 | size_t dstsize); |
| 237 | extern int nla_memcpy(void *dest, const struct nlattr *src, int count); | 239 | extern int nla_memcpy(void *dest, const struct nlattr *src, int count); |
| @@ -346,7 +348,8 @@ static inline int nlmsg_ok(const struct nlmsghdr *nlh, int remaining) | |||
| 346 | * Returns the next netlink message in the message stream and | 348 | * Returns the next netlink message in the message stream and |
| 347 | * decrements remaining by the size of the current message. | 349 | * decrements remaining by the size of the current message. |
| 348 | */ | 350 | */ |
| 349 | static inline struct nlmsghdr *nlmsg_next(struct nlmsghdr *nlh, int *remaining) | 351 | static inline struct nlmsghdr * |
| 352 | nlmsg_next(const struct nlmsghdr *nlh, int *remaining) | ||
| 350 | { | 353 | { |
| 351 | int totlen = NLMSG_ALIGN(nlh->nlmsg_len); | 354 | int totlen = NLMSG_ALIGN(nlh->nlmsg_len); |
| 352 | 355 | ||
| @@ -398,7 +401,8 @@ static inline struct nlattr *nlmsg_find_attr(const struct nlmsghdr *nlh, | |||
| 398 | * @maxtype: maximum attribute type to be expected | 401 | * @maxtype: maximum attribute type to be expected |
| 399 | * @policy: validation policy | 402 | * @policy: validation policy |
| 400 | */ | 403 | */ |
| 401 | static inline int nlmsg_validate(struct nlmsghdr *nlh, int hdrlen, int maxtype, | 404 | static inline int nlmsg_validate(const struct nlmsghdr *nlh, |
| 405 | int hdrlen, int maxtype, | ||
| 402 | const struct nla_policy *policy) | 406 | const struct nla_policy *policy) |
| 403 | { | 407 | { |
| 404 | if (nlh->nlmsg_len < nlmsg_msg_size(hdrlen)) | 408 | if (nlh->nlmsg_len < nlmsg_msg_size(hdrlen)) |
| @@ -727,7 +731,8 @@ static inline struct nlattr *nla_next(const struct nlattr *nla, int *remaining) | |||
| 727 | * | 731 | * |
| 728 | * Returns the first attribute which matches the specified type. | 732 | * Returns the first attribute which matches the specified type. |
| 729 | */ | 733 | */ |
| 730 | static inline struct nlattr *nla_find_nested(struct nlattr *nla, int attrtype) | 734 | static inline struct nlattr * |
| 735 | nla_find_nested(const struct nlattr *nla, int attrtype) | ||
| 731 | { | 736 | { |
| 732 | return nla_find(nla_data(nla), nla_len(nla), attrtype); | 737 | return nla_find(nla_data(nla), nla_len(nla), attrtype); |
| 733 | } | 738 | } |
| @@ -1032,7 +1037,7 @@ static inline void nla_nest_cancel(struct sk_buff *skb, struct nlattr *start) | |||
| 1032 | * | 1037 | * |
| 1033 | * Returns 0 on success or a negative error code. | 1038 | * Returns 0 on success or a negative error code. |
| 1034 | */ | 1039 | */ |
| 1035 | static inline int nla_validate_nested(struct nlattr *start, int maxtype, | 1040 | static inline int nla_validate_nested(const struct nlattr *start, int maxtype, |
| 1036 | const struct nla_policy *policy) | 1041 | const struct nla_policy *policy) |
| 1037 | { | 1042 | { |
| 1038 | return nla_validate(nla_data(start), nla_len(start), maxtype, policy); | 1043 | return nla_validate(nla_data(start), nla_len(start), maxtype, policy); |
diff --git a/include/net/netns/generic.h b/include/net/netns/generic.h index 81a31c0db3e7..3419bf5cd154 100644 --- a/include/net/netns/generic.h +++ b/include/net/netns/generic.h | |||
| @@ -30,7 +30,7 @@ struct net_generic { | |||
| 30 | void *ptr[0]; | 30 | void *ptr[0]; |
| 31 | }; | 31 | }; |
| 32 | 32 | ||
| 33 | static inline void *net_generic(struct net *net, int id) | 33 | static inline void *net_generic(const struct net *net, int id) |
| 34 | { | 34 | { |
| 35 | struct net_generic *ng; | 35 | struct net_generic *ng; |
| 36 | void *ptr; | 36 | void *ptr; |
diff --git a/include/net/netns/ip_vs.h b/include/net/netns/ip_vs.h new file mode 100644 index 000000000000..259ebac904bf --- /dev/null +++ b/include/net/netns/ip_vs.h | |||
| @@ -0,0 +1,143 @@ | |||
| 1 | /* | ||
| 2 | * IP Virtual Server | ||
| 3 | * Data structure for network namspace | ||
| 4 | * | ||
| 5 | */ | ||
| 6 | |||
| 7 | #ifndef IP_VS_H_ | ||
| 8 | #define IP_VS_H_ | ||
| 9 | |||
| 10 | #include <linux/list.h> | ||
| 11 | #include <linux/mutex.h> | ||
| 12 | #include <linux/list_nulls.h> | ||
| 13 | #include <linux/ip_vs.h> | ||
| 14 | #include <asm/atomic.h> | ||
| 15 | #include <linux/in.h> | ||
| 16 | |||
| 17 | struct ip_vs_stats; | ||
| 18 | struct ip_vs_sync_buff; | ||
| 19 | struct ctl_table_header; | ||
| 20 | |||
| 21 | struct netns_ipvs { | ||
| 22 | int gen; /* Generation */ | ||
| 23 | /* | ||
| 24 | * Hash table: for real service lookups | ||
| 25 | */ | ||
| 26 | #define IP_VS_RTAB_BITS 4 | ||
| 27 | #define IP_VS_RTAB_SIZE (1 << IP_VS_RTAB_BITS) | ||
| 28 | #define IP_VS_RTAB_MASK (IP_VS_RTAB_SIZE - 1) | ||
| 29 | |||
| 30 | struct list_head rs_table[IP_VS_RTAB_SIZE]; | ||
| 31 | /* ip_vs_app */ | ||
| 32 | struct list_head app_list; | ||
| 33 | struct mutex app_mutex; | ||
| 34 | struct lock_class_key app_key; /* mutex debuging */ | ||
| 35 | |||
| 36 | /* ip_vs_proto */ | ||
| 37 | #define IP_VS_PROTO_TAB_SIZE 32 /* must be power of 2 */ | ||
| 38 | struct ip_vs_proto_data *proto_data_table[IP_VS_PROTO_TAB_SIZE]; | ||
| 39 | /* ip_vs_proto_tcp */ | ||
| 40 | #ifdef CONFIG_IP_VS_PROTO_TCP | ||
| 41 | #define TCP_APP_TAB_BITS 4 | ||
| 42 | #define TCP_APP_TAB_SIZE (1 << TCP_APP_TAB_BITS) | ||
| 43 | #define TCP_APP_TAB_MASK (TCP_APP_TAB_SIZE - 1) | ||
| 44 | struct list_head tcp_apps[TCP_APP_TAB_SIZE]; | ||
| 45 | spinlock_t tcp_app_lock; | ||
| 46 | #endif | ||
| 47 | /* ip_vs_proto_udp */ | ||
| 48 | #ifdef CONFIG_IP_VS_PROTO_UDP | ||
| 49 | #define UDP_APP_TAB_BITS 4 | ||
| 50 | #define UDP_APP_TAB_SIZE (1 << UDP_APP_TAB_BITS) | ||
| 51 | #define UDP_APP_TAB_MASK (UDP_APP_TAB_SIZE - 1) | ||
| 52 | struct list_head udp_apps[UDP_APP_TAB_SIZE]; | ||
| 53 | spinlock_t udp_app_lock; | ||
| 54 | #endif | ||
| 55 | /* ip_vs_proto_sctp */ | ||
| 56 | #ifdef CONFIG_IP_VS_PROTO_SCTP | ||
| 57 | #define SCTP_APP_TAB_BITS 4 | ||
| 58 | #define SCTP_APP_TAB_SIZE (1 << SCTP_APP_TAB_BITS) | ||
| 59 | #define SCTP_APP_TAB_MASK (SCTP_APP_TAB_SIZE - 1) | ||
| 60 | /* Hash table for SCTP application incarnations */ | ||
| 61 | struct list_head sctp_apps[SCTP_APP_TAB_SIZE]; | ||
| 62 | spinlock_t sctp_app_lock; | ||
| 63 | #endif | ||
| 64 | /* ip_vs_conn */ | ||
| 65 | atomic_t conn_count; /* connection counter */ | ||
| 66 | |||
| 67 | /* ip_vs_ctl */ | ||
| 68 | struct ip_vs_stats *tot_stats; /* Statistics & est. */ | ||
| 69 | struct ip_vs_cpu_stats __percpu *cpustats; /* Stats per cpu */ | ||
| 70 | seqcount_t *ustats_seq; /* u64 read retry */ | ||
| 71 | |||
| 72 | int num_services; /* no of virtual services */ | ||
| 73 | /* 1/rate drop and drop-entry variables */ | ||
| 74 | struct delayed_work defense_work; /* Work handler */ | ||
| 75 | int drop_rate; | ||
| 76 | int drop_counter; | ||
| 77 | atomic_t dropentry; | ||
| 78 | /* locks in ctl.c */ | ||
| 79 | spinlock_t dropentry_lock; /* drop entry handling */ | ||
| 80 | spinlock_t droppacket_lock; /* drop packet handling */ | ||
| 81 | spinlock_t securetcp_lock; /* state and timeout tables */ | ||
| 82 | rwlock_t rs_lock; /* real services table */ | ||
| 83 | /* semaphore for IPVS sockopts. And, [gs]etsockopt may sleep. */ | ||
| 84 | struct lock_class_key ctl_key; /* ctl_mutex debuging */ | ||
| 85 | /* Trash for destinations */ | ||
| 86 | struct list_head dest_trash; | ||
| 87 | /* Service counters */ | ||
| 88 | atomic_t ftpsvc_counter; | ||
| 89 | atomic_t nullsvc_counter; | ||
| 90 | |||
| 91 | /* sys-ctl struct */ | ||
| 92 | struct ctl_table_header *sysctl_hdr; | ||
| 93 | struct ctl_table *sysctl_tbl; | ||
| 94 | /* sysctl variables */ | ||
| 95 | int sysctl_amemthresh; | ||
| 96 | int sysctl_am_droprate; | ||
| 97 | int sysctl_drop_entry; | ||
| 98 | int sysctl_drop_packet; | ||
| 99 | int sysctl_secure_tcp; | ||
| 100 | #ifdef CONFIG_IP_VS_NFCT | ||
| 101 | int sysctl_conntrack; | ||
| 102 | #endif | ||
| 103 | int sysctl_snat_reroute; | ||
| 104 | int sysctl_sync_ver; | ||
| 105 | int sysctl_cache_bypass; | ||
| 106 | int sysctl_expire_nodest_conn; | ||
| 107 | int sysctl_expire_quiescent_template; | ||
| 108 | int sysctl_sync_threshold[2]; | ||
| 109 | int sysctl_nat_icmp_send; | ||
| 110 | |||
| 111 | /* ip_vs_lblc */ | ||
| 112 | int sysctl_lblc_expiration; | ||
| 113 | struct ctl_table_header *lblc_ctl_header; | ||
| 114 | struct ctl_table *lblc_ctl_table; | ||
| 115 | /* ip_vs_lblcr */ | ||
| 116 | int sysctl_lblcr_expiration; | ||
| 117 | struct ctl_table_header *lblcr_ctl_header; | ||
| 118 | struct ctl_table *lblcr_ctl_table; | ||
| 119 | /* ip_vs_est */ | ||
| 120 | struct list_head est_list; /* estimator list */ | ||
| 121 | spinlock_t est_lock; | ||
| 122 | struct timer_list est_timer; /* Estimation timer */ | ||
| 123 | /* ip_vs_sync */ | ||
| 124 | struct list_head sync_queue; | ||
| 125 | spinlock_t sync_lock; | ||
| 126 | struct ip_vs_sync_buff *sync_buff; | ||
| 127 | spinlock_t sync_buff_lock; | ||
| 128 | struct sockaddr_in sync_mcast_addr; | ||
| 129 | struct task_struct *master_thread; | ||
| 130 | struct task_struct *backup_thread; | ||
| 131 | int send_mesg_maxlen; | ||
| 132 | int recv_mesg_maxlen; | ||
| 133 | volatile int sync_state; | ||
| 134 | volatile int master_syncid; | ||
| 135 | volatile int backup_syncid; | ||
| 136 | /* multicast interface name */ | ||
| 137 | char master_mcast_ifn[IP_VS_IFNAME_MAXLEN]; | ||
| 138 | char backup_mcast_ifn[IP_VS_IFNAME_MAXLEN]; | ||
| 139 | /* net name space ptr */ | ||
| 140 | struct net *net; /* Needed by timer routines */ | ||
| 141 | }; | ||
| 142 | |||
| 143 | #endif /* IP_VS_H_ */ | ||
diff --git a/include/net/pkt_cls.h b/include/net/pkt_cls.h index dd3031aed9d5..9fcc680ab6b9 100644 --- a/include/net/pkt_cls.h +++ b/include/net/pkt_cls.h | |||
| @@ -323,7 +323,9 @@ static inline unsigned char * tcf_get_base_ptr(struct sk_buff *skb, int layer) | |||
| 323 | static inline int tcf_valid_offset(const struct sk_buff *skb, | 323 | static inline int tcf_valid_offset(const struct sk_buff *skb, |
| 324 | const unsigned char *ptr, const int len) | 324 | const unsigned char *ptr, const int len) |
| 325 | { | 325 | { |
| 326 | return unlikely((ptr + len) < skb_tail_pointer(skb) && ptr > skb->head); | 326 | return likely((ptr + len) <= skb_tail_pointer(skb) && |
| 327 | ptr >= skb->head && | ||
| 328 | (ptr <= (ptr + len))); | ||
| 327 | } | 329 | } |
| 328 | 330 | ||
| 329 | #ifdef CONFIG_NET_CLS_IND | 331 | #ifdef CONFIG_NET_CLS_IND |
diff --git a/include/net/regulatory.h b/include/net/regulatory.h index 9e103a4e91ee..356d6e3dc20a 100644 --- a/include/net/regulatory.h +++ b/include/net/regulatory.h | |||
| @@ -43,6 +43,12 @@ enum environment_cap { | |||
| 43 | * @intersect: indicates whether the wireless core should intersect | 43 | * @intersect: indicates whether the wireless core should intersect |
| 44 | * the requested regulatory domain with the presently set regulatory | 44 | * the requested regulatory domain with the presently set regulatory |
| 45 | * domain. | 45 | * domain. |
| 46 | * @processed: indicates whether or not this requests has already been | ||
| 47 | * processed. When the last request is processed it means that the | ||
| 48 | * currently regulatory domain set on cfg80211 is updated from | ||
| 49 | * CRDA and can be used by other regulatory requests. When a | ||
| 50 | * the last request is not yet processed we must yield until it | ||
| 51 | * is processed before processing any new requests. | ||
| 46 | * @country_ie_checksum: checksum of the last processed and accepted | 52 | * @country_ie_checksum: checksum of the last processed and accepted |
| 47 | * country IE | 53 | * country IE |
| 48 | * @country_ie_env: lets us know if the AP is telling us we are outdoor, | 54 | * @country_ie_env: lets us know if the AP is telling us we are outdoor, |
| @@ -54,6 +60,7 @@ struct regulatory_request { | |||
| 54 | enum nl80211_reg_initiator initiator; | 60 | enum nl80211_reg_initiator initiator; |
| 55 | char alpha2[2]; | 61 | char alpha2[2]; |
| 56 | bool intersect; | 62 | bool intersect; |
| 63 | bool processed; | ||
| 57 | enum environment_cap country_ie_env; | 64 | enum environment_cap country_ie_env; |
| 58 | struct list_head list; | 65 | struct list_head list; |
| 59 | }; | 66 | }; |
diff --git a/include/net/route.h b/include/net/route.h index 5cd46d1c0e14..93e10c453f6b 100644 --- a/include/net/route.h +++ b/include/net/route.h | |||
| @@ -114,7 +114,7 @@ extern int ip_rt_init(void); | |||
| 114 | extern void ip_rt_redirect(__be32 old_gw, __be32 dst, __be32 new_gw, | 114 | extern void ip_rt_redirect(__be32 old_gw, __be32 dst, __be32 new_gw, |
| 115 | __be32 src, struct net_device *dev); | 115 | __be32 src, struct net_device *dev); |
| 116 | extern void rt_cache_flush(struct net *net, int how); | 116 | extern void rt_cache_flush(struct net *net, int how); |
| 117 | extern void rt_cache_flush_batch(void); | 117 | extern void rt_cache_flush_batch(struct net *net); |
| 118 | extern int __ip_route_output_key(struct net *, struct rtable **, const struct flowi *flp); | 118 | extern int __ip_route_output_key(struct net *, struct rtable **, const struct flowi *flp); |
| 119 | extern int ip_route_output_key(struct net *, struct rtable **, struct flowi *flp); | 119 | extern int ip_route_output_key(struct net *, struct rtable **, struct flowi *flp); |
| 120 | extern int ip_route_output_flow(struct net *, struct rtable **rp, struct flowi *flp, struct sock *sk, int flags); | 120 | extern int ip_route_output_flow(struct net *, struct rtable **rp, struct flowi *flp, struct sock *sk, int flags); |
| @@ -169,14 +169,12 @@ static inline int ip_route_connect(struct rtable **rp, __be32 dst, | |||
| 169 | { | 169 | { |
| 170 | struct flowi fl = { .oif = oif, | 170 | struct flowi fl = { .oif = oif, |
| 171 | .mark = sk->sk_mark, | 171 | .mark = sk->sk_mark, |
| 172 | .nl_u = { .ip4_u = { .daddr = dst, | 172 | .fl4_dst = dst, |
| 173 | .saddr = src, | 173 | .fl4_src = src, |
| 174 | .tos = tos } }, | 174 | .fl4_tos = tos, |
| 175 | .proto = protocol, | 175 | .proto = protocol, |
| 176 | .uli_u = { .ports = | 176 | .fl_ip_sport = sport, |
| 177 | { .sport = sport, | 177 | .fl_ip_dport = dport }; |
| 178 | .dport = dport } } }; | ||
| 179 | |||
| 180 | int err; | 178 | int err; |
| 181 | struct net *net = sock_net(sk); | 179 | struct net *net = sock_net(sk); |
| 182 | 180 | ||
| @@ -233,4 +231,15 @@ static inline int inet_iif(const struct sk_buff *skb) | |||
| 233 | return skb_rtable(skb)->rt_iif; | 231 | return skb_rtable(skb)->rt_iif; |
| 234 | } | 232 | } |
| 235 | 233 | ||
| 234 | extern int sysctl_ip_default_ttl; | ||
| 235 | |||
| 236 | static inline int ip4_dst_hoplimit(const struct dst_entry *dst) | ||
| 237 | { | ||
| 238 | int hoplimit = dst_metric_raw(dst, RTAX_HOPLIMIT); | ||
| 239 | |||
| 240 | if (hoplimit == 0) | ||
| 241 | hoplimit = sysctl_ip_default_ttl; | ||
| 242 | return hoplimit; | ||
| 243 | } | ||
| 244 | |||
| 236 | #endif /* _ROUTE_H */ | 245 | #endif /* _ROUTE_H */ |
diff --git a/include/net/rtnetlink.h b/include/net/rtnetlink.h index e013c68bfb00..4093ca78cf60 100644 --- a/include/net/rtnetlink.h +++ b/include/net/rtnetlink.h | |||
| @@ -83,6 +83,41 @@ extern void __rtnl_link_unregister(struct rtnl_link_ops *ops); | |||
| 83 | extern int rtnl_link_register(struct rtnl_link_ops *ops); | 83 | extern int rtnl_link_register(struct rtnl_link_ops *ops); |
| 84 | extern void rtnl_link_unregister(struct rtnl_link_ops *ops); | 84 | extern void rtnl_link_unregister(struct rtnl_link_ops *ops); |
| 85 | 85 | ||
| 86 | /** | ||
| 87 | * struct rtnl_af_ops - rtnetlink address family operations | ||
| 88 | * | ||
| 89 | * @list: Used internally | ||
| 90 | * @family: Address family | ||
| 91 | * @fill_link_af: Function to fill IFLA_AF_SPEC with address family | ||
| 92 | * specific netlink attributes. | ||
| 93 | * @get_link_af_size: Function to calculate size of address family specific | ||
| 94 | * netlink attributes exlusive the container attribute. | ||
| 95 | * @validate_link_af: Validate a IFLA_AF_SPEC attribute, must check attr | ||
| 96 | * for invalid configuration settings. | ||
| 97 | * @set_link_af: Function to parse a IFLA_AF_SPEC attribute and modify | ||
| 98 | * net_device accordingly. | ||
| 99 | */ | ||
| 100 | struct rtnl_af_ops { | ||
| 101 | struct list_head list; | ||
| 102 | int family; | ||
| 103 | |||
| 104 | int (*fill_link_af)(struct sk_buff *skb, | ||
| 105 | const struct net_device *dev); | ||
| 106 | size_t (*get_link_af_size)(const struct net_device *dev); | ||
| 107 | |||
| 108 | int (*validate_link_af)(const struct net_device *dev, | ||
| 109 | const struct nlattr *attr); | ||
| 110 | int (*set_link_af)(struct net_device *dev, | ||
| 111 | const struct nlattr *attr); | ||
| 112 | }; | ||
| 113 | |||
| 114 | extern int __rtnl_af_register(struct rtnl_af_ops *ops); | ||
| 115 | extern void __rtnl_af_unregister(struct rtnl_af_ops *ops); | ||
| 116 | |||
| 117 | extern int rtnl_af_register(struct rtnl_af_ops *ops); | ||
| 118 | extern void rtnl_af_unregister(struct rtnl_af_ops *ops); | ||
| 119 | |||
| 120 | |||
| 86 | extern struct net *rtnl_link_get_net(struct net *src_net, struct nlattr *tb[]); | 121 | extern struct net *rtnl_link_get_net(struct net *src_net, struct nlattr *tb[]); |
| 87 | extern struct net_device *rtnl_create_link(struct net *src_net, struct net *net, | 122 | extern struct net_device *rtnl_create_link(struct net *src_net, struct net *net, |
| 88 | char *ifname, const struct rtnl_link_ops *ops, struct nlattr *tb[]); | 123 | char *ifname, const struct rtnl_link_ops *ops, struct nlattr *tb[]); |
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h index ea1f8a83160d..0af57ebae762 100644 --- a/include/net/sch_generic.h +++ b/include/net/sch_generic.h | |||
| @@ -321,6 +321,7 @@ extern void dev_init_scheduler(struct net_device *dev); | |||
| 321 | extern void dev_shutdown(struct net_device *dev); | 321 | extern void dev_shutdown(struct net_device *dev); |
| 322 | extern void dev_activate(struct net_device *dev); | 322 | extern void dev_activate(struct net_device *dev); |
| 323 | extern void dev_deactivate(struct net_device *dev); | 323 | extern void dev_deactivate(struct net_device *dev); |
| 324 | extern void dev_deactivate_many(struct list_head *head); | ||
| 324 | extern struct Qdisc *dev_graft_qdisc(struct netdev_queue *dev_queue, | 325 | extern struct Qdisc *dev_graft_qdisc(struct netdev_queue *dev_queue, |
| 325 | struct Qdisc *qdisc); | 326 | struct Qdisc *qdisc); |
| 326 | extern void qdisc_reset(struct Qdisc *qdisc); | 327 | extern void qdisc_reset(struct Qdisc *qdisc); |
| @@ -610,11 +611,7 @@ static inline struct sk_buff *skb_act_clone(struct sk_buff *skb, gfp_t gfp_mask, | |||
| 610 | { | 611 | { |
| 611 | struct sk_buff *n; | 612 | struct sk_buff *n; |
| 612 | 613 | ||
| 613 | if ((action == TC_ACT_STOLEN || action == TC_ACT_QUEUED) && | 614 | n = skb_clone(skb, gfp_mask); |
| 614 | !skb_shared(skb)) | ||
| 615 | n = skb_get(skb); | ||
| 616 | else | ||
| 617 | n = skb_clone(skb, gfp_mask); | ||
| 618 | 615 | ||
| 619 | if (n) { | 616 | if (n) { |
| 620 | n->tc_verd = SET_TC_VERD(n->tc_verd, 0); | 617 | n->tc_verd = SET_TC_VERD(n->tc_verd, 0); |
diff --git a/include/net/scm.h b/include/net/scm.h index 31656506d967..745460fa2f02 100644 --- a/include/net/scm.h +++ b/include/net/scm.h | |||
| @@ -10,11 +10,12 @@ | |||
| 10 | /* Well, we should have at least one descriptor open | 10 | /* Well, we should have at least one descriptor open |
| 11 | * to accept passed FDs 8) | 11 | * to accept passed FDs 8) |
| 12 | */ | 12 | */ |
| 13 | #define SCM_MAX_FD 255 | 13 | #define SCM_MAX_FD 253 |
| 14 | 14 | ||
| 15 | struct scm_fp_list { | 15 | struct scm_fp_list { |
| 16 | struct list_head list; | 16 | struct list_head list; |
| 17 | int count; | 17 | short count; |
| 18 | short max; | ||
| 18 | struct file *fp[SCM_MAX_FD]; | 19 | struct file *fp[SCM_MAX_FD]; |
| 19 | }; | 20 | }; |
| 20 | 21 | ||
diff --git a/include/net/sctp/command.h b/include/net/sctp/command.h index 2c55a7ea20af..c01dc99def07 100644 --- a/include/net/sctp/command.h +++ b/include/net/sctp/command.h | |||
| @@ -111,9 +111,6 @@ typedef enum { | |||
| 111 | SCTP_CMD_LAST | 111 | SCTP_CMD_LAST |
| 112 | } sctp_verb_t; | 112 | } sctp_verb_t; |
| 113 | 113 | ||
| 114 | #define SCTP_CMD_MAX (SCTP_CMD_LAST - 1) | ||
| 115 | #define SCTP_CMD_NUM_VERBS (SCTP_CMD_MAX + 1) | ||
| 116 | |||
| 117 | /* How many commands can you put in an sctp_cmd_seq_t? | 114 | /* How many commands can you put in an sctp_cmd_seq_t? |
| 118 | * This is a rather arbitrary number, ideally derived from a careful | 115 | * This is a rather arbitrary number, ideally derived from a careful |
| 119 | * analysis of the state functions, but in reality just taken from | 116 | * analysis of the state functions, but in reality just taken from |
diff --git a/include/net/sctp/constants.h b/include/net/sctp/constants.h index 63908840eef0..c70d8ccc55cb 100644 --- a/include/net/sctp/constants.h +++ b/include/net/sctp/constants.h | |||
| @@ -61,7 +61,6 @@ enum { SCTP_DEFAULT_INSTREAMS = SCTP_MAX_STREAM }; | |||
| 61 | * symbols. CIDs are dense through SCTP_CID_BASE_MAX. | 61 | * symbols. CIDs are dense through SCTP_CID_BASE_MAX. |
| 62 | */ | 62 | */ |
| 63 | #define SCTP_CID_BASE_MAX SCTP_CID_SHUTDOWN_COMPLETE | 63 | #define SCTP_CID_BASE_MAX SCTP_CID_SHUTDOWN_COMPLETE |
| 64 | #define SCTP_CID_MAX SCTP_CID_ASCONF_ACK | ||
| 65 | 64 | ||
| 66 | #define SCTP_NUM_BASE_CHUNK_TYPES (SCTP_CID_BASE_MAX + 1) | 65 | #define SCTP_NUM_BASE_CHUNK_TYPES (SCTP_CID_BASE_MAX + 1) |
| 67 | 66 | ||
| @@ -86,9 +85,6 @@ typedef enum { | |||
| 86 | 85 | ||
| 87 | } sctp_event_t; | 86 | } sctp_event_t; |
| 88 | 87 | ||
| 89 | #define SCTP_EVENT_T_MAX SCTP_EVENT_T_PRIMITIVE | ||
| 90 | #define SCTP_EVENT_T_NUM (SCTP_EVENT_T_MAX + 1) | ||
| 91 | |||
| 92 | /* As a convenience for the state machine, we append SCTP_EVENT_* and | 88 | /* As a convenience for the state machine, we append SCTP_EVENT_* and |
| 93 | * SCTP_ULP_* to the list of possible chunks. | 89 | * SCTP_ULP_* to the list of possible chunks. |
| 94 | */ | 90 | */ |
| @@ -162,9 +158,6 @@ SCTP_SUBTYPE_CONSTRUCTOR(PRIMITIVE, sctp_event_primitive_t, primitive) | |||
| 162 | - (unsigned long)(c->chunk_hdr)\ | 158 | - (unsigned long)(c->chunk_hdr)\ |
| 163 | - sizeof(sctp_data_chunk_t))) | 159 | - sizeof(sctp_data_chunk_t))) |
| 164 | 160 | ||
| 165 | #define SCTP_MAX_ERROR_CAUSE SCTP_ERROR_NONEXIST_IP | ||
| 166 | #define SCTP_NUM_ERROR_CAUSE 10 | ||
| 167 | |||
| 168 | /* Internal error codes */ | 161 | /* Internal error codes */ |
| 169 | typedef enum { | 162 | typedef enum { |
| 170 | 163 | ||
| @@ -266,7 +259,6 @@ enum { SCTP_ARBITRARY_COOKIE_ECHO_LEN = 200 }; | |||
| 266 | #define SCTP_TSN_MAP_INITIAL BITS_PER_LONG | 259 | #define SCTP_TSN_MAP_INITIAL BITS_PER_LONG |
| 267 | #define SCTP_TSN_MAP_INCREMENT SCTP_TSN_MAP_INITIAL | 260 | #define SCTP_TSN_MAP_INCREMENT SCTP_TSN_MAP_INITIAL |
| 268 | #define SCTP_TSN_MAP_SIZE 4096 | 261 | #define SCTP_TSN_MAP_SIZE 4096 |
| 269 | #define SCTP_TSN_MAX_GAP 65535 | ||
| 270 | 262 | ||
| 271 | /* We will not record more than this many duplicate TSNs between two | 263 | /* We will not record more than this many duplicate TSNs between two |
| 272 | * SACKs. The minimum PMTU is 576. Remove all the headers and there | 264 | * SACKs. The minimum PMTU is 576. Remove all the headers and there |
| @@ -301,9 +293,6 @@ enum { SCTP_MAX_GABS = 16 }; | |||
| 301 | 293 | ||
| 302 | #define SCTP_CLOCK_GRANULARITY 1 /* 1 jiffy */ | 294 | #define SCTP_CLOCK_GRANULARITY 1 /* 1 jiffy */ |
| 303 | 295 | ||
| 304 | #define SCTP_DEF_MAX_INIT 6 | ||
| 305 | #define SCTP_DEF_MAX_SEND 10 | ||
| 306 | |||
| 307 | #define SCTP_DEFAULT_COOKIE_LIFE (60 * 1000) /* 60 seconds */ | 296 | #define SCTP_DEFAULT_COOKIE_LIFE (60 * 1000) /* 60 seconds */ |
| 308 | 297 | ||
| 309 | #define SCTP_DEFAULT_MINWINDOW 1500 /* default minimum rwnd size */ | 298 | #define SCTP_DEFAULT_MINWINDOW 1500 /* default minimum rwnd size */ |
| @@ -317,9 +306,6 @@ enum { SCTP_MAX_GABS = 16 }; | |||
| 317 | */ | 306 | */ |
| 318 | #define SCTP_DEFAULT_MINSEGMENT 512 /* MTU size ... if no mtu disc */ | 307 | #define SCTP_DEFAULT_MINSEGMENT 512 /* MTU size ... if no mtu disc */ |
| 319 | #define SCTP_HOW_MANY_SECRETS 2 /* How many secrets I keep */ | 308 | #define SCTP_HOW_MANY_SECRETS 2 /* How many secrets I keep */ |
| 320 | #define SCTP_HOW_LONG_COOKIE_LIVE 3600 /* How many seconds the current | ||
| 321 | * secret will live? | ||
| 322 | */ | ||
| 323 | #define SCTP_SECRET_SIZE 32 /* Number of octets in a 256 bits. */ | 309 | #define SCTP_SECRET_SIZE 32 /* Number of octets in a 256 bits. */ |
| 324 | 310 | ||
| 325 | #define SCTP_SIGNATURE_SIZE 20 /* size of a SLA-1 signature */ | 311 | #define SCTP_SIGNATURE_SIZE 20 /* size of a SLA-1 signature */ |
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h index 69fef4fb79c0..cc9185ca8fd1 100644 --- a/include/net/sctp/structs.h +++ b/include/net/sctp/structs.h | |||
| @@ -261,8 +261,6 @@ extern struct sctp_globals { | |||
| 261 | #define sctp_assoc_hashsize (sctp_globals.assoc_hashsize) | 261 | #define sctp_assoc_hashsize (sctp_globals.assoc_hashsize) |
| 262 | #define sctp_assoc_hashtable (sctp_globals.assoc_hashtable) | 262 | #define sctp_assoc_hashtable (sctp_globals.assoc_hashtable) |
| 263 | #define sctp_port_hashsize (sctp_globals.port_hashsize) | 263 | #define sctp_port_hashsize (sctp_globals.port_hashsize) |
| 264 | #define sctp_port_rover (sctp_globals.port_rover) | ||
| 265 | #define sctp_port_alloc_lock (sctp_globals.port_alloc_lock) | ||
| 266 | #define sctp_port_hashtable (sctp_globals.port_hashtable) | 264 | #define sctp_port_hashtable (sctp_globals.port_hashtable) |
| 267 | #define sctp_local_addr_list (sctp_globals.local_addr_list) | 265 | #define sctp_local_addr_list (sctp_globals.local_addr_list) |
| 268 | #define sctp_local_addr_lock (sctp_globals.addr_list_lock) | 266 | #define sctp_local_addr_lock (sctp_globals.addr_list_lock) |
diff --git a/include/net/snmp.h b/include/net/snmp.h index a0e61806d480..762e2abce889 100644 --- a/include/net/snmp.h +++ b/include/net/snmp.h | |||
| @@ -60,9 +60,7 @@ struct ipstats_mib { | |||
| 60 | }; | 60 | }; |
| 61 | 61 | ||
| 62 | /* ICMP */ | 62 | /* ICMP */ |
| 63 | #define ICMP_MIB_DUMMY __ICMP_MIB_MAX | 63 | #define ICMP_MIB_MAX __ICMP_MIB_MAX |
| 64 | #define ICMP_MIB_MAX (__ICMP_MIB_MAX + 1) | ||
| 65 | |||
| 66 | struct icmp_mib { | 64 | struct icmp_mib { |
| 67 | unsigned long mibs[ICMP_MIB_MAX]; | 65 | unsigned long mibs[ICMP_MIB_MAX]; |
| 68 | }; | 66 | }; |
diff --git a/include/net/sock.h b/include/net/sock.h index c7a736228ca2..21a02f7e4f45 100644 --- a/include/net/sock.h +++ b/include/net/sock.h | |||
| @@ -57,7 +57,7 @@ | |||
| 57 | #include <linux/rculist_nulls.h> | 57 | #include <linux/rculist_nulls.h> |
| 58 | #include <linux/poll.h> | 58 | #include <linux/poll.h> |
| 59 | 59 | ||
| 60 | #include <asm/atomic.h> | 60 | #include <linux/atomic.h> |
| 61 | #include <net/dst.h> | 61 | #include <net/dst.h> |
| 62 | #include <net/checksum.h> | 62 | #include <net/checksum.h> |
| 63 | 63 | ||
| @@ -105,10 +105,8 @@ struct net; | |||
| 105 | 105 | ||
| 106 | /** | 106 | /** |
| 107 | * struct sock_common - minimal network layer representation of sockets | 107 | * struct sock_common - minimal network layer representation of sockets |
| 108 | * @skc_node: main hash linkage for various protocol lookup tables | 108 | * @skc_daddr: Foreign IPv4 addr |
| 109 | * @skc_nulls_node: main hash linkage for TCP/UDP/UDP-Lite protocol | 109 | * @skc_rcv_saddr: Bound local IPv4 addr |
| 110 | * @skc_refcnt: reference count | ||
| 111 | * @skc_tx_queue_mapping: tx queue number for this connection | ||
| 112 | * @skc_hash: hash value used with various protocol lookup tables | 110 | * @skc_hash: hash value used with various protocol lookup tables |
| 113 | * @skc_u16hashes: two u16 hash values used by UDP lookup tables | 111 | * @skc_u16hashes: two u16 hash values used by UDP lookup tables |
| 114 | * @skc_family: network address family | 112 | * @skc_family: network address family |
| @@ -119,20 +117,20 @@ struct net; | |||
| 119 | * @skc_portaddr_node: second hash linkage for UDP/UDP-Lite protocol | 117 | * @skc_portaddr_node: second hash linkage for UDP/UDP-Lite protocol |
| 120 | * @skc_prot: protocol handlers inside a network family | 118 | * @skc_prot: protocol handlers inside a network family |
| 121 | * @skc_net: reference to the network namespace of this socket | 119 | * @skc_net: reference to the network namespace of this socket |
| 120 | * @skc_node: main hash linkage for various protocol lookup tables | ||
| 121 | * @skc_nulls_node: main hash linkage for TCP/UDP/UDP-Lite protocol | ||
| 122 | * @skc_tx_queue_mapping: tx queue number for this connection | ||
| 123 | * @skc_refcnt: reference count | ||
| 122 | * | 124 | * |
| 123 | * This is the minimal network layer representation of sockets, the header | 125 | * This is the minimal network layer representation of sockets, the header |
| 124 | * for struct sock and struct inet_timewait_sock. | 126 | * for struct sock and struct inet_timewait_sock. |
| 125 | */ | 127 | */ |
| 126 | struct sock_common { | 128 | struct sock_common { |
| 127 | /* | 129 | /* skc_daddr and skc_rcv_saddr must be grouped : |
| 128 | * first fields are not copied in sock_copy() | 130 | * cf INET_MATCH() and INET_TW_MATCH() |
| 129 | */ | 131 | */ |
| 130 | union { | 132 | __be32 skc_daddr; |
| 131 | struct hlist_node skc_node; | 133 | __be32 skc_rcv_saddr; |
| 132 | struct hlist_nulls_node skc_nulls_node; | ||
| 133 | }; | ||
| 134 | atomic_t skc_refcnt; | ||
| 135 | int skc_tx_queue_mapping; | ||
| 136 | 134 | ||
| 137 | union { | 135 | union { |
| 138 | unsigned int skc_hash; | 136 | unsigned int skc_hash; |
| @@ -150,6 +148,18 @@ struct sock_common { | |||
| 150 | #ifdef CONFIG_NET_NS | 148 | #ifdef CONFIG_NET_NS |
| 151 | struct net *skc_net; | 149 | struct net *skc_net; |
| 152 | #endif | 150 | #endif |
| 151 | /* | ||
| 152 | * fields between dontcopy_begin/dontcopy_end | ||
| 153 | * are not copied in sock_copy() | ||
| 154 | */ | ||
| 155 | int skc_dontcopy_begin[0]; | ||
| 156 | union { | ||
| 157 | struct hlist_node skc_node; | ||
| 158 | struct hlist_nulls_node skc_nulls_node; | ||
| 159 | }; | ||
| 160 | int skc_tx_queue_mapping; | ||
| 161 | atomic_t skc_refcnt; | ||
| 162 | int skc_dontcopy_end[0]; | ||
| 153 | }; | 163 | }; |
| 154 | 164 | ||
| 155 | /** | 165 | /** |
| @@ -232,7 +242,8 @@ struct sock { | |||
| 232 | #define sk_refcnt __sk_common.skc_refcnt | 242 | #define sk_refcnt __sk_common.skc_refcnt |
| 233 | #define sk_tx_queue_mapping __sk_common.skc_tx_queue_mapping | 243 | #define sk_tx_queue_mapping __sk_common.skc_tx_queue_mapping |
| 234 | 244 | ||
| 235 | #define sk_copy_start __sk_common.skc_hash | 245 | #define sk_dontcopy_begin __sk_common.skc_dontcopy_begin |
| 246 | #define sk_dontcopy_end __sk_common.skc_dontcopy_end | ||
| 236 | #define sk_hash __sk_common.skc_hash | 247 | #define sk_hash __sk_common.skc_hash |
| 237 | #define sk_family __sk_common.skc_family | 248 | #define sk_family __sk_common.skc_family |
| 238 | #define sk_state __sk_common.skc_state | 249 | #define sk_state __sk_common.skc_state |
| @@ -241,59 +252,67 @@ struct sock { | |||
| 241 | #define sk_bind_node __sk_common.skc_bind_node | 252 | #define sk_bind_node __sk_common.skc_bind_node |
| 242 | #define sk_prot __sk_common.skc_prot | 253 | #define sk_prot __sk_common.skc_prot |
| 243 | #define sk_net __sk_common.skc_net | 254 | #define sk_net __sk_common.skc_net |
| 244 | kmemcheck_bitfield_begin(flags); | ||
| 245 | unsigned int sk_shutdown : 2, | ||
| 246 | sk_no_check : 2, | ||
| 247 | sk_userlocks : 4, | ||
| 248 | sk_protocol : 8, | ||
| 249 | sk_type : 16; | ||
| 250 | kmemcheck_bitfield_end(flags); | ||
| 251 | int sk_rcvbuf; | ||
| 252 | socket_lock_t sk_lock; | 255 | socket_lock_t sk_lock; |
| 256 | struct sk_buff_head sk_receive_queue; | ||
| 253 | /* | 257 | /* |
| 254 | * The backlog queue is special, it is always used with | 258 | * The backlog queue is special, it is always used with |
| 255 | * the per-socket spinlock held and requires low latency | 259 | * the per-socket spinlock held and requires low latency |
| 256 | * access. Therefore we special case it's implementation. | 260 | * access. Therefore we special case it's implementation. |
| 261 | * Note : rmem_alloc is in this structure to fill a hole | ||
| 262 | * on 64bit arches, not because its logically part of | ||
| 263 | * backlog. | ||
| 257 | */ | 264 | */ |
| 258 | struct { | 265 | struct { |
| 259 | struct sk_buff *head; | 266 | atomic_t rmem_alloc; |
| 260 | struct sk_buff *tail; | 267 | int len; |
| 261 | int len; | 268 | struct sk_buff *head; |
| 269 | struct sk_buff *tail; | ||
| 262 | } sk_backlog; | 270 | } sk_backlog; |
| 271 | #define sk_rmem_alloc sk_backlog.rmem_alloc | ||
| 272 | int sk_forward_alloc; | ||
| 273 | #ifdef CONFIG_RPS | ||
| 274 | __u32 sk_rxhash; | ||
| 275 | #endif | ||
| 276 | atomic_t sk_drops; | ||
| 277 | int sk_rcvbuf; | ||
| 278 | |||
| 279 | struct sk_filter __rcu *sk_filter; | ||
| 263 | struct socket_wq *sk_wq; | 280 | struct socket_wq *sk_wq; |
| 264 | struct dst_entry *sk_dst_cache; | 281 | |
| 282 | #ifdef CONFIG_NET_DMA | ||
| 283 | struct sk_buff_head sk_async_wait_queue; | ||
| 284 | #endif | ||
| 285 | |||
| 265 | #ifdef CONFIG_XFRM | 286 | #ifdef CONFIG_XFRM |
| 266 | struct xfrm_policy *sk_policy[2]; | 287 | struct xfrm_policy *sk_policy[2]; |
| 267 | #endif | 288 | #endif |
| 289 | unsigned long sk_flags; | ||
| 290 | struct dst_entry *sk_dst_cache; | ||
| 268 | spinlock_t sk_dst_lock; | 291 | spinlock_t sk_dst_lock; |
| 269 | atomic_t sk_rmem_alloc; | ||
| 270 | atomic_t sk_wmem_alloc; | 292 | atomic_t sk_wmem_alloc; |
| 271 | atomic_t sk_omem_alloc; | 293 | atomic_t sk_omem_alloc; |
| 272 | int sk_sndbuf; | 294 | int sk_sndbuf; |
| 273 | struct sk_buff_head sk_receive_queue; | ||
| 274 | struct sk_buff_head sk_write_queue; | 295 | struct sk_buff_head sk_write_queue; |
| 275 | #ifdef CONFIG_NET_DMA | 296 | kmemcheck_bitfield_begin(flags); |
| 276 | struct sk_buff_head sk_async_wait_queue; | 297 | unsigned int sk_shutdown : 2, |
| 277 | #endif | 298 | sk_no_check : 2, |
| 299 | sk_userlocks : 4, | ||
| 300 | sk_protocol : 8, | ||
| 301 | sk_type : 16; | ||
| 302 | kmemcheck_bitfield_end(flags); | ||
| 278 | int sk_wmem_queued; | 303 | int sk_wmem_queued; |
| 279 | int sk_forward_alloc; | ||
| 280 | gfp_t sk_allocation; | 304 | gfp_t sk_allocation; |
| 281 | int sk_route_caps; | 305 | int sk_route_caps; |
| 282 | int sk_route_nocaps; | 306 | int sk_route_nocaps; |
| 283 | int sk_gso_type; | 307 | int sk_gso_type; |
| 284 | unsigned int sk_gso_max_size; | 308 | unsigned int sk_gso_max_size; |
| 285 | int sk_rcvlowat; | 309 | int sk_rcvlowat; |
| 286 | #ifdef CONFIG_RPS | ||
| 287 | __u32 sk_rxhash; | ||
| 288 | #endif | ||
| 289 | unsigned long sk_flags; | ||
| 290 | unsigned long sk_lingertime; | 310 | unsigned long sk_lingertime; |
| 291 | struct sk_buff_head sk_error_queue; | 311 | struct sk_buff_head sk_error_queue; |
| 292 | struct proto *sk_prot_creator; | 312 | struct proto *sk_prot_creator; |
| 293 | rwlock_t sk_callback_lock; | 313 | rwlock_t sk_callback_lock; |
| 294 | int sk_err, | 314 | int sk_err, |
| 295 | sk_err_soft; | 315 | sk_err_soft; |
| 296 | atomic_t sk_drops; | ||
| 297 | unsigned short sk_ack_backlog; | 316 | unsigned short sk_ack_backlog; |
| 298 | unsigned short sk_max_ack_backlog; | 317 | unsigned short sk_max_ack_backlog; |
| 299 | __u32 sk_priority; | 318 | __u32 sk_priority; |
| @@ -301,7 +320,6 @@ struct sock { | |||
| 301 | const struct cred *sk_peer_cred; | 320 | const struct cred *sk_peer_cred; |
| 302 | long sk_rcvtimeo; | 321 | long sk_rcvtimeo; |
| 303 | long sk_sndtimeo; | 322 | long sk_sndtimeo; |
| 304 | struct sk_filter __rcu *sk_filter; | ||
| 305 | void *sk_protinfo; | 323 | void *sk_protinfo; |
| 306 | struct timer_list sk_timer; | 324 | struct timer_list sk_timer; |
| 307 | ktime_t sk_stamp; | 325 | ktime_t sk_stamp; |
| @@ -509,9 +527,6 @@ static __inline__ void sk_add_bind_node(struct sock *sk, | |||
| 509 | #define sk_nulls_for_each_from(__sk, node) \ | 527 | #define sk_nulls_for_each_from(__sk, node) \ |
| 510 | if (__sk && ({ node = &(__sk)->sk_nulls_node; 1; })) \ | 528 | if (__sk && ({ node = &(__sk)->sk_nulls_node; 1; })) \ |
| 511 | hlist_nulls_for_each_entry_from(__sk, node, sk_nulls_node) | 529 | hlist_nulls_for_each_entry_from(__sk, node, sk_nulls_node) |
| 512 | #define sk_for_each_continue(__sk, node) \ | ||
| 513 | if (__sk && ({ node = &(__sk)->sk_node; 1; })) \ | ||
| 514 | hlist_for_each_entry_continue(__sk, node, sk_node) | ||
| 515 | #define sk_for_each_safe(__sk, node, tmp, list) \ | 530 | #define sk_for_each_safe(__sk, node, tmp, list) \ |
| 516 | hlist_for_each_entry_safe(__sk, node, tmp, list, sk_node) | 531 | hlist_for_each_entry_safe(__sk, node, tmp, list, sk_node) |
| 517 | #define sk_for_each_bound(__sk, node, list) \ | 532 | #define sk_for_each_bound(__sk, node, list) \ |
| @@ -754,6 +769,7 @@ struct proto { | |||
| 754 | void (*unhash)(struct sock *sk); | 769 | void (*unhash)(struct sock *sk); |
| 755 | void (*rehash)(struct sock *sk); | 770 | void (*rehash)(struct sock *sk); |
| 756 | int (*get_port)(struct sock *sk, unsigned short snum); | 771 | int (*get_port)(struct sock *sk, unsigned short snum); |
| 772 | void (*clear_sk)(struct sock *sk, int size); | ||
| 757 | 773 | ||
| 758 | /* Keeping track of sockets in use */ | 774 | /* Keeping track of sockets in use */ |
| 759 | #ifdef CONFIG_PROC_FS | 775 | #ifdef CONFIG_PROC_FS |
| @@ -762,7 +778,7 @@ struct proto { | |||
| 762 | 778 | ||
| 763 | /* Memory pressure */ | 779 | /* Memory pressure */ |
| 764 | void (*enter_memory_pressure)(struct sock *sk); | 780 | void (*enter_memory_pressure)(struct sock *sk); |
| 765 | atomic_t *memory_allocated; /* Current allocated memory. */ | 781 | atomic_long_t *memory_allocated; /* Current allocated memory. */ |
| 766 | struct percpu_counter *sockets_allocated; /* Current number of sockets. */ | 782 | struct percpu_counter *sockets_allocated; /* Current number of sockets. */ |
| 767 | /* | 783 | /* |
| 768 | * Pressure flag: try to collapse. | 784 | * Pressure flag: try to collapse. |
| @@ -771,7 +787,7 @@ struct proto { | |||
| 771 | * is strict, actions are advisory and have some latency. | 787 | * is strict, actions are advisory and have some latency. |
| 772 | */ | 788 | */ |
| 773 | int *memory_pressure; | 789 | int *memory_pressure; |
| 774 | int *sysctl_mem; | 790 | long *sysctl_mem; |
| 775 | int *sysctl_wmem; | 791 | int *sysctl_wmem; |
| 776 | int *sysctl_rmem; | 792 | int *sysctl_rmem; |
| 777 | int max_header; | 793 | int max_header; |
| @@ -852,6 +868,8 @@ static inline void __sk_prot_rehash(struct sock *sk) | |||
| 852 | sk->sk_prot->hash(sk); | 868 | sk->sk_prot->hash(sk); |
| 853 | } | 869 | } |
| 854 | 870 | ||
| 871 | void sk_prot_clear_portaddr_nulls(struct sock *sk, int size); | ||
| 872 | |||
| 855 | /* About 10 seconds */ | 873 | /* About 10 seconds */ |
| 856 | #define SOCK_DESTROY_TIME (10*HZ) | 874 | #define SOCK_DESTROY_TIME (10*HZ) |
| 857 | 875 | ||
| @@ -1155,6 +1173,8 @@ extern void sk_common_release(struct sock *sk); | |||
| 1155 | /* Initialise core socket variables */ | 1173 | /* Initialise core socket variables */ |
| 1156 | extern void sock_init_data(struct socket *sock, struct sock *sk); | 1174 | extern void sock_init_data(struct socket *sock, struct sock *sk); |
| 1157 | 1175 | ||
| 1176 | extern void sk_filter_release_rcu(struct rcu_head *rcu); | ||
| 1177 | |||
| 1158 | /** | 1178 | /** |
| 1159 | * sk_filter_release - release a socket filter | 1179 | * sk_filter_release - release a socket filter |
| 1160 | * @fp: filter to remove | 1180 | * @fp: filter to remove |
| @@ -1165,7 +1185,7 @@ extern void sock_init_data(struct socket *sock, struct sock *sk); | |||
| 1165 | static inline void sk_filter_release(struct sk_filter *fp) | 1185 | static inline void sk_filter_release(struct sk_filter *fp) |
| 1166 | { | 1186 | { |
| 1167 | if (atomic_dec_and_test(&fp->refcnt)) | 1187 | if (atomic_dec_and_test(&fp->refcnt)) |
| 1168 | kfree(fp); | 1188 | call_rcu_bh(&fp->rcu, sk_filter_release_rcu); |
| 1169 | } | 1189 | } |
| 1170 | 1190 | ||
| 1171 | static inline void sk_filter_uncharge(struct sock *sk, struct sk_filter *fp) | 1191 | static inline void sk_filter_uncharge(struct sock *sk, struct sk_filter *fp) |
diff --git a/include/net/tcp.h b/include/net/tcp.h index 4fee0424af7e..38509f047382 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h | |||
| @@ -60,6 +60,9 @@ extern void tcp_time_wait(struct sock *sk, int state, int timeo); | |||
| 60 | */ | 60 | */ |
| 61 | #define MAX_TCP_WINDOW 32767U | 61 | #define MAX_TCP_WINDOW 32767U |
| 62 | 62 | ||
| 63 | /* Offer an initial receive window of 10 mss. */ | ||
| 64 | #define TCP_DEFAULT_INIT_RCVWND 10 | ||
| 65 | |||
| 63 | /* Minimal accepted MSS. It is (60+60+8) - (20+20). */ | 66 | /* Minimal accepted MSS. It is (60+60+8) - (20+20). */ |
| 64 | #define TCP_MIN_MSS 88U | 67 | #define TCP_MIN_MSS 88U |
| 65 | 68 | ||
| @@ -100,12 +103,6 @@ extern void tcp_time_wait(struct sock *sk, int state, int timeo); | |||
| 100 | #define TCP_SYNACK_RETRIES 5 /* number of times to retry passive opening a | 103 | #define TCP_SYNACK_RETRIES 5 /* number of times to retry passive opening a |
| 101 | * connection: ~180sec is RFC minimum */ | 104 | * connection: ~180sec is RFC minimum */ |
| 102 | 105 | ||
| 103 | |||
| 104 | #define TCP_ORPHAN_RETRIES 7 /* number of times to retry on an orphaned | ||
| 105 | * socket. 7 is ~50sec-16min. | ||
| 106 | */ | ||
| 107 | |||
| 108 | |||
| 109 | #define TCP_TIMEWAIT_LEN (60*HZ) /* how long to wait to destroy TIME-WAIT | 106 | #define TCP_TIMEWAIT_LEN (60*HZ) /* how long to wait to destroy TIME-WAIT |
| 110 | * state, about 60 seconds */ | 107 | * state, about 60 seconds */ |
| 111 | #define TCP_FIN_TIMEOUT TCP_TIMEWAIT_LEN | 108 | #define TCP_FIN_TIMEOUT TCP_TIMEWAIT_LEN |
| @@ -224,7 +221,7 @@ extern int sysctl_tcp_fack; | |||
| 224 | extern int sysctl_tcp_reordering; | 221 | extern int sysctl_tcp_reordering; |
| 225 | extern int sysctl_tcp_ecn; | 222 | extern int sysctl_tcp_ecn; |
| 226 | extern int sysctl_tcp_dsack; | 223 | extern int sysctl_tcp_dsack; |
| 227 | extern int sysctl_tcp_mem[3]; | 224 | extern long sysctl_tcp_mem[3]; |
| 228 | extern int sysctl_tcp_wmem[3]; | 225 | extern int sysctl_tcp_wmem[3]; |
| 229 | extern int sysctl_tcp_rmem[3]; | 226 | extern int sysctl_tcp_rmem[3]; |
| 230 | extern int sysctl_tcp_app_win; | 227 | extern int sysctl_tcp_app_win; |
| @@ -247,7 +244,7 @@ extern int sysctl_tcp_cookie_size; | |||
| 247 | extern int sysctl_tcp_thin_linear_timeouts; | 244 | extern int sysctl_tcp_thin_linear_timeouts; |
| 248 | extern int sysctl_tcp_thin_dupack; | 245 | extern int sysctl_tcp_thin_dupack; |
| 249 | 246 | ||
| 250 | extern atomic_t tcp_memory_allocated; | 247 | extern atomic_long_t tcp_memory_allocated; |
| 251 | extern struct percpu_counter tcp_sockets_allocated; | 248 | extern struct percpu_counter tcp_sockets_allocated; |
| 252 | extern int tcp_memory_pressure; | 249 | extern int tcp_memory_pressure; |
| 253 | 250 | ||
| @@ -280,7 +277,7 @@ static inline bool tcp_too_many_orphans(struct sock *sk, int shift) | |||
| 280 | } | 277 | } |
| 281 | 278 | ||
| 282 | if (sk->sk_wmem_queued > SOCK_MIN_SNDBUF && | 279 | if (sk->sk_wmem_queued > SOCK_MIN_SNDBUF && |
| 283 | atomic_read(&tcp_memory_allocated) > sysctl_tcp_mem[2]) | 280 | atomic_long_read(&tcp_memory_allocated) > sysctl_tcp_mem[2]) |
| 284 | return true; | 281 | return true; |
| 285 | return false; | 282 | return false; |
| 286 | } | 283 | } |
| @@ -312,7 +309,8 @@ extern void tcp_shutdown (struct sock *sk, int how); | |||
| 312 | 309 | ||
| 313 | extern int tcp_v4_rcv(struct sk_buff *skb); | 310 | extern int tcp_v4_rcv(struct sk_buff *skb); |
| 314 | 311 | ||
| 315 | extern int tcp_v4_remember_stamp(struct sock *sk); | 312 | extern struct inet_peer *tcp_v4_get_peer(struct sock *sk, bool *release_it); |
| 313 | extern void *tcp_v4_tw_get_peer(struct sock *sk); | ||
| 316 | extern int tcp_v4_tw_remember_stamp(struct inet_timewait_sock *tw); | 314 | extern int tcp_v4_tw_remember_stamp(struct inet_timewait_sock *tw); |
| 317 | extern int tcp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, | 315 | extern int tcp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, |
| 318 | size_t size); | 316 | size_t size); |
| @@ -1043,7 +1041,13 @@ static inline int tcp_paws_check(const struct tcp_options_received *rx_opt, | |||
| 1043 | return 1; | 1041 | return 1; |
| 1044 | if (unlikely(get_seconds() >= rx_opt->ts_recent_stamp + TCP_PAWS_24DAYS)) | 1042 | if (unlikely(get_seconds() >= rx_opt->ts_recent_stamp + TCP_PAWS_24DAYS)) |
| 1045 | return 1; | 1043 | return 1; |
| 1046 | 1044 | /* | |
| 1045 | * Some OSes send SYN and SYNACK messages with tsval=0 tsecr=0, | ||
| 1046 | * then following tcp messages have valid values. Ignore 0 value, | ||
| 1047 | * or else 'negative' tsval might forbid us to accept their packets. | ||
| 1048 | */ | ||
| 1049 | if (!rx_opt->ts_recent) | ||
| 1050 | return 1; | ||
| 1047 | return 0; | 1051 | return 0; |
| 1048 | } | 1052 | } |
| 1049 | 1053 | ||
| @@ -1157,8 +1161,6 @@ struct tcp_md5sig_pool { | |||
| 1157 | union tcp_md5sum_block md5_blk; | 1161 | union tcp_md5sum_block md5_blk; |
| 1158 | }; | 1162 | }; |
| 1159 | 1163 | ||
| 1160 | #define TCP_MD5SIG_MAXKEYS (~(u32)0) /* really?! */ | ||
| 1161 | |||
| 1162 | /* - functions */ | 1164 | /* - functions */ |
| 1163 | extern int tcp_v4_md5_hash_skb(char *md5_hash, struct tcp_md5sig_key *key, | 1165 | extern int tcp_v4_md5_hash_skb(char *md5_hash, struct tcp_md5sig_key *key, |
| 1164 | struct sock *sk, struct request_sock *req, | 1166 | struct sock *sk, struct request_sock *req, |
diff --git a/include/net/timewait_sock.h b/include/net/timewait_sock.h index 97c3b14da55d..053b3cf2c66a 100644 --- a/include/net/timewait_sock.h +++ b/include/net/timewait_sock.h | |||
| @@ -21,6 +21,7 @@ struct timewait_sock_ops { | |||
| 21 | int (*twsk_unique)(struct sock *sk, | 21 | int (*twsk_unique)(struct sock *sk, |
| 22 | struct sock *sktw, void *twp); | 22 | struct sock *sktw, void *twp); |
| 23 | void (*twsk_destructor)(struct sock *sk); | 23 | void (*twsk_destructor)(struct sock *sk); |
| 24 | void *(*twsk_getpeer)(struct sock *sk); | ||
| 24 | }; | 25 | }; |
| 25 | 26 | ||
| 26 | static inline int twsk_unique(struct sock *sk, struct sock *sktw, void *twp) | 27 | static inline int twsk_unique(struct sock *sk, struct sock *sktw, void *twp) |
| @@ -39,4 +40,11 @@ static inline void twsk_destructor(struct sock *sk) | |||
| 39 | sk->sk_prot->twsk_prot->twsk_destructor(sk); | 40 | sk->sk_prot->twsk_prot->twsk_destructor(sk); |
| 40 | } | 41 | } |
| 41 | 42 | ||
| 43 | static inline void *twsk_getpeer(struct sock *sk) | ||
| 44 | { | ||
| 45 | if (sk->sk_prot->twsk_prot->twsk_getpeer) | ||
| 46 | return sk->sk_prot->twsk_prot->twsk_getpeer(sk); | ||
| 47 | return NULL; | ||
| 48 | } | ||
| 49 | |||
| 42 | #endif /* _TIMEWAIT_SOCK_H */ | 50 | #endif /* _TIMEWAIT_SOCK_H */ |
diff --git a/include/net/tipc/tipc.h b/include/net/tipc/tipc.h deleted file mode 100644 index 1e0645e1eed2..000000000000 --- a/include/net/tipc/tipc.h +++ /dev/null | |||
| @@ -1,186 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * include/net/tipc/tipc.h: Main include file for TIPC users | ||
| 3 | * | ||
| 4 | * Copyright (c) 2003-2006, Ericsson AB | ||
| 5 | * Copyright (c) 2005,2010 Wind River Systems | ||
| 6 | * All rights reserved. | ||
| 7 | * | ||
| 8 | * Redistribution and use in source and binary forms, with or without | ||
| 9 | * modification, are permitted provided that the following conditions are met: | ||
| 10 | * | ||
| 11 | * 1. Redistributions of source code must retain the above copyright | ||
| 12 | * notice, this list of conditions and the following disclaimer. | ||
| 13 | * 2. Redistributions in binary form must reproduce the above copyright | ||
| 14 | * notice, this list of conditions and the following disclaimer in the | ||
| 15 | * documentation and/or other materials provided with the distribution. | ||
| 16 | * 3. Neither the names of the copyright holders nor the names of its | ||
| 17 | * contributors may be used to endorse or promote products derived from | ||
| 18 | * this software without specific prior written permission. | ||
| 19 | * | ||
| 20 | * Alternatively, this software may be distributed under the terms of the | ||
| 21 | * GNU General Public License ("GPL") version 2 as published by the Free | ||
| 22 | * Software Foundation. | ||
| 23 | * | ||
| 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
| 25 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
| 26 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
| 27 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE | ||
| 28 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | ||
| 29 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | ||
| 30 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | ||
| 31 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | ||
| 32 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
| 33 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
| 34 | * POSSIBILITY OF SUCH DAMAGE. | ||
| 35 | */ | ||
| 36 | |||
| 37 | #ifndef _NET_TIPC_H_ | ||
| 38 | #define _NET_TIPC_H_ | ||
| 39 | |||
| 40 | #ifdef __KERNEL__ | ||
| 41 | |||
| 42 | #include <linux/tipc.h> | ||
| 43 | #include <linux/skbuff.h> | ||
| 44 | |||
| 45 | /* | ||
| 46 | * Native API | ||
| 47 | */ | ||
| 48 | |||
| 49 | /* | ||
| 50 | * TIPC operating mode routines | ||
| 51 | */ | ||
| 52 | |||
| 53 | #define TIPC_NOT_RUNNING 0 | ||
| 54 | #define TIPC_NODE_MODE 1 | ||
| 55 | #define TIPC_NET_MODE 2 | ||
| 56 | |||
| 57 | typedef void (*tipc_mode_event)(void *usr_handle, int mode, u32 addr); | ||
| 58 | |||
| 59 | int tipc_attach(unsigned int *userref, tipc_mode_event, void *usr_handle); | ||
| 60 | |||
| 61 | void tipc_detach(unsigned int userref); | ||
| 62 | |||
| 63 | /* | ||
| 64 | * TIPC port manipulation routines | ||
| 65 | */ | ||
| 66 | |||
| 67 | typedef void (*tipc_msg_err_event) (void *usr_handle, | ||
| 68 | u32 portref, | ||
| 69 | struct sk_buff **buf, | ||
| 70 | unsigned char const *data, | ||
| 71 | unsigned int size, | ||
| 72 | int reason, | ||
| 73 | struct tipc_portid const *attmpt_destid); | ||
| 74 | |||
| 75 | typedef void (*tipc_named_msg_err_event) (void *usr_handle, | ||
| 76 | u32 portref, | ||
| 77 | struct sk_buff **buf, | ||
| 78 | unsigned char const *data, | ||
| 79 | unsigned int size, | ||
| 80 | int reason, | ||
| 81 | struct tipc_name_seq const *attmpt_dest); | ||
| 82 | |||
| 83 | typedef void (*tipc_conn_shutdown_event) (void *usr_handle, | ||
| 84 | u32 portref, | ||
| 85 | struct sk_buff **buf, | ||
| 86 | unsigned char const *data, | ||
| 87 | unsigned int size, | ||
| 88 | int reason); | ||
| 89 | |||
| 90 | typedef void (*tipc_msg_event) (void *usr_handle, | ||
| 91 | u32 portref, | ||
| 92 | struct sk_buff **buf, | ||
| 93 | unsigned char const *data, | ||
| 94 | unsigned int size, | ||
| 95 | unsigned int importance, | ||
| 96 | struct tipc_portid const *origin); | ||
| 97 | |||
| 98 | typedef void (*tipc_named_msg_event) (void *usr_handle, | ||
| 99 | u32 portref, | ||
| 100 | struct sk_buff **buf, | ||
| 101 | unsigned char const *data, | ||
| 102 | unsigned int size, | ||
| 103 | unsigned int importance, | ||
| 104 | struct tipc_portid const *orig, | ||
| 105 | struct tipc_name_seq const *dest); | ||
| 106 | |||
| 107 | typedef void (*tipc_conn_msg_event) (void *usr_handle, | ||
| 108 | u32 portref, | ||
| 109 | struct sk_buff **buf, | ||
| 110 | unsigned char const *data, | ||
| 111 | unsigned int size); | ||
| 112 | |||
| 113 | typedef void (*tipc_continue_event) (void *usr_handle, | ||
| 114 | u32 portref); | ||
| 115 | |||
| 116 | int tipc_createport(unsigned int tipc_user, | ||
| 117 | void *usr_handle, | ||
| 118 | unsigned int importance, | ||
| 119 | tipc_msg_err_event error_cb, | ||
| 120 | tipc_named_msg_err_event named_error_cb, | ||
| 121 | tipc_conn_shutdown_event conn_error_cb, | ||
| 122 | tipc_msg_event message_cb, | ||
| 123 | tipc_named_msg_event named_message_cb, | ||
| 124 | tipc_conn_msg_event conn_message_cb, | ||
| 125 | tipc_continue_event continue_event_cb, | ||
| 126 | u32 *portref); | ||
| 127 | |||
| 128 | int tipc_deleteport(u32 portref); | ||
| 129 | |||
| 130 | int tipc_ownidentity(u32 portref, struct tipc_portid *port); | ||
| 131 | |||
| 132 | int tipc_portimportance(u32 portref, unsigned int *importance); | ||
| 133 | int tipc_set_portimportance(u32 portref, unsigned int importance); | ||
| 134 | |||
| 135 | int tipc_portunreliable(u32 portref, unsigned int *isunreliable); | ||
| 136 | int tipc_set_portunreliable(u32 portref, unsigned int isunreliable); | ||
| 137 | |||
| 138 | int tipc_portunreturnable(u32 portref, unsigned int *isunreturnable); | ||
| 139 | int tipc_set_portunreturnable(u32 portref, unsigned int isunreturnable); | ||
| 140 | |||
| 141 | int tipc_publish(u32 portref, unsigned int scope, | ||
| 142 | struct tipc_name_seq const *name_seq); | ||
| 143 | int tipc_withdraw(u32 portref, unsigned int scope, | ||
| 144 | struct tipc_name_seq const *name_seq); | ||
| 145 | |||
| 146 | int tipc_connect2port(u32 portref, struct tipc_portid const *port); | ||
| 147 | |||
| 148 | int tipc_disconnect(u32 portref); | ||
| 149 | |||
| 150 | int tipc_shutdown(u32 ref); | ||
| 151 | |||
| 152 | /* | ||
| 153 | * TIPC messaging routines | ||
| 154 | */ | ||
| 155 | |||
| 156 | #define TIPC_PORT_IMPORTANCE 100 /* send using current port setting */ | ||
| 157 | |||
| 158 | |||
| 159 | int tipc_send(u32 portref, | ||
| 160 | unsigned int num_sect, | ||
| 161 | struct iovec const *msg_sect); | ||
| 162 | |||
| 163 | int tipc_send2name(u32 portref, | ||
| 164 | struct tipc_name const *name, | ||
| 165 | u32 domain, | ||
| 166 | unsigned int num_sect, | ||
| 167 | struct iovec const *msg_sect); | ||
| 168 | |||
| 169 | int tipc_send2port(u32 portref, | ||
| 170 | struct tipc_portid const *dest, | ||
| 171 | unsigned int num_sect, | ||
| 172 | struct iovec const *msg_sect); | ||
| 173 | |||
| 174 | int tipc_send_buf2port(u32 portref, | ||
| 175 | struct tipc_portid const *dest, | ||
| 176 | struct sk_buff *buf, | ||
| 177 | unsigned int dsz); | ||
| 178 | |||
| 179 | int tipc_multicast(u32 portref, | ||
| 180 | struct tipc_name_seq const *seq, | ||
| 181 | u32 domain, /* currently unused */ | ||
| 182 | unsigned int section_count, | ||
| 183 | struct iovec const *msg); | ||
| 184 | #endif | ||
| 185 | |||
| 186 | #endif | ||
diff --git a/include/net/tipc/tipc_bearer.h b/include/net/tipc/tipc_bearer.h deleted file mode 100644 index ee2f304e4919..000000000000 --- a/include/net/tipc/tipc_bearer.h +++ /dev/null | |||
| @@ -1,138 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * include/net/tipc/tipc_bearer.h: Include file for privileged access to TIPC bearers | ||
| 3 | * | ||
| 4 | * Copyright (c) 2003-2006, Ericsson AB | ||
| 5 | * Copyright (c) 2005, Wind River Systems | ||
| 6 | * All rights reserved. | ||
| 7 | * | ||
| 8 | * Redistribution and use in source and binary forms, with or without | ||
| 9 | * modification, are permitted provided that the following conditions are met: | ||
| 10 | * | ||
| 11 | * 1. Redistributions of source code must retain the above copyright | ||
| 12 | * notice, this list of conditions and the following disclaimer. | ||
| 13 | * 2. Redistributions in binary form must reproduce the above copyright | ||
| 14 | * notice, this list of conditions and the following disclaimer in the | ||
| 15 | * documentation and/or other materials provided with the distribution. | ||
| 16 | * 3. Neither the names of the copyright holders nor the names of its | ||
| 17 | * contributors may be used to endorse or promote products derived from | ||
| 18 | * this software without specific prior written permission. | ||
| 19 | * | ||
| 20 | * Alternatively, this software may be distributed under the terms of the | ||
| 21 | * GNU General Public License ("GPL") version 2 as published by the Free | ||
| 22 | * Software Foundation. | ||
| 23 | * | ||
| 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
| 25 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
| 26 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
| 27 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE | ||
| 28 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | ||
| 29 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | ||
| 30 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | ||
| 31 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | ||
| 32 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
| 33 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
| 34 | * POSSIBILITY OF SUCH DAMAGE. | ||
| 35 | */ | ||
| 36 | |||
| 37 | #ifndef _NET_TIPC_BEARER_H_ | ||
| 38 | #define _NET_TIPC_BEARER_H_ | ||
| 39 | |||
| 40 | #ifdef __KERNEL__ | ||
| 41 | |||
| 42 | #include <linux/tipc_config.h> | ||
| 43 | #include <linux/skbuff.h> | ||
| 44 | #include <linux/spinlock.h> | ||
| 45 | |||
| 46 | /* | ||
| 47 | * Identifiers of supported TIPC media types | ||
| 48 | */ | ||
| 49 | |||
| 50 | #define TIPC_MEDIA_TYPE_ETH 1 | ||
| 51 | |||
| 52 | /* | ||
| 53 | * Destination address structure used by TIPC bearers when sending messages | ||
| 54 | * | ||
| 55 | * IMPORTANT: The fields of this structure MUST be stored using the specified | ||
| 56 | * byte order indicated below, as the structure is exchanged between nodes | ||
| 57 | * as part of a link setup process. | ||
| 58 | */ | ||
| 59 | |||
| 60 | struct tipc_media_addr { | ||
| 61 | __be32 type; /* bearer type (network byte order) */ | ||
| 62 | union { | ||
| 63 | __u8 eth_addr[6]; /* 48 bit Ethernet addr (byte array) */ | ||
| 64 | #if 0 | ||
| 65 | /* Prototypes for other possible bearer types */ | ||
| 66 | |||
| 67 | struct { | ||
| 68 | __u16 sin_family; | ||
| 69 | __u16 sin_port; | ||
| 70 | struct { | ||
| 71 | __u32 s_addr; | ||
| 72 | } sin_addr; | ||
| 73 | char pad[4]; | ||
| 74 | } addr_in; /* IP-based bearer */ | ||
| 75 | __u16 sock_descr; /* generic socket bearer */ | ||
| 76 | #endif | ||
| 77 | } dev_addr; | ||
| 78 | }; | ||
| 79 | |||
| 80 | /** | ||
| 81 | * struct tipc_bearer - TIPC bearer info available to privileged users | ||
| 82 | * @usr_handle: pointer to additional user-defined information about bearer | ||
| 83 | * @mtu: max packet size bearer can support | ||
| 84 | * @blocked: non-zero if bearer is blocked | ||
| 85 | * @lock: spinlock for controlling access to bearer | ||
| 86 | * @addr: media-specific address associated with bearer | ||
| 87 | * @name: bearer name (format = media:interface) | ||
| 88 | * | ||
| 89 | * Note: TIPC initializes "name" and "lock" fields; user is responsible for | ||
| 90 | * initialization all other fields when a bearer is enabled. | ||
| 91 | */ | ||
| 92 | |||
| 93 | struct tipc_bearer { | ||
| 94 | void *usr_handle; | ||
| 95 | u32 mtu; | ||
| 96 | int blocked; | ||
| 97 | spinlock_t lock; | ||
| 98 | struct tipc_media_addr addr; | ||
| 99 | char name[TIPC_MAX_BEARER_NAME]; | ||
| 100 | }; | ||
| 101 | |||
| 102 | /* | ||
| 103 | * TIPC routines available to supported media types | ||
| 104 | */ | ||
| 105 | |||
| 106 | int tipc_register_media(u32 media_type, | ||
| 107 | char *media_name, | ||
| 108 | int (*enable)(struct tipc_bearer *), | ||
| 109 | void (*disable)(struct tipc_bearer *), | ||
| 110 | int (*send_msg)(struct sk_buff *, | ||
| 111 | struct tipc_bearer *, | ||
| 112 | struct tipc_media_addr *), | ||
| 113 | char *(*addr2str)(struct tipc_media_addr *a, | ||
| 114 | char *str_buf, | ||
| 115 | int str_size), | ||
| 116 | struct tipc_media_addr *bcast_addr, | ||
| 117 | const u32 bearer_priority, | ||
| 118 | const u32 link_tolerance, /* [ms] */ | ||
| 119 | const u32 send_window_limit); | ||
| 120 | |||
| 121 | void tipc_recv_msg(struct sk_buff *buf, struct tipc_bearer *tb_ptr); | ||
| 122 | |||
| 123 | int tipc_block_bearer(const char *name); | ||
| 124 | void tipc_continue(struct tipc_bearer *tb_ptr); | ||
| 125 | |||
| 126 | int tipc_enable_bearer(const char *bearer_name, u32 bcast_scope, u32 priority); | ||
| 127 | int tipc_disable_bearer(const char *name); | ||
| 128 | |||
| 129 | /* | ||
| 130 | * Routines made available to TIPC by supported media types | ||
| 131 | */ | ||
| 132 | |||
| 133 | int tipc_eth_media_start(void); | ||
| 134 | void tipc_eth_media_stop(void); | ||
| 135 | |||
| 136 | #endif | ||
| 137 | |||
| 138 | #endif | ||
diff --git a/include/net/tipc/tipc_msg.h b/include/net/tipc/tipc_msg.h deleted file mode 100644 index ffe50b4e7b93..000000000000 --- a/include/net/tipc/tipc_msg.h +++ /dev/null | |||
| @@ -1,207 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * include/net/tipc/tipc_msg.h: Include file for privileged access to TIPC message headers | ||
| 3 | * | ||
| 4 | * Copyright (c) 2003-2006, Ericsson AB | ||
| 5 | * Copyright (c) 2005, Wind River Systems | ||
| 6 | * All rights reserved. | ||
| 7 | * | ||
| 8 | * Redistribution and use in source and binary forms, with or without | ||
| 9 | * modification, are permitted provided that the following conditions are met: | ||
| 10 | * | ||
| 11 | * 1. Redistributions of source code must retain the above copyright | ||
| 12 | * notice, this list of conditions and the following disclaimer. | ||
| 13 | * 2. Redistributions in binary form must reproduce the above copyright | ||
| 14 | * notice, this list of conditions and the following disclaimer in the | ||
| 15 | * documentation and/or other materials provided with the distribution. | ||
| 16 | * 3. Neither the names of the copyright holders nor the names of its | ||
| 17 | * contributors may be used to endorse or promote products derived from | ||
| 18 | * this software without specific prior written permission. | ||
| 19 | * | ||
| 20 | * Alternatively, this software may be distributed under the terms of the | ||
| 21 | * GNU General Public License ("GPL") version 2 as published by the Free | ||
| 22 | * Software Foundation. | ||
| 23 | * | ||
| 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
| 25 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
| 26 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
| 27 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE | ||
| 28 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | ||
| 29 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | ||
| 30 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | ||
| 31 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | ||
| 32 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
| 33 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
| 34 | * POSSIBILITY OF SUCH DAMAGE. | ||
| 35 | */ | ||
| 36 | |||
| 37 | #ifndef _NET_TIPC_MSG_H_ | ||
| 38 | #define _NET_TIPC_MSG_H_ | ||
| 39 | |||
| 40 | #ifdef __KERNEL__ | ||
| 41 | |||
| 42 | struct tipc_msg { | ||
| 43 | __be32 hdr[15]; | ||
| 44 | }; | ||
| 45 | |||
| 46 | |||
| 47 | /* | ||
| 48 | TIPC user data message header format, version 2: | ||
| 49 | |||
| 50 | |||
| 51 | 1 0 9 8 7 6 5 4|3 2 1 0 9 8 7 6|5 4 3 2 1 0 9 8|7 6 5 4 3 2 1 0 | ||
| 52 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||
| 53 | w0:|vers | user |hdr sz |n|d|s|-| message size | | ||
| 54 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||
| 55 | w1:|mstyp| error |rer cnt|lsc|opt p| broadcast ack no | | ||
| 56 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||
| 57 | w2:| link level ack no | broadcast/link level seq no | | ||
| 58 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||
| 59 | w3:| previous node | | ||
| 60 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||
| 61 | w4:| originating port | | ||
| 62 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||
| 63 | w5:| destination port | | ||
| 64 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||
| 65 | w6:| originating node | | ||
| 66 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||
| 67 | w7:| destination node | | ||
| 68 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||
| 69 | w8:| name type / transport sequence number | | ||
| 70 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||
| 71 | w9:| name instance/multicast lower bound | | ||
| 72 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||
| 73 | wA:| multicast upper bound | | ||
| 74 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||
| 75 | / / | ||
| 76 | \ options \ | ||
| 77 | / / | ||
| 78 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||
| 79 | |||
| 80 | */ | ||
| 81 | |||
| 82 | #define TIPC_CONN_MSG 0 | ||
| 83 | #define TIPC_MCAST_MSG 1 | ||
| 84 | #define TIPC_NAMED_MSG 2 | ||
| 85 | #define TIPC_DIRECT_MSG 3 | ||
| 86 | |||
| 87 | |||
| 88 | static inline u32 msg_word(struct tipc_msg *m, u32 pos) | ||
| 89 | { | ||
| 90 | return ntohl(m->hdr[pos]); | ||
| 91 | } | ||
| 92 | |||
| 93 | static inline u32 msg_bits(struct tipc_msg *m, u32 w, u32 pos, u32 mask) | ||
| 94 | { | ||
| 95 | return (msg_word(m, w) >> pos) & mask; | ||
| 96 | } | ||
| 97 | |||
| 98 | static inline u32 msg_importance(struct tipc_msg *m) | ||
| 99 | { | ||
| 100 | return msg_bits(m, 0, 25, 0xf); | ||
| 101 | } | ||
| 102 | |||
| 103 | static inline u32 msg_hdr_sz(struct tipc_msg *m) | ||
| 104 | { | ||
| 105 | return msg_bits(m, 0, 21, 0xf) << 2; | ||
| 106 | } | ||
| 107 | |||
| 108 | static inline int msg_short(struct tipc_msg *m) | ||
| 109 | { | ||
| 110 | return msg_hdr_sz(m) == 24; | ||
| 111 | } | ||
| 112 | |||
| 113 | static inline u32 msg_size(struct tipc_msg *m) | ||
| 114 | { | ||
| 115 | return msg_bits(m, 0, 0, 0x1ffff); | ||
| 116 | } | ||
| 117 | |||
| 118 | static inline u32 msg_data_sz(struct tipc_msg *m) | ||
| 119 | { | ||
| 120 | return msg_size(m) - msg_hdr_sz(m); | ||
| 121 | } | ||
| 122 | |||
| 123 | static inline unchar *msg_data(struct tipc_msg *m) | ||
| 124 | { | ||
| 125 | return ((unchar *)m) + msg_hdr_sz(m); | ||
| 126 | } | ||
| 127 | |||
| 128 | static inline u32 msg_type(struct tipc_msg *m) | ||
| 129 | { | ||
| 130 | return msg_bits(m, 1, 29, 0x7); | ||
| 131 | } | ||
| 132 | |||
| 133 | static inline u32 msg_named(struct tipc_msg *m) | ||
| 134 | { | ||
| 135 | return msg_type(m) == TIPC_NAMED_MSG; | ||
| 136 | } | ||
| 137 | |||
| 138 | static inline u32 msg_mcast(struct tipc_msg *m) | ||
| 139 | { | ||
| 140 | return msg_type(m) == TIPC_MCAST_MSG; | ||
| 141 | } | ||
| 142 | |||
| 143 | static inline u32 msg_connected(struct tipc_msg *m) | ||
| 144 | { | ||
| 145 | return msg_type(m) == TIPC_CONN_MSG; | ||
| 146 | } | ||
| 147 | |||
| 148 | static inline u32 msg_errcode(struct tipc_msg *m) | ||
| 149 | { | ||
| 150 | return msg_bits(m, 1, 25, 0xf); | ||
| 151 | } | ||
| 152 | |||
| 153 | static inline u32 msg_prevnode(struct tipc_msg *m) | ||
| 154 | { | ||
| 155 | return msg_word(m, 3); | ||
| 156 | } | ||
| 157 | |||
| 158 | static inline u32 msg_origport(struct tipc_msg *m) | ||
| 159 | { | ||
| 160 | return msg_word(m, 4); | ||
| 161 | } | ||
| 162 | |||
| 163 | static inline u32 msg_destport(struct tipc_msg *m) | ||
| 164 | { | ||
| 165 | return msg_word(m, 5); | ||
| 166 | } | ||
| 167 | |||
| 168 | static inline u32 msg_mc_netid(struct tipc_msg *m) | ||
| 169 | { | ||
| 170 | return msg_word(m, 5); | ||
| 171 | } | ||
| 172 | |||
| 173 | static inline u32 msg_orignode(struct tipc_msg *m) | ||
| 174 | { | ||
| 175 | if (likely(msg_short(m))) | ||
| 176 | return msg_prevnode(m); | ||
| 177 | return msg_word(m, 6); | ||
| 178 | } | ||
| 179 | |||
| 180 | static inline u32 msg_destnode(struct tipc_msg *m) | ||
| 181 | { | ||
| 182 | return msg_word(m, 7); | ||
| 183 | } | ||
| 184 | |||
| 185 | static inline u32 msg_nametype(struct tipc_msg *m) | ||
| 186 | { | ||
| 187 | return msg_word(m, 8); | ||
| 188 | } | ||
| 189 | |||
| 190 | static inline u32 msg_nameinst(struct tipc_msg *m) | ||
| 191 | { | ||
| 192 | return msg_word(m, 9); | ||
| 193 | } | ||
| 194 | |||
| 195 | static inline u32 msg_namelower(struct tipc_msg *m) | ||
| 196 | { | ||
| 197 | return msg_nameinst(m); | ||
| 198 | } | ||
| 199 | |||
| 200 | static inline u32 msg_nameupper(struct tipc_msg *m) | ||
| 201 | { | ||
| 202 | return msg_word(m, 10); | ||
| 203 | } | ||
| 204 | |||
| 205 | #endif | ||
| 206 | |||
| 207 | #endif | ||
diff --git a/include/net/tipc/tipc_port.h b/include/net/tipc/tipc_port.h deleted file mode 100644 index 1893aaf49426..000000000000 --- a/include/net/tipc/tipc_port.h +++ /dev/null | |||
| @@ -1,101 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * include/net/tipc/tipc_port.h: Include file for privileged access to TIPC ports | ||
| 3 | * | ||
| 4 | * Copyright (c) 1994-2007, Ericsson AB | ||
| 5 | * Copyright (c) 2005-2008, Wind River Systems | ||
| 6 | * All rights reserved. | ||
| 7 | * | ||
| 8 | * Redistribution and use in source and binary forms, with or without | ||
| 9 | * modification, are permitted provided that the following conditions are met: | ||
| 10 | * | ||
| 11 | * 1. Redistributions of source code must retain the above copyright | ||
| 12 | * notice, this list of conditions and the following disclaimer. | ||
| 13 | * 2. Redistributions in binary form must reproduce the above copyright | ||
| 14 | * notice, this list of conditions and the following disclaimer in the | ||
| 15 | * documentation and/or other materials provided with the distribution. | ||
| 16 | * 3. Neither the names of the copyright holders nor the names of its | ||
| 17 | * contributors may be used to endorse or promote products derived from | ||
| 18 | * this software without specific prior written permission. | ||
| 19 | * | ||
| 20 | * Alternatively, this software may be distributed under the terms of the | ||
| 21 | * GNU General Public License ("GPL") version 2 as published by the Free | ||
| 22 | * Software Foundation. | ||
| 23 | * | ||
| 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
| 25 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
| 26 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
| 27 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE | ||
| 28 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | ||
| 29 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | ||
| 30 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | ||
| 31 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | ||
| 32 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
| 33 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
| 34 | * POSSIBILITY OF SUCH DAMAGE. | ||
| 35 | */ | ||
| 36 | |||
| 37 | #ifndef _NET_TIPC_PORT_H_ | ||
| 38 | #define _NET_TIPC_PORT_H_ | ||
| 39 | |||
| 40 | #ifdef __KERNEL__ | ||
| 41 | |||
| 42 | #include <linux/tipc.h> | ||
| 43 | #include <linux/skbuff.h> | ||
| 44 | #include <net/tipc/tipc_msg.h> | ||
| 45 | |||
| 46 | #define TIPC_FLOW_CONTROL_WIN 512 | ||
| 47 | |||
| 48 | /** | ||
| 49 | * struct tipc_port - native TIPC port info available to privileged users | ||
| 50 | * @usr_handle: pointer to additional user-defined information about port | ||
| 51 | * @lock: pointer to spinlock for controlling access to port | ||
| 52 | * @connected: non-zero if port is currently connected to a peer port | ||
| 53 | * @conn_type: TIPC type used when connection was established | ||
| 54 | * @conn_instance: TIPC instance used when connection was established | ||
| 55 | * @conn_unacked: number of unacknowledged messages received from peer port | ||
| 56 | * @published: non-zero if port has one or more associated names | ||
| 57 | * @congested: non-zero if cannot send because of link or port congestion | ||
| 58 | * @max_pkt: maximum packet size "hint" used when building messages sent by port | ||
| 59 | * @ref: unique reference to port in TIPC object registry | ||
| 60 | * @phdr: preformatted message header used when sending messages | ||
| 61 | */ | ||
| 62 | |||
| 63 | struct tipc_port { | ||
| 64 | void *usr_handle; | ||
| 65 | spinlock_t *lock; | ||
| 66 | int connected; | ||
| 67 | u32 conn_type; | ||
| 68 | u32 conn_instance; | ||
| 69 | u32 conn_unacked; | ||
| 70 | int published; | ||
| 71 | u32 congested; | ||
| 72 | u32 max_pkt; | ||
| 73 | u32 ref; | ||
| 74 | struct tipc_msg phdr; | ||
| 75 | }; | ||
| 76 | |||
| 77 | |||
| 78 | struct tipc_port *tipc_createport_raw(void *usr_handle, | ||
| 79 | u32 (*dispatcher)(struct tipc_port *, struct sk_buff *), | ||
| 80 | void (*wakeup)(struct tipc_port *), | ||
| 81 | const u32 importance); | ||
| 82 | |||
| 83 | int tipc_reject_msg(struct sk_buff *buf, u32 err); | ||
| 84 | |||
| 85 | int tipc_send_buf_fast(struct sk_buff *buf, u32 destnode); | ||
| 86 | |||
| 87 | void tipc_acknowledge(u32 port_ref,u32 ack); | ||
| 88 | |||
| 89 | struct tipc_port *tipc_get_port(const u32 ref); | ||
| 90 | |||
| 91 | /* | ||
| 92 | * The following routines require that the port be locked on entry | ||
| 93 | */ | ||
| 94 | |||
| 95 | int tipc_disconnect_port(struct tipc_port *tp_ptr); | ||
| 96 | |||
| 97 | |||
| 98 | #endif | ||
| 99 | |||
| 100 | #endif | ||
| 101 | |||
diff --git a/include/net/udp.h b/include/net/udp.h index 200b82848c9a..bb967dd59bf7 100644 --- a/include/net/udp.h +++ b/include/net/udp.h | |||
| @@ -105,10 +105,10 @@ static inline struct udp_hslot *udp_hashslot2(struct udp_table *table, | |||
| 105 | 105 | ||
| 106 | extern struct proto udp_prot; | 106 | extern struct proto udp_prot; |
| 107 | 107 | ||
| 108 | extern atomic_t udp_memory_allocated; | 108 | extern atomic_long_t udp_memory_allocated; |
| 109 | 109 | ||
| 110 | /* sysctl variables for udp */ | 110 | /* sysctl variables for udp */ |
| 111 | extern int sysctl_udp_mem[3]; | 111 | extern long sysctl_udp_mem[3]; |
| 112 | extern int sysctl_udp_rmem_min; | 112 | extern int sysctl_udp_rmem_min; |
| 113 | extern int sysctl_udp_wmem_min; | 113 | extern int sysctl_udp_wmem_min; |
| 114 | 114 | ||
diff --git a/include/net/x25.h b/include/net/x25.h index 1479cb4a41fc..a06119a05129 100644 --- a/include/net/x25.h +++ b/include/net/x25.h | |||
| @@ -315,6 +315,8 @@ extern struct list_head x25_route_list; | |||
| 315 | extern rwlock_t x25_route_list_lock; | 315 | extern rwlock_t x25_route_list_lock; |
| 316 | extern struct list_head x25_forward_list; | 316 | extern struct list_head x25_forward_list; |
| 317 | extern rwlock_t x25_forward_list_lock; | 317 | extern rwlock_t x25_forward_list_lock; |
| 318 | extern struct list_head x25_neigh_list; | ||
| 319 | extern rwlock_t x25_neigh_list_lock; | ||
| 318 | 320 | ||
| 319 | extern int x25_proc_init(void); | 321 | extern int x25_proc_init(void); |
| 320 | extern void x25_proc_exit(void); | 322 | extern void x25_proc_exit(void); |
diff --git a/include/net/xfrm.h b/include/net/xfrm.h index bcfb6b24b019..b9f385da758e 100644 --- a/include/net/xfrm.h +++ b/include/net/xfrm.h | |||
| @@ -143,6 +143,7 @@ struct xfrm_state { | |||
| 143 | struct xfrm_id id; | 143 | struct xfrm_id id; |
| 144 | struct xfrm_selector sel; | 144 | struct xfrm_selector sel; |
| 145 | struct xfrm_mark mark; | 145 | struct xfrm_mark mark; |
| 146 | u32 tfcpad; | ||
| 146 | 147 | ||
| 147 | u32 genid; | 148 | u32 genid; |
| 148 | 149 | ||
| @@ -805,6 +806,9 @@ __be16 xfrm_flowi_sport(struct flowi *fl) | |||
| 805 | case IPPROTO_MH: | 806 | case IPPROTO_MH: |
| 806 | port = htons(fl->fl_mh_type); | 807 | port = htons(fl->fl_mh_type); |
| 807 | break; | 808 | break; |
| 809 | case IPPROTO_GRE: | ||
| 810 | port = htons(ntohl(fl->fl_gre_key) >> 16); | ||
| 811 | break; | ||
| 808 | default: | 812 | default: |
| 809 | port = 0; /*XXX*/ | 813 | port = 0; /*XXX*/ |
| 810 | } | 814 | } |
| @@ -826,6 +830,9 @@ __be16 xfrm_flowi_dport(struct flowi *fl) | |||
| 826 | case IPPROTO_ICMPV6: | 830 | case IPPROTO_ICMPV6: |
| 827 | port = htons(fl->fl_icmp_code); | 831 | port = htons(fl->fl_icmp_code); |
| 828 | break; | 832 | break; |
| 833 | case IPPROTO_GRE: | ||
| 834 | port = htons(ntohl(fl->fl_gre_key) & 0xffff); | ||
| 835 | break; | ||
| 829 | default: | 836 | default: |
| 830 | port = 0; /*XXX*/ | 837 | port = 0; /*XXX*/ |
| 831 | } | 838 | } |
