diff options
Diffstat (limited to 'include/net')
29 files changed, 1021 insertions, 234 deletions
diff --git a/include/net/af_unix.h b/include/net/af_unix.h index b5f8988e4283..0a996a3517ed 100644 --- a/include/net/af_unix.h +++ b/include/net/af_unix.h | |||
@@ -53,7 +53,6 @@ struct unix_sock { | |||
53 | struct path path; | 53 | struct path path; |
54 | struct mutex readlock; | 54 | struct mutex readlock; |
55 | struct sock *peer; | 55 | struct sock *peer; |
56 | struct sock *other; | ||
57 | struct list_head link; | 56 | struct list_head link; |
58 | atomic_long_t inflight; | 57 | atomic_long_t inflight; |
59 | spinlock_t lock; | 58 | spinlock_t lock; |
diff --git a/include/net/bluetooth/a2mp.h b/include/net/bluetooth/a2mp.h index 6a76e0a0705e..42f21766c538 100644 --- a/include/net/bluetooth/a2mp.h +++ b/include/net/bluetooth/a2mp.h | |||
@@ -19,13 +19,25 @@ | |||
19 | 19 | ||
20 | #define A2MP_FEAT_EXT 0x8000 | 20 | #define A2MP_FEAT_EXT 0x8000 |
21 | 21 | ||
22 | enum amp_mgr_state { | ||
23 | READ_LOC_AMP_INFO, | ||
24 | READ_LOC_AMP_ASSOC, | ||
25 | READ_LOC_AMP_ASSOC_FINAL, | ||
26 | }; | ||
27 | |||
22 | struct amp_mgr { | 28 | struct amp_mgr { |
29 | struct list_head list; | ||
23 | struct l2cap_conn *l2cap_conn; | 30 | struct l2cap_conn *l2cap_conn; |
24 | struct l2cap_chan *a2mp_chan; | 31 | struct l2cap_chan *a2mp_chan; |
32 | struct l2cap_chan *bredr_chan; | ||
25 | struct kref kref; | 33 | struct kref kref; |
26 | __u8 ident; | 34 | __u8 ident; |
27 | __u8 handle; | 35 | __u8 handle; |
36 | enum amp_mgr_state state; | ||
28 | unsigned long flags; | 37 | unsigned long flags; |
38 | |||
39 | struct list_head amp_ctrls; | ||
40 | struct mutex amp_ctrls_lock; | ||
29 | }; | 41 | }; |
30 | 42 | ||
31 | struct a2mp_cmd { | 43 | struct a2mp_cmd { |
@@ -118,9 +130,19 @@ struct a2mp_physlink_rsp { | |||
118 | #define A2MP_STATUS_PHYS_LINK_EXISTS 0x05 | 130 | #define A2MP_STATUS_PHYS_LINK_EXISTS 0x05 |
119 | #define A2MP_STATUS_SECURITY_VIOLATION 0x06 | 131 | #define A2MP_STATUS_SECURITY_VIOLATION 0x06 |
120 | 132 | ||
121 | void amp_mgr_get(struct amp_mgr *mgr); | 133 | extern struct list_head amp_mgr_list; |
134 | extern struct mutex amp_mgr_list_lock; | ||
135 | |||
136 | struct amp_mgr *amp_mgr_get(struct amp_mgr *mgr); | ||
122 | int amp_mgr_put(struct amp_mgr *mgr); | 137 | int amp_mgr_put(struct amp_mgr *mgr); |
138 | u8 __next_ident(struct amp_mgr *mgr); | ||
123 | struct l2cap_chan *a2mp_channel_create(struct l2cap_conn *conn, | 139 | struct l2cap_chan *a2mp_channel_create(struct l2cap_conn *conn, |
124 | struct sk_buff *skb); | 140 | struct sk_buff *skb); |
141 | struct amp_mgr *amp_mgr_lookup_by_state(u8 state); | ||
142 | void a2mp_send(struct amp_mgr *mgr, u8 code, u8 ident, u16 len, void *data); | ||
143 | void a2mp_discover_amp(struct l2cap_chan *chan); | ||
144 | void a2mp_send_getinfo_rsp(struct hci_dev *hdev); | ||
145 | void a2mp_send_getampassoc_rsp(struct hci_dev *hdev, u8 status); | ||
146 | void a2mp_send_create_phy_link_req(struct hci_dev *hdev, u8 status); | ||
125 | 147 | ||
126 | #endif /* __A2MP_H */ | 148 | #endif /* __A2MP_H */ |
diff --git a/include/net/bluetooth/amp.h b/include/net/bluetooth/amp.h new file mode 100644 index 000000000000..7ea3db77ba89 --- /dev/null +++ b/include/net/bluetooth/amp.h | |||
@@ -0,0 +1,54 @@ | |||
1 | /* | ||
2 | Copyright (c) 2011,2012 Intel Corp. | ||
3 | |||
4 | This program is free software; you can redistribute it and/or modify | ||
5 | it under the terms of the GNU General Public License version 2 and | ||
6 | only version 2 as published by the Free Software Foundation. | ||
7 | |||
8 | This program is distributed in the hope that it will be useful, | ||
9 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
11 | GNU General Public License for more details. | ||
12 | */ | ||
13 | |||
14 | #ifndef __AMP_H | ||
15 | #define __AMP_H | ||
16 | |||
17 | struct amp_ctrl { | ||
18 | struct list_head list; | ||
19 | struct kref kref; | ||
20 | __u8 id; | ||
21 | __u16 assoc_len_so_far; | ||
22 | __u16 assoc_rem_len; | ||
23 | __u16 assoc_len; | ||
24 | __u8 *assoc; | ||
25 | }; | ||
26 | |||
27 | int amp_ctrl_put(struct amp_ctrl *ctrl); | ||
28 | void amp_ctrl_get(struct amp_ctrl *ctrl); | ||
29 | struct amp_ctrl *amp_ctrl_add(struct amp_mgr *mgr, u8 id); | ||
30 | struct amp_ctrl *amp_ctrl_lookup(struct amp_mgr *mgr, u8 id); | ||
31 | void amp_ctrl_list_flush(struct amp_mgr *mgr); | ||
32 | |||
33 | struct hci_conn *phylink_add(struct hci_dev *hdev, struct amp_mgr *mgr, | ||
34 | u8 remote_id, bool out); | ||
35 | |||
36 | int phylink_gen_key(struct hci_conn *hcon, u8 *data, u8 *len, u8 *type); | ||
37 | |||
38 | void amp_read_loc_info(struct hci_dev *hdev, struct amp_mgr *mgr); | ||
39 | void amp_read_loc_assoc_frag(struct hci_dev *hdev, u8 phy_handle); | ||
40 | void amp_read_loc_assoc(struct hci_dev *hdev, struct amp_mgr *mgr); | ||
41 | void amp_read_loc_assoc_final_data(struct hci_dev *hdev, | ||
42 | struct hci_conn *hcon); | ||
43 | void amp_create_phylink(struct hci_dev *hdev, struct amp_mgr *mgr, | ||
44 | struct hci_conn *hcon); | ||
45 | void amp_accept_phylink(struct hci_dev *hdev, struct amp_mgr *mgr, | ||
46 | struct hci_conn *hcon); | ||
47 | void amp_write_remote_assoc(struct hci_dev *hdev, u8 handle); | ||
48 | void amp_write_rem_assoc_continue(struct hci_dev *hdev, u8 handle); | ||
49 | void amp_physical_cfm(struct hci_conn *bredr_hcon, struct hci_conn *hs_hcon); | ||
50 | void amp_create_logical_link(struct l2cap_chan *chan); | ||
51 | void amp_disconnect_logical_link(struct hci_chan *hchan); | ||
52 | void amp_destroy_logical_link(struct hci_chan *hchan, u8 reason); | ||
53 | |||
54 | #endif /* __AMP_H */ | ||
diff --git a/include/net/bluetooth/bluetooth.h b/include/net/bluetooth/bluetooth.h index ede036977ae8..2554b3f5222a 100644 --- a/include/net/bluetooth/bluetooth.h +++ b/include/net/bluetooth/bluetooth.h | |||
@@ -180,7 +180,6 @@ static inline void bacpy(bdaddr_t *dst, bdaddr_t *src) | |||
180 | } | 180 | } |
181 | 181 | ||
182 | void baswap(bdaddr_t *dst, bdaddr_t *src); | 182 | void baswap(bdaddr_t *dst, bdaddr_t *src); |
183 | char *batostr(bdaddr_t *ba); | ||
184 | 183 | ||
185 | /* Common socket structures and functions */ | 184 | /* Common socket structures and functions */ |
186 | 185 | ||
diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h index 76b2b6bdcf36..45eee08157bb 100644 --- a/include/net/bluetooth/hci.h +++ b/include/net/bluetooth/hci.h | |||
@@ -33,6 +33,8 @@ | |||
33 | #define HCI_LINK_KEY_SIZE 16 | 33 | #define HCI_LINK_KEY_SIZE 16 |
34 | #define HCI_AMP_LINK_KEY_SIZE (2 * HCI_LINK_KEY_SIZE) | 34 | #define HCI_AMP_LINK_KEY_SIZE (2 * HCI_LINK_KEY_SIZE) |
35 | 35 | ||
36 | #define HCI_MAX_AMP_ASSOC_SIZE 672 | ||
37 | |||
36 | /* HCI dev events */ | 38 | /* HCI dev events */ |
37 | #define HCI_DEV_REG 1 | 39 | #define HCI_DEV_REG 1 |
38 | #define HCI_DEV_UNREG 2 | 40 | #define HCI_DEV_UNREG 2 |
@@ -113,6 +115,7 @@ enum { | |||
113 | HCI_SSP_ENABLED, | 115 | HCI_SSP_ENABLED, |
114 | HCI_HS_ENABLED, | 116 | HCI_HS_ENABLED, |
115 | HCI_LE_ENABLED, | 117 | HCI_LE_ENABLED, |
118 | HCI_LE_PERIPHERAL, | ||
116 | HCI_CONNECTABLE, | 119 | HCI_CONNECTABLE, |
117 | HCI_DISCOVERABLE, | 120 | HCI_DISCOVERABLE, |
118 | HCI_LINK_SECURITY, | 121 | HCI_LINK_SECURITY, |
@@ -151,7 +154,7 @@ enum { | |||
151 | #define HCI_DISCONN_TIMEOUT msecs_to_jiffies(2000) /* 2 seconds */ | 154 | #define HCI_DISCONN_TIMEOUT msecs_to_jiffies(2000) /* 2 seconds */ |
152 | #define HCI_PAIRING_TIMEOUT msecs_to_jiffies(60000) /* 60 seconds */ | 155 | #define HCI_PAIRING_TIMEOUT msecs_to_jiffies(60000) /* 60 seconds */ |
153 | #define HCI_INIT_TIMEOUT msecs_to_jiffies(10000) /* 10 seconds */ | 156 | #define HCI_INIT_TIMEOUT msecs_to_jiffies(10000) /* 10 seconds */ |
154 | #define HCI_CMD_TIMEOUT msecs_to_jiffies(1000) /* 1 second */ | 157 | #define HCI_CMD_TIMEOUT msecs_to_jiffies(2000) /* 2 seconds */ |
155 | #define HCI_ACL_TX_TIMEOUT msecs_to_jiffies(45000) /* 45 seconds */ | 158 | #define HCI_ACL_TX_TIMEOUT msecs_to_jiffies(45000) /* 45 seconds */ |
156 | #define HCI_AUTO_OFF_TIMEOUT msecs_to_jiffies(2000) /* 2 seconds */ | 159 | #define HCI_AUTO_OFF_TIMEOUT msecs_to_jiffies(2000) /* 2 seconds */ |
157 | 160 | ||
@@ -196,6 +199,7 @@ enum { | |||
196 | #define ACL_START_NO_FLUSH 0x00 | 199 | #define ACL_START_NO_FLUSH 0x00 |
197 | #define ACL_CONT 0x01 | 200 | #define ACL_CONT 0x01 |
198 | #define ACL_START 0x02 | 201 | #define ACL_START 0x02 |
202 | #define ACL_COMPLETE 0x03 | ||
199 | #define ACL_ACTIVE_BCAST 0x04 | 203 | #define ACL_ACTIVE_BCAST 0x04 |
200 | #define ACL_PICO_BCAST 0x08 | 204 | #define ACL_PICO_BCAST 0x08 |
201 | 205 | ||
@@ -205,6 +209,7 @@ enum { | |||
205 | #define ESCO_LINK 0x02 | 209 | #define ESCO_LINK 0x02 |
206 | /* Low Energy links do not have defined link type. Use invented one */ | 210 | /* Low Energy links do not have defined link type. Use invented one */ |
207 | #define LE_LINK 0x80 | 211 | #define LE_LINK 0x80 |
212 | #define AMP_LINK 0x81 | ||
208 | 213 | ||
209 | /* LMP features */ | 214 | /* LMP features */ |
210 | #define LMP_3SLOT 0x01 | 215 | #define LMP_3SLOT 0x01 |
@@ -314,6 +319,9 @@ enum { | |||
314 | #define HCI_FLOW_CTL_MODE_PACKET_BASED 0x00 | 319 | #define HCI_FLOW_CTL_MODE_PACKET_BASED 0x00 |
315 | #define HCI_FLOW_CTL_MODE_BLOCK_BASED 0x01 | 320 | #define HCI_FLOW_CTL_MODE_BLOCK_BASED 0x01 |
316 | 321 | ||
322 | /* The core spec defines 127 as the "not available" value */ | ||
323 | #define HCI_TX_POWER_INVALID 127 | ||
324 | |||
317 | /* Extended Inquiry Response field types */ | 325 | /* Extended Inquiry Response field types */ |
318 | #define EIR_FLAGS 0x01 /* flags */ | 326 | #define EIR_FLAGS 0x01 /* flags */ |
319 | #define EIR_UUID16_SOME 0x02 /* 16-bit UUID, more available */ | 327 | #define EIR_UUID16_SOME 0x02 /* 16-bit UUID, more available */ |
@@ -330,6 +338,13 @@ enum { | |||
330 | #define EIR_SSP_RAND_R 0x0F /* Simple Pairing Randomizer R */ | 338 | #define EIR_SSP_RAND_R 0x0F /* Simple Pairing Randomizer R */ |
331 | #define EIR_DEVICE_ID 0x10 /* device ID */ | 339 | #define EIR_DEVICE_ID 0x10 /* device ID */ |
332 | 340 | ||
341 | /* Low Energy Advertising Flags */ | ||
342 | #define LE_AD_LIMITED 0x01 /* Limited Discoverable */ | ||
343 | #define LE_AD_GENERAL 0x02 /* General Discoverable */ | ||
344 | #define LE_AD_NO_BREDR 0x04 /* BR/EDR not supported */ | ||
345 | #define LE_AD_SIM_LE_BREDR_CTRL 0x08 /* Simultaneous LE & BR/EDR Controller */ | ||
346 | #define LE_AD_SIM_LE_BREDR_HOST 0x10 /* Simultaneous LE & BR/EDR Host */ | ||
347 | |||
333 | /* ----- HCI Commands ---- */ | 348 | /* ----- HCI Commands ---- */ |
334 | #define HCI_OP_NOP 0x0000 | 349 | #define HCI_OP_NOP 0x0000 |
335 | 350 | ||
@@ -556,12 +571,46 @@ struct hci_cp_accept_phy_link { | |||
556 | __u8 key[HCI_AMP_LINK_KEY_SIZE]; | 571 | __u8 key[HCI_AMP_LINK_KEY_SIZE]; |
557 | } __packed; | 572 | } __packed; |
558 | 573 | ||
559 | #define HCI_OP_DISCONN_PHY_LINK 0x0437 | 574 | #define HCI_OP_DISCONN_PHY_LINK 0x0437 |
560 | struct hci_cp_disconn_phy_link { | 575 | struct hci_cp_disconn_phy_link { |
561 | __u8 phy_handle; | 576 | __u8 phy_handle; |
562 | __u8 reason; | 577 | __u8 reason; |
563 | } __packed; | 578 | } __packed; |
564 | 579 | ||
580 | struct ext_flow_spec { | ||
581 | __u8 id; | ||
582 | __u8 stype; | ||
583 | __le16 msdu; | ||
584 | __le32 sdu_itime; | ||
585 | __le32 acc_lat; | ||
586 | __le32 flush_to; | ||
587 | } __packed; | ||
588 | |||
589 | #define HCI_OP_CREATE_LOGICAL_LINK 0x0438 | ||
590 | #define HCI_OP_ACCEPT_LOGICAL_LINK 0x0439 | ||
591 | struct hci_cp_create_accept_logical_link { | ||
592 | __u8 phy_handle; | ||
593 | struct ext_flow_spec tx_flow_spec; | ||
594 | struct ext_flow_spec rx_flow_spec; | ||
595 | } __packed; | ||
596 | |||
597 | #define HCI_OP_DISCONN_LOGICAL_LINK 0x043a | ||
598 | struct hci_cp_disconn_logical_link { | ||
599 | __le16 log_handle; | ||
600 | } __packed; | ||
601 | |||
602 | #define HCI_OP_LOGICAL_LINK_CANCEL 0x043b | ||
603 | struct hci_cp_logical_link_cancel { | ||
604 | __u8 phy_handle; | ||
605 | __u8 flow_spec_id; | ||
606 | } __packed; | ||
607 | |||
608 | struct hci_rp_logical_link_cancel { | ||
609 | __u8 status; | ||
610 | __u8 phy_handle; | ||
611 | __u8 flow_spec_id; | ||
612 | } __packed; | ||
613 | |||
565 | #define HCI_OP_SNIFF_MODE 0x0803 | 614 | #define HCI_OP_SNIFF_MODE 0x0803 |
566 | struct hci_cp_sniff_mode { | 615 | struct hci_cp_sniff_mode { |
567 | __le16 handle; | 616 | __le16 handle; |
@@ -894,6 +943,22 @@ struct hci_rp_le_read_buffer_size { | |||
894 | __u8 le_max_pkt; | 943 | __u8 le_max_pkt; |
895 | } __packed; | 944 | } __packed; |
896 | 945 | ||
946 | #define HCI_OP_LE_READ_ADV_TX_POWER 0x2007 | ||
947 | struct hci_rp_le_read_adv_tx_power { | ||
948 | __u8 status; | ||
949 | __s8 tx_power; | ||
950 | } __packed; | ||
951 | |||
952 | #define HCI_MAX_AD_LENGTH 31 | ||
953 | |||
954 | #define HCI_OP_LE_SET_ADV_DATA 0x2008 | ||
955 | struct hci_cp_le_set_adv_data { | ||
956 | __u8 length; | ||
957 | __u8 data[HCI_MAX_AD_LENGTH]; | ||
958 | } __packed; | ||
959 | |||
960 | #define HCI_OP_LE_SET_ADV_ENABLE 0x200a | ||
961 | |||
897 | #define HCI_OP_LE_SET_SCAN_PARAM 0x200b | 962 | #define HCI_OP_LE_SET_SCAN_PARAM 0x200b |
898 | struct hci_cp_le_set_scan_param { | 963 | struct hci_cp_le_set_scan_param { |
899 | __u8 type; | 964 | __u8 type; |
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h index e7d454609881..ef5b85dac3f7 100644 --- a/include/net/bluetooth/hci_core.h +++ b/include/net/bluetooth/hci_core.h | |||
@@ -73,6 +73,7 @@ struct discovery_state { | |||
73 | struct hci_conn_hash { | 73 | struct hci_conn_hash { |
74 | struct list_head list; | 74 | struct list_head list; |
75 | unsigned int acl_num; | 75 | unsigned int acl_num; |
76 | unsigned int amp_num; | ||
76 | unsigned int sco_num; | 77 | unsigned int sco_num; |
77 | unsigned int le_num; | 78 | unsigned int le_num; |
78 | }; | 79 | }; |
@@ -124,6 +125,14 @@ struct le_scan_params { | |||
124 | 125 | ||
125 | #define HCI_MAX_SHORT_NAME_LENGTH 10 | 126 | #define HCI_MAX_SHORT_NAME_LENGTH 10 |
126 | 127 | ||
128 | struct amp_assoc { | ||
129 | __u16 len; | ||
130 | __u16 offset; | ||
131 | __u16 rem_len; | ||
132 | __u16 len_so_far; | ||
133 | __u8 data[HCI_MAX_AMP_ASSOC_SIZE]; | ||
134 | }; | ||
135 | |||
127 | #define NUM_REASSEMBLY 4 | 136 | #define NUM_REASSEMBLY 4 |
128 | struct hci_dev { | 137 | struct hci_dev { |
129 | struct list_head list; | 138 | struct list_head list; |
@@ -177,6 +186,8 @@ struct hci_dev { | |||
177 | __u32 amp_max_flush_to; | 186 | __u32 amp_max_flush_to; |
178 | __u32 amp_be_flush_to; | 187 | __u32 amp_be_flush_to; |
179 | 188 | ||
189 | struct amp_assoc loc_assoc; | ||
190 | |||
180 | __u8 flow_ctl_mode; | 191 | __u8 flow_ctl_mode; |
181 | 192 | ||
182 | unsigned int auto_accept_delay; | 193 | unsigned int auto_accept_delay; |
@@ -252,8 +263,6 @@ struct hci_dev { | |||
252 | 263 | ||
253 | struct sk_buff_head driver_init; | 264 | struct sk_buff_head driver_init; |
254 | 265 | ||
255 | void *core_data; | ||
256 | |||
257 | atomic_t promisc; | 266 | atomic_t promisc; |
258 | 267 | ||
259 | struct dentry *debugfs; | 268 | struct dentry *debugfs; |
@@ -269,6 +278,10 @@ struct hci_dev { | |||
269 | struct work_struct le_scan; | 278 | struct work_struct le_scan; |
270 | struct le_scan_params le_scan_params; | 279 | struct le_scan_params le_scan_params; |
271 | 280 | ||
281 | __s8 adv_tx_power; | ||
282 | __u8 adv_data[HCI_MAX_AD_LENGTH]; | ||
283 | __u8 adv_data_len; | ||
284 | |||
272 | int (*open)(struct hci_dev *hdev); | 285 | int (*open)(struct hci_dev *hdev); |
273 | int (*close)(struct hci_dev *hdev); | 286 | int (*close)(struct hci_dev *hdev); |
274 | int (*flush)(struct hci_dev *hdev); | 287 | int (*flush)(struct hci_dev *hdev); |
@@ -277,6 +290,8 @@ struct hci_dev { | |||
277 | int (*ioctl)(struct hci_dev *hdev, unsigned int cmd, unsigned long arg); | 290 | int (*ioctl)(struct hci_dev *hdev, unsigned int cmd, unsigned long arg); |
278 | }; | 291 | }; |
279 | 292 | ||
293 | #define HCI_PHY_HANDLE(handle) (handle & 0xff) | ||
294 | |||
280 | struct hci_conn { | 295 | struct hci_conn { |
281 | struct list_head list; | 296 | struct list_head list; |
282 | 297 | ||
@@ -310,6 +325,7 @@ struct hci_conn { | |||
310 | 325 | ||
311 | __u8 remote_cap; | 326 | __u8 remote_cap; |
312 | __u8 remote_auth; | 327 | __u8 remote_auth; |
328 | __u8 remote_id; | ||
313 | bool flush_key; | 329 | bool flush_key; |
314 | 330 | ||
315 | unsigned int sent; | 331 | unsigned int sent; |
@@ -339,10 +355,11 @@ struct hci_conn { | |||
339 | 355 | ||
340 | struct hci_chan { | 356 | struct hci_chan { |
341 | struct list_head list; | 357 | struct list_head list; |
342 | 358 | __u16 handle; | |
343 | struct hci_conn *conn; | 359 | struct hci_conn *conn; |
344 | struct sk_buff_head data_q; | 360 | struct sk_buff_head data_q; |
345 | unsigned int sent; | 361 | unsigned int sent; |
362 | __u8 state; | ||
346 | }; | 363 | }; |
347 | 364 | ||
348 | extern struct list_head hci_dev_list; | 365 | extern struct list_head hci_dev_list; |
@@ -438,6 +455,9 @@ static inline void hci_conn_hash_add(struct hci_dev *hdev, struct hci_conn *c) | |||
438 | case ACL_LINK: | 455 | case ACL_LINK: |
439 | h->acl_num++; | 456 | h->acl_num++; |
440 | break; | 457 | break; |
458 | case AMP_LINK: | ||
459 | h->amp_num++; | ||
460 | break; | ||
441 | case LE_LINK: | 461 | case LE_LINK: |
442 | h->le_num++; | 462 | h->le_num++; |
443 | break; | 463 | break; |
@@ -459,6 +479,9 @@ static inline void hci_conn_hash_del(struct hci_dev *hdev, struct hci_conn *c) | |||
459 | case ACL_LINK: | 479 | case ACL_LINK: |
460 | h->acl_num--; | 480 | h->acl_num--; |
461 | break; | 481 | break; |
482 | case AMP_LINK: | ||
483 | h->amp_num--; | ||
484 | break; | ||
462 | case LE_LINK: | 485 | case LE_LINK: |
463 | h->le_num--; | 486 | h->le_num--; |
464 | break; | 487 | break; |
@@ -475,6 +498,8 @@ static inline unsigned int hci_conn_num(struct hci_dev *hdev, __u8 type) | |||
475 | switch (type) { | 498 | switch (type) { |
476 | case ACL_LINK: | 499 | case ACL_LINK: |
477 | return h->acl_num; | 500 | return h->acl_num; |
501 | case AMP_LINK: | ||
502 | return h->amp_num; | ||
478 | case LE_LINK: | 503 | case LE_LINK: |
479 | return h->le_num; | 504 | return h->le_num; |
480 | case SCO_LINK: | 505 | case SCO_LINK: |
@@ -556,6 +581,7 @@ void hci_conn_check_pending(struct hci_dev *hdev); | |||
556 | struct hci_chan *hci_chan_create(struct hci_conn *conn); | 581 | struct hci_chan *hci_chan_create(struct hci_conn *conn); |
557 | void hci_chan_del(struct hci_chan *chan); | 582 | void hci_chan_del(struct hci_chan *chan); |
558 | void hci_chan_list_flush(struct hci_conn *conn); | 583 | void hci_chan_list_flush(struct hci_conn *conn); |
584 | struct hci_chan *hci_chan_lookup_handle(struct hci_dev *hdev, __u16 handle); | ||
559 | 585 | ||
560 | struct hci_conn *hci_connect(struct hci_dev *hdev, int type, bdaddr_t *dst, | 586 | struct hci_conn *hci_connect(struct hci_dev *hdev, int type, bdaddr_t *dst, |
561 | __u8 dst_type, __u8 sec_level, __u8 auth_type); | 587 | __u8 dst_type, __u8 sec_level, __u8 auth_type); |
@@ -584,7 +610,10 @@ static inline void hci_conn_put(struct hci_conn *conn) | |||
584 | 610 | ||
585 | if (atomic_dec_and_test(&conn->refcnt)) { | 611 | if (atomic_dec_and_test(&conn->refcnt)) { |
586 | unsigned long timeo; | 612 | unsigned long timeo; |
587 | if (conn->type == ACL_LINK || conn->type == LE_LINK) { | 613 | |
614 | switch (conn->type) { | ||
615 | case ACL_LINK: | ||
616 | case LE_LINK: | ||
588 | del_timer(&conn->idle_timer); | 617 | del_timer(&conn->idle_timer); |
589 | if (conn->state == BT_CONNECTED) { | 618 | if (conn->state == BT_CONNECTED) { |
590 | timeo = conn->disc_timeout; | 619 | timeo = conn->disc_timeout; |
@@ -593,12 +622,20 @@ static inline void hci_conn_put(struct hci_conn *conn) | |||
593 | } else { | 622 | } else { |
594 | timeo = msecs_to_jiffies(10); | 623 | timeo = msecs_to_jiffies(10); |
595 | } | 624 | } |
596 | } else { | 625 | break; |
626 | |||
627 | case AMP_LINK: | ||
628 | timeo = conn->disc_timeout; | ||
629 | break; | ||
630 | |||
631 | default: | ||
597 | timeo = msecs_to_jiffies(10); | 632 | timeo = msecs_to_jiffies(10); |
633 | break; | ||
598 | } | 634 | } |
635 | |||
599 | cancel_delayed_work(&conn->disc_work); | 636 | cancel_delayed_work(&conn->disc_work); |
600 | queue_delayed_work(conn->hdev->workqueue, | 637 | queue_delayed_work(conn->hdev->workqueue, |
601 | &conn->disc_work, timeo); | 638 | &conn->disc_work, timeo); |
602 | } | 639 | } |
603 | } | 640 | } |
604 | 641 | ||
@@ -650,7 +687,7 @@ static inline uint8_t __hci_num_ctrl(void) | |||
650 | } | 687 | } |
651 | 688 | ||
652 | struct hci_dev *hci_dev_get(int index); | 689 | struct hci_dev *hci_dev_get(int index); |
653 | struct hci_dev *hci_get_route(bdaddr_t *src, bdaddr_t *dst); | 690 | struct hci_dev *hci_get_route(bdaddr_t *dst, bdaddr_t *src); |
654 | 691 | ||
655 | struct hci_dev *hci_alloc_dev(void); | 692 | struct hci_dev *hci_alloc_dev(void); |
656 | void hci_free_dev(struct hci_dev *hdev); | 693 | void hci_free_dev(struct hci_dev *hdev); |
@@ -699,6 +736,8 @@ int hci_add_remote_oob_data(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 *hash, | |||
699 | u8 *randomizer); | 736 | u8 *randomizer); |
700 | int hci_remove_remote_oob_data(struct hci_dev *hdev, bdaddr_t *bdaddr); | 737 | int hci_remove_remote_oob_data(struct hci_dev *hdev, bdaddr_t *bdaddr); |
701 | 738 | ||
739 | int hci_update_ad(struct hci_dev *hdev); | ||
740 | |||
702 | void hci_event_packet(struct hci_dev *hdev, struct sk_buff *skb); | 741 | void hci_event_packet(struct hci_dev *hdev, struct sk_buff *skb); |
703 | 742 | ||
704 | int hci_recv_frame(struct sk_buff *skb); | 743 | int hci_recv_frame(struct sk_buff *skb); |
@@ -715,18 +754,29 @@ void hci_conn_del_sysfs(struct hci_conn *conn); | |||
715 | #define SET_HCIDEV_DEV(hdev, pdev) ((hdev)->dev.parent = (pdev)) | 754 | #define SET_HCIDEV_DEV(hdev, pdev) ((hdev)->dev.parent = (pdev)) |
716 | 755 | ||
717 | /* ----- LMP capabilities ----- */ | 756 | /* ----- LMP capabilities ----- */ |
718 | #define lmp_rswitch_capable(dev) ((dev)->features[0] & LMP_RSWITCH) | ||
719 | #define lmp_encrypt_capable(dev) ((dev)->features[0] & LMP_ENCRYPT) | 757 | #define lmp_encrypt_capable(dev) ((dev)->features[0] & LMP_ENCRYPT) |
758 | #define lmp_rswitch_capable(dev) ((dev)->features[0] & LMP_RSWITCH) | ||
759 | #define lmp_hold_capable(dev) ((dev)->features[0] & LMP_HOLD) | ||
720 | #define lmp_sniff_capable(dev) ((dev)->features[0] & LMP_SNIFF) | 760 | #define lmp_sniff_capable(dev) ((dev)->features[0] & LMP_SNIFF) |
721 | #define lmp_sniffsubr_capable(dev) ((dev)->features[5] & LMP_SNIFF_SUBR) | 761 | #define lmp_park_capable(dev) ((dev)->features[1] & LMP_PARK) |
762 | #define lmp_inq_rssi_capable(dev) ((dev)->features[3] & LMP_RSSI_INQ) | ||
722 | #define lmp_esco_capable(dev) ((dev)->features[3] & LMP_ESCO) | 763 | #define lmp_esco_capable(dev) ((dev)->features[3] & LMP_ESCO) |
764 | #define lmp_bredr_capable(dev) (!((dev)->features[4] & LMP_NO_BREDR)) | ||
765 | #define lmp_le_capable(dev) ((dev)->features[4] & LMP_LE) | ||
766 | #define lmp_sniffsubr_capable(dev) ((dev)->features[5] & LMP_SNIFF_SUBR) | ||
767 | #define lmp_pause_enc_capable(dev) ((dev)->features[5] & LMP_PAUSE_ENC) | ||
768 | #define lmp_ext_inq_capable(dev) ((dev)->features[6] & LMP_EXT_INQ) | ||
769 | #define lmp_le_br_capable(dev) ((dev)->features[6] & LMP_SIMUL_LE_BR) | ||
723 | #define lmp_ssp_capable(dev) ((dev)->features[6] & LMP_SIMPLE_PAIR) | 770 | #define lmp_ssp_capable(dev) ((dev)->features[6] & LMP_SIMPLE_PAIR) |
724 | #define lmp_no_flush_capable(dev) ((dev)->features[6] & LMP_NO_FLUSH) | 771 | #define lmp_no_flush_capable(dev) ((dev)->features[6] & LMP_NO_FLUSH) |
725 | #define lmp_le_capable(dev) ((dev)->features[4] & LMP_LE) | 772 | #define lmp_lsto_capable(dev) ((dev)->features[7] & LMP_LSTO) |
726 | #define lmp_bredr_capable(dev) (!((dev)->features[4] & LMP_NO_BREDR)) | 773 | #define lmp_inq_tx_pwr_capable(dev) ((dev)->features[7] & LMP_INQ_TX_PWR) |
774 | #define lmp_ext_feat_capable(dev) ((dev)->features[7] & LMP_EXTFEATURES) | ||
727 | 775 | ||
728 | /* ----- Extended LMP capabilities ----- */ | 776 | /* ----- Extended LMP capabilities ----- */ |
777 | #define lmp_host_ssp_capable(dev) ((dev)->host_features[0] & LMP_HOST_SSP) | ||
729 | #define lmp_host_le_capable(dev) ((dev)->host_features[0] & LMP_HOST_LE) | 778 | #define lmp_host_le_capable(dev) ((dev)->host_features[0] & LMP_HOST_LE) |
779 | #define lmp_host_le_br_capable(dev) ((dev)->host_features[0] & LMP_HOST_LE_BREDR) | ||
730 | 780 | ||
731 | /* ----- HCI protocols ----- */ | 781 | /* ----- HCI protocols ----- */ |
732 | static inline int hci_proto_connect_ind(struct hci_dev *hdev, bdaddr_t *bdaddr, | 782 | static inline int hci_proto_connect_ind(struct hci_dev *hdev, bdaddr_t *bdaddr, |
@@ -789,6 +839,10 @@ static inline void hci_proto_disconn_cfm(struct hci_conn *conn, __u8 reason) | |||
789 | sco_disconn_cfm(conn, reason); | 839 | sco_disconn_cfm(conn, reason); |
790 | break; | 840 | break; |
791 | 841 | ||
842 | /* L2CAP would be handled for BREDR chan */ | ||
843 | case AMP_LINK: | ||
844 | break; | ||
845 | |||
792 | default: | 846 | default: |
793 | BT_ERR("unknown link type %d", conn->type); | 847 | BT_ERR("unknown link type %d", conn->type); |
794 | break; | 848 | break; |
@@ -841,7 +895,7 @@ struct hci_cb { | |||
841 | 895 | ||
842 | static inline void hci_auth_cfm(struct hci_conn *conn, __u8 status) | 896 | static inline void hci_auth_cfm(struct hci_conn *conn, __u8 status) |
843 | { | 897 | { |
844 | struct list_head *p; | 898 | struct hci_cb *cb; |
845 | __u8 encrypt; | 899 | __u8 encrypt; |
846 | 900 | ||
847 | hci_proto_auth_cfm(conn, status); | 901 | hci_proto_auth_cfm(conn, status); |
@@ -852,8 +906,7 @@ static inline void hci_auth_cfm(struct hci_conn *conn, __u8 status) | |||
852 | encrypt = (conn->link_mode & HCI_LM_ENCRYPT) ? 0x01 : 0x00; | 906 | encrypt = (conn->link_mode & HCI_LM_ENCRYPT) ? 0x01 : 0x00; |
853 | 907 | ||
854 | read_lock(&hci_cb_list_lock); | 908 | read_lock(&hci_cb_list_lock); |
855 | list_for_each(p, &hci_cb_list) { | 909 | list_for_each_entry(cb, &hci_cb_list, list) { |
856 | struct hci_cb *cb = list_entry(p, struct hci_cb, list); | ||
857 | if (cb->security_cfm) | 910 | if (cb->security_cfm) |
858 | cb->security_cfm(conn, status, encrypt); | 911 | cb->security_cfm(conn, status, encrypt); |
859 | } | 912 | } |
@@ -863,7 +916,7 @@ static inline void hci_auth_cfm(struct hci_conn *conn, __u8 status) | |||
863 | static inline void hci_encrypt_cfm(struct hci_conn *conn, __u8 status, | 916 | static inline void hci_encrypt_cfm(struct hci_conn *conn, __u8 status, |
864 | __u8 encrypt) | 917 | __u8 encrypt) |
865 | { | 918 | { |
866 | struct list_head *p; | 919 | struct hci_cb *cb; |
867 | 920 | ||
868 | if (conn->sec_level == BT_SECURITY_SDP) | 921 | if (conn->sec_level == BT_SECURITY_SDP) |
869 | conn->sec_level = BT_SECURITY_LOW; | 922 | conn->sec_level = BT_SECURITY_LOW; |
@@ -874,8 +927,7 @@ static inline void hci_encrypt_cfm(struct hci_conn *conn, __u8 status, | |||
874 | hci_proto_encrypt_cfm(conn, status, encrypt); | 927 | hci_proto_encrypt_cfm(conn, status, encrypt); |
875 | 928 | ||
876 | read_lock(&hci_cb_list_lock); | 929 | read_lock(&hci_cb_list_lock); |
877 | list_for_each(p, &hci_cb_list) { | 930 | list_for_each_entry(cb, &hci_cb_list, list) { |
878 | struct hci_cb *cb = list_entry(p, struct hci_cb, list); | ||
879 | if (cb->security_cfm) | 931 | if (cb->security_cfm) |
880 | cb->security_cfm(conn, status, encrypt); | 932 | cb->security_cfm(conn, status, encrypt); |
881 | } | 933 | } |
@@ -884,11 +936,10 @@ static inline void hci_encrypt_cfm(struct hci_conn *conn, __u8 status, | |||
884 | 936 | ||
885 | static inline void hci_key_change_cfm(struct hci_conn *conn, __u8 status) | 937 | static inline void hci_key_change_cfm(struct hci_conn *conn, __u8 status) |
886 | { | 938 | { |
887 | struct list_head *p; | 939 | struct hci_cb *cb; |
888 | 940 | ||
889 | read_lock(&hci_cb_list_lock); | 941 | read_lock(&hci_cb_list_lock); |
890 | list_for_each(p, &hci_cb_list) { | 942 | list_for_each_entry(cb, &hci_cb_list, list) { |
891 | struct hci_cb *cb = list_entry(p, struct hci_cb, list); | ||
892 | if (cb->key_change_cfm) | 943 | if (cb->key_change_cfm) |
893 | cb->key_change_cfm(conn, status); | 944 | cb->key_change_cfm(conn, status); |
894 | } | 945 | } |
@@ -898,11 +949,10 @@ static inline void hci_key_change_cfm(struct hci_conn *conn, __u8 status) | |||
898 | static inline void hci_role_switch_cfm(struct hci_conn *conn, __u8 status, | 949 | static inline void hci_role_switch_cfm(struct hci_conn *conn, __u8 status, |
899 | __u8 role) | 950 | __u8 role) |
900 | { | 951 | { |
901 | struct list_head *p; | 952 | struct hci_cb *cb; |
902 | 953 | ||
903 | read_lock(&hci_cb_list_lock); | 954 | read_lock(&hci_cb_list_lock); |
904 | list_for_each(p, &hci_cb_list) { | 955 | list_for_each_entry(cb, &hci_cb_list, list) { |
905 | struct hci_cb *cb = list_entry(p, struct hci_cb, list); | ||
906 | if (cb->role_switch_cfm) | 956 | if (cb->role_switch_cfm) |
907 | cb->role_switch_cfm(conn, status, role); | 957 | cb->role_switch_cfm(conn, status, role); |
908 | } | 958 | } |
diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h index 7ed8e356425a..f57fab04e7c5 100644 --- a/include/net/bluetooth/l2cap.h +++ b/include/net/bluetooth/l2cap.h | |||
@@ -32,13 +32,14 @@ | |||
32 | /* L2CAP defaults */ | 32 | /* L2CAP defaults */ |
33 | #define L2CAP_DEFAULT_MTU 672 | 33 | #define L2CAP_DEFAULT_MTU 672 |
34 | #define L2CAP_DEFAULT_MIN_MTU 48 | 34 | #define L2CAP_DEFAULT_MIN_MTU 48 |
35 | #define L2CAP_DEFAULT_FLUSH_TO 0xffff | 35 | #define L2CAP_DEFAULT_FLUSH_TO 0xFFFF |
36 | #define L2CAP_EFS_DEFAULT_FLUSH_TO 0xFFFFFFFF | ||
36 | #define L2CAP_DEFAULT_TX_WINDOW 63 | 37 | #define L2CAP_DEFAULT_TX_WINDOW 63 |
37 | #define L2CAP_DEFAULT_EXT_WINDOW 0x3FFF | 38 | #define L2CAP_DEFAULT_EXT_WINDOW 0x3FFF |
38 | #define L2CAP_DEFAULT_MAX_TX 3 | 39 | #define L2CAP_DEFAULT_MAX_TX 3 |
39 | #define L2CAP_DEFAULT_RETRANS_TO 2000 /* 2 seconds */ | 40 | #define L2CAP_DEFAULT_RETRANS_TO 2000 /* 2 seconds */ |
40 | #define L2CAP_DEFAULT_MONITOR_TO 12000 /* 12 seconds */ | 41 | #define L2CAP_DEFAULT_MONITOR_TO 12000 /* 12 seconds */ |
41 | #define L2CAP_DEFAULT_MAX_PDU_SIZE 1009 /* Sized for 3-DH5 packet */ | 42 | #define L2CAP_DEFAULT_MAX_PDU_SIZE 1492 /* Sized for AMP packet */ |
42 | #define L2CAP_DEFAULT_ACK_TO 200 | 43 | #define L2CAP_DEFAULT_ACK_TO 200 |
43 | #define L2CAP_DEFAULT_MAX_SDU_SIZE 0xFFFF | 44 | #define L2CAP_DEFAULT_MAX_SDU_SIZE 0xFFFF |
44 | #define L2CAP_DEFAULT_SDU_ITIME 0xFFFFFFFF | 45 | #define L2CAP_DEFAULT_SDU_ITIME 0xFFFFFFFF |
@@ -51,6 +52,8 @@ | |||
51 | #define L2CAP_ENC_TIMEOUT msecs_to_jiffies(5000) | 52 | #define L2CAP_ENC_TIMEOUT msecs_to_jiffies(5000) |
52 | #define L2CAP_CONN_TIMEOUT msecs_to_jiffies(40000) | 53 | #define L2CAP_CONN_TIMEOUT msecs_to_jiffies(40000) |
53 | #define L2CAP_INFO_TIMEOUT msecs_to_jiffies(4000) | 54 | #define L2CAP_INFO_TIMEOUT msecs_to_jiffies(4000) |
55 | #define L2CAP_MOVE_TIMEOUT msecs_to_jiffies(4000) | ||
56 | #define L2CAP_MOVE_ERTX_TIMEOUT msecs_to_jiffies(60000) | ||
54 | 57 | ||
55 | #define L2CAP_A2MP_DEFAULT_MTU 670 | 58 | #define L2CAP_A2MP_DEFAULT_MTU 670 |
56 | 59 | ||
@@ -433,6 +436,8 @@ struct l2cap_chan { | |||
433 | struct sock *sk; | 436 | struct sock *sk; |
434 | 437 | ||
435 | struct l2cap_conn *conn; | 438 | struct l2cap_conn *conn; |
439 | struct hci_conn *hs_hcon; | ||
440 | struct hci_chan *hs_hchan; | ||
436 | struct kref kref; | 441 | struct kref kref; |
437 | 442 | ||
438 | __u8 state; | 443 | __u8 state; |
@@ -476,6 +481,12 @@ struct l2cap_chan { | |||
476 | unsigned long conn_state; | 481 | unsigned long conn_state; |
477 | unsigned long flags; | 482 | unsigned long flags; |
478 | 483 | ||
484 | __u8 remote_amp_id; | ||
485 | __u8 local_amp_id; | ||
486 | __u8 move_id; | ||
487 | __u8 move_state; | ||
488 | __u8 move_role; | ||
489 | |||
479 | __u16 next_tx_seq; | 490 | __u16 next_tx_seq; |
480 | __u16 expected_ack_seq; | 491 | __u16 expected_ack_seq; |
481 | __u16 expected_tx_seq; | 492 | __u16 expected_tx_seq; |
@@ -538,6 +549,7 @@ struct l2cap_ops { | |||
538 | void (*state_change) (struct l2cap_chan *chan, | 549 | void (*state_change) (struct l2cap_chan *chan, |
539 | int state); | 550 | int state); |
540 | void (*ready) (struct l2cap_chan *chan); | 551 | void (*ready) (struct l2cap_chan *chan); |
552 | void (*defer) (struct l2cap_chan *chan); | ||
541 | struct sk_buff *(*alloc_skb) (struct l2cap_chan *chan, | 553 | struct sk_buff *(*alloc_skb) (struct l2cap_chan *chan, |
542 | unsigned long len, int nb); | 554 | unsigned long len, int nb); |
543 | }; | 555 | }; |
@@ -640,6 +652,9 @@ enum { | |||
640 | enum { | 652 | enum { |
641 | L2CAP_RX_STATE_RECV, | 653 | L2CAP_RX_STATE_RECV, |
642 | L2CAP_RX_STATE_SREJ_SENT, | 654 | L2CAP_RX_STATE_SREJ_SENT, |
655 | L2CAP_RX_STATE_MOVE, | ||
656 | L2CAP_RX_STATE_WAIT_P, | ||
657 | L2CAP_RX_STATE_WAIT_F, | ||
643 | }; | 658 | }; |
644 | 659 | ||
645 | enum { | 660 | enum { |
@@ -670,6 +685,25 @@ enum { | |||
670 | L2CAP_EV_RECV_FRAME, | 685 | L2CAP_EV_RECV_FRAME, |
671 | }; | 686 | }; |
672 | 687 | ||
688 | enum { | ||
689 | L2CAP_MOVE_ROLE_NONE, | ||
690 | L2CAP_MOVE_ROLE_INITIATOR, | ||
691 | L2CAP_MOVE_ROLE_RESPONDER, | ||
692 | }; | ||
693 | |||
694 | enum { | ||
695 | L2CAP_MOVE_STABLE, | ||
696 | L2CAP_MOVE_WAIT_REQ, | ||
697 | L2CAP_MOVE_WAIT_RSP, | ||
698 | L2CAP_MOVE_WAIT_RSP_SUCCESS, | ||
699 | L2CAP_MOVE_WAIT_CONFIRM, | ||
700 | L2CAP_MOVE_WAIT_CONFIRM_RSP, | ||
701 | L2CAP_MOVE_WAIT_LOGICAL_COMP, | ||
702 | L2CAP_MOVE_WAIT_LOGICAL_CFM, | ||
703 | L2CAP_MOVE_WAIT_LOCAL_BUSY, | ||
704 | L2CAP_MOVE_WAIT_PREPARE, | ||
705 | }; | ||
706 | |||
673 | void l2cap_chan_hold(struct l2cap_chan *c); | 707 | void l2cap_chan_hold(struct l2cap_chan *c); |
674 | void l2cap_chan_put(struct l2cap_chan *c); | 708 | void l2cap_chan_put(struct l2cap_chan *c); |
675 | 709 | ||
@@ -745,6 +779,10 @@ static inline void l2cap_chan_no_ready(struct l2cap_chan *chan) | |||
745 | { | 779 | { |
746 | } | 780 | } |
747 | 781 | ||
782 | static inline void l2cap_chan_no_defer(struct l2cap_chan *chan) | ||
783 | { | ||
784 | } | ||
785 | |||
748 | extern bool disable_ertm; | 786 | extern bool disable_ertm; |
749 | 787 | ||
750 | int l2cap_init_sockets(void); | 788 | int l2cap_init_sockets(void); |
@@ -767,6 +805,12 @@ int l2cap_chan_check_security(struct l2cap_chan *chan); | |||
767 | void l2cap_chan_set_defaults(struct l2cap_chan *chan); | 805 | void l2cap_chan_set_defaults(struct l2cap_chan *chan); |
768 | int l2cap_ertm_init(struct l2cap_chan *chan); | 806 | int l2cap_ertm_init(struct l2cap_chan *chan); |
769 | void l2cap_chan_add(struct l2cap_conn *conn, struct l2cap_chan *chan); | 807 | void l2cap_chan_add(struct l2cap_conn *conn, struct l2cap_chan *chan); |
808 | void __l2cap_chan_add(struct l2cap_conn *conn, struct l2cap_chan *chan); | ||
770 | void l2cap_chan_del(struct l2cap_chan *chan, int err); | 809 | void l2cap_chan_del(struct l2cap_chan *chan, int err); |
810 | void l2cap_send_conn_req(struct l2cap_chan *chan); | ||
811 | void l2cap_move_start(struct l2cap_chan *chan); | ||
812 | void l2cap_logical_cfm(struct l2cap_chan *chan, struct hci_chan *hchan, | ||
813 | u8 status); | ||
814 | void __l2cap_physical_cfm(struct l2cap_chan *chan, int result); | ||
771 | 815 | ||
772 | #endif /* __L2CAP_H */ | 816 | #endif /* __L2CAP_H */ |
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index 1b4989082244..e78db2cf3d1b 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h | |||
@@ -306,6 +306,88 @@ struct key_params { | |||
306 | }; | 306 | }; |
307 | 307 | ||
308 | /** | 308 | /** |
309 | * struct cfg80211_chan_def - channel definition | ||
310 | * @chan: the (control) channel | ||
311 | * @width: channel width | ||
312 | * @center_freq1: center frequency of first segment | ||
313 | * @center_freq2: center frequency of second segment | ||
314 | * (only with 80+80 MHz) | ||
315 | */ | ||
316 | struct cfg80211_chan_def { | ||
317 | struct ieee80211_channel *chan; | ||
318 | enum nl80211_chan_width width; | ||
319 | u32 center_freq1; | ||
320 | u32 center_freq2; | ||
321 | }; | ||
322 | |||
323 | /** | ||
324 | * cfg80211_get_chandef_type - return old channel type from chandef | ||
325 | * @chandef: the channel definition | ||
326 | * | ||
327 | * Returns the old channel type (NOHT, HT20, HT40+/-) from a given | ||
328 | * chandef, which must have a bandwidth allowing this conversion. | ||
329 | */ | ||
330 | static inline enum nl80211_channel_type | ||
331 | cfg80211_get_chandef_type(const struct cfg80211_chan_def *chandef) | ||
332 | { | ||
333 | switch (chandef->width) { | ||
334 | case NL80211_CHAN_WIDTH_20_NOHT: | ||
335 | return NL80211_CHAN_NO_HT; | ||
336 | case NL80211_CHAN_WIDTH_20: | ||
337 | return NL80211_CHAN_HT20; | ||
338 | case NL80211_CHAN_WIDTH_40: | ||
339 | if (chandef->center_freq1 > chandef->chan->center_freq) | ||
340 | return NL80211_CHAN_HT40PLUS; | ||
341 | return NL80211_CHAN_HT40MINUS; | ||
342 | default: | ||
343 | WARN_ON(1); | ||
344 | return NL80211_CHAN_NO_HT; | ||
345 | } | ||
346 | } | ||
347 | |||
348 | /** | ||
349 | * cfg80211_chandef_create - create channel definition using channel type | ||
350 | * @chandef: the channel definition struct to fill | ||
351 | * @channel: the control channel | ||
352 | * @chantype: the channel type | ||
353 | * | ||
354 | * Given a channel type, create a channel definition. | ||
355 | */ | ||
356 | void cfg80211_chandef_create(struct cfg80211_chan_def *chandef, | ||
357 | struct ieee80211_channel *channel, | ||
358 | enum nl80211_channel_type chantype); | ||
359 | |||
360 | /** | ||
361 | * cfg80211_chandef_identical - check if two channel definitions are identical | ||
362 | * @chandef1: first channel definition | ||
363 | * @chandef2: second channel definition | ||
364 | * | ||
365 | * Returns %true if the channels defined by the channel definitions are | ||
366 | * identical, %false otherwise. | ||
367 | */ | ||
368 | static inline bool | ||
369 | cfg80211_chandef_identical(const struct cfg80211_chan_def *chandef1, | ||
370 | const struct cfg80211_chan_def *chandef2) | ||
371 | { | ||
372 | return (chandef1->chan == chandef2->chan && | ||
373 | chandef1->width == chandef2->width && | ||
374 | chandef1->center_freq1 == chandef2->center_freq1 && | ||
375 | chandef1->center_freq2 == chandef2->center_freq2); | ||
376 | } | ||
377 | |||
378 | /** | ||
379 | * cfg80211_chandef_compatible - check if two channel definitions are compatible | ||
380 | * @chandef1: first channel definition | ||
381 | * @chandef2: second channel definition | ||
382 | * | ||
383 | * Returns %NULL if the given channel definitions are incompatible, | ||
384 | * chandef1 or chandef2 otherwise. | ||
385 | */ | ||
386 | const struct cfg80211_chan_def * | ||
387 | cfg80211_chandef_compatible(const struct cfg80211_chan_def *chandef1, | ||
388 | const struct cfg80211_chan_def *chandef2); | ||
389 | |||
390 | /** | ||
309 | * enum survey_info_flags - survey information flags | 391 | * enum survey_info_flags - survey information flags |
310 | * | 392 | * |
311 | * @SURVEY_INFO_NOISE_DBM: noise (in dBm) was filled in | 393 | * @SURVEY_INFO_NOISE_DBM: noise (in dBm) was filled in |
@@ -426,8 +508,7 @@ struct cfg80211_beacon_data { | |||
426 | * | 508 | * |
427 | * Used to configure an AP interface. | 509 | * Used to configure an AP interface. |
428 | * | 510 | * |
429 | * @channel: the channel to start the AP on | 511 | * @chandef: defines the channel to use |
430 | * @channel_type: the channel type to use | ||
431 | * @beacon: beacon data | 512 | * @beacon: beacon data |
432 | * @beacon_interval: beacon interval | 513 | * @beacon_interval: beacon interval |
433 | * @dtim_period: DTIM period | 514 | * @dtim_period: DTIM period |
@@ -441,8 +522,7 @@ struct cfg80211_beacon_data { | |||
441 | * @inactivity_timeout: time in seconds to determine station's inactivity. | 522 | * @inactivity_timeout: time in seconds to determine station's inactivity. |
442 | */ | 523 | */ |
443 | struct cfg80211_ap_settings { | 524 | struct cfg80211_ap_settings { |
444 | struct ieee80211_channel *channel; | 525 | struct cfg80211_chan_def chandef; |
445 | enum nl80211_channel_type channel_type; | ||
446 | 526 | ||
447 | struct cfg80211_beacon_data beacon; | 527 | struct cfg80211_beacon_data beacon; |
448 | 528 | ||
@@ -498,6 +578,7 @@ enum station_parameters_apply_mask { | |||
498 | * @plink_action: plink action to take | 578 | * @plink_action: plink action to take |
499 | * @plink_state: set the peer link state for a station | 579 | * @plink_state: set the peer link state for a station |
500 | * @ht_capa: HT capabilities of station | 580 | * @ht_capa: HT capabilities of station |
581 | * @vht_capa: VHT capabilities of station | ||
501 | * @uapsd_queues: bitmap of queues configured for uapsd. same format | 582 | * @uapsd_queues: bitmap of queues configured for uapsd. same format |
502 | * as the AC bitmap in the QoS info field | 583 | * as the AC bitmap in the QoS info field |
503 | * @max_sp: max Service Period. same format as the MAX_SP in the | 584 | * @max_sp: max Service Period. same format as the MAX_SP in the |
@@ -517,6 +598,7 @@ struct station_parameters { | |||
517 | u8 plink_action; | 598 | u8 plink_action; |
518 | u8 plink_state; | 599 | u8 plink_state; |
519 | struct ieee80211_ht_cap *ht_capa; | 600 | struct ieee80211_ht_cap *ht_capa; |
601 | struct ieee80211_vht_cap *vht_capa; | ||
520 | u8 uapsd_queues; | 602 | u8 uapsd_queues; |
521 | u8 max_sp; | 603 | u8 max_sp; |
522 | }; | 604 | }; |
@@ -580,16 +662,24 @@ enum station_info_flags { | |||
580 | * Used by the driver to indicate the specific rate transmission | 662 | * Used by the driver to indicate the specific rate transmission |
581 | * type for 802.11n transmissions. | 663 | * type for 802.11n transmissions. |
582 | * | 664 | * |
583 | * @RATE_INFO_FLAGS_MCS: @tx_bitrate_mcs filled | 665 | * @RATE_INFO_FLAGS_MCS: mcs field filled with HT MCS |
584 | * @RATE_INFO_FLAGS_40_MHZ_WIDTH: 40 Mhz width transmission | 666 | * @RATE_INFO_FLAGS_VHT_MCS: mcs field filled with VHT MCS |
667 | * @RATE_INFO_FLAGS_40_MHZ_WIDTH: 40 MHz width transmission | ||
668 | * @RATE_INFO_FLAGS_80_MHZ_WIDTH: 80 MHz width transmission | ||
669 | * @RATE_INFO_FLAGS_80P80_MHZ_WIDTH: 80+80 MHz width transmission | ||
670 | * @RATE_INFO_FLAGS_160_MHZ_WIDTH: 160 MHz width transmission | ||
585 | * @RATE_INFO_FLAGS_SHORT_GI: 400ns guard interval | 671 | * @RATE_INFO_FLAGS_SHORT_GI: 400ns guard interval |
586 | * @RATE_INFO_FLAGS_60G: 60gHz MCS | 672 | * @RATE_INFO_FLAGS_60G: 60GHz MCS |
587 | */ | 673 | */ |
588 | enum rate_info_flags { | 674 | enum rate_info_flags { |
589 | RATE_INFO_FLAGS_MCS = 1<<0, | 675 | RATE_INFO_FLAGS_MCS = BIT(0), |
590 | RATE_INFO_FLAGS_40_MHZ_WIDTH = 1<<1, | 676 | RATE_INFO_FLAGS_VHT_MCS = BIT(1), |
591 | RATE_INFO_FLAGS_SHORT_GI = 1<<2, | 677 | RATE_INFO_FLAGS_40_MHZ_WIDTH = BIT(2), |
592 | RATE_INFO_FLAGS_60G = 1<<3, | 678 | RATE_INFO_FLAGS_80_MHZ_WIDTH = BIT(3), |
679 | RATE_INFO_FLAGS_80P80_MHZ_WIDTH = BIT(4), | ||
680 | RATE_INFO_FLAGS_160_MHZ_WIDTH = BIT(5), | ||
681 | RATE_INFO_FLAGS_SHORT_GI = BIT(6), | ||
682 | RATE_INFO_FLAGS_60G = BIT(7), | ||
593 | }; | 683 | }; |
594 | 684 | ||
595 | /** | 685 | /** |
@@ -600,11 +690,13 @@ enum rate_info_flags { | |||
600 | * @flags: bitflag of flags from &enum rate_info_flags | 690 | * @flags: bitflag of flags from &enum rate_info_flags |
601 | * @mcs: mcs index if struct describes a 802.11n bitrate | 691 | * @mcs: mcs index if struct describes a 802.11n bitrate |
602 | * @legacy: bitrate in 100kbit/s for 802.11abg | 692 | * @legacy: bitrate in 100kbit/s for 802.11abg |
693 | * @nss: number of streams (VHT only) | ||
603 | */ | 694 | */ |
604 | struct rate_info { | 695 | struct rate_info { |
605 | u8 flags; | 696 | u8 flags; |
606 | u8 mcs; | 697 | u8 mcs; |
607 | u16 legacy; | 698 | u16 legacy; |
699 | u8 nss; | ||
608 | }; | 700 | }; |
609 | 701 | ||
610 | /** | 702 | /** |
@@ -907,8 +999,7 @@ struct mesh_config { | |||
907 | 999 | ||
908 | /** | 1000 | /** |
909 | * struct mesh_setup - 802.11s mesh setup configuration | 1001 | * struct mesh_setup - 802.11s mesh setup configuration |
910 | * @channel: the channel to start the mesh network on | 1002 | * @chandef: defines the channel to use |
911 | * @channel_type: the channel type to use | ||
912 | * @mesh_id: the mesh ID | 1003 | * @mesh_id: the mesh ID |
913 | * @mesh_id_len: length of the mesh ID, at least 1 and at most 32 bytes | 1004 | * @mesh_id_len: length of the mesh ID, at least 1 and at most 32 bytes |
914 | * @sync_method: which synchronization method to use | 1005 | * @sync_method: which synchronization method to use |
@@ -923,8 +1014,7 @@ struct mesh_config { | |||
923 | * These parameters are fixed when the mesh is created. | 1014 | * These parameters are fixed when the mesh is created. |
924 | */ | 1015 | */ |
925 | struct mesh_setup { | 1016 | struct mesh_setup { |
926 | struct ieee80211_channel *channel; | 1017 | struct cfg80211_chan_def chandef; |
927 | enum nl80211_channel_type channel_type; | ||
928 | const u8 *mesh_id; | 1018 | const u8 *mesh_id; |
929 | u8 mesh_id_len; | 1019 | u8 mesh_id_len; |
930 | u8 sync_method; | 1020 | u8 sync_method; |
@@ -1000,8 +1090,10 @@ struct cfg80211_ssid { | |||
1000 | * @n_channels: total number of channels to scan | 1090 | * @n_channels: total number of channels to scan |
1001 | * @ie: optional information element(s) to add into Probe Request or %NULL | 1091 | * @ie: optional information element(s) to add into Probe Request or %NULL |
1002 | * @ie_len: length of ie in octets | 1092 | * @ie_len: length of ie in octets |
1093 | * @flags: bit field of flags controlling operation | ||
1003 | * @rates: bitmap of rates to advertise for each band | 1094 | * @rates: bitmap of rates to advertise for each band |
1004 | * @wiphy: the wiphy this was for | 1095 | * @wiphy: the wiphy this was for |
1096 | * @scan_start: time (in jiffies) when the scan started | ||
1005 | * @wdev: the wireless device to scan for | 1097 | * @wdev: the wireless device to scan for |
1006 | * @aborted: (internal) scan request was notified as aborted | 1098 | * @aborted: (internal) scan request was notified as aborted |
1007 | * @no_cck: used to send probe requests at non CCK rate in 2GHz band | 1099 | * @no_cck: used to send probe requests at non CCK rate in 2GHz band |
@@ -1012,6 +1104,7 @@ struct cfg80211_scan_request { | |||
1012 | u32 n_channels; | 1104 | u32 n_channels; |
1013 | const u8 *ie; | 1105 | const u8 *ie; |
1014 | size_t ie_len; | 1106 | size_t ie_len; |
1107 | u32 flags; | ||
1015 | 1108 | ||
1016 | u32 rates[IEEE80211_NUM_BANDS]; | 1109 | u32 rates[IEEE80211_NUM_BANDS]; |
1017 | 1110 | ||
@@ -1019,6 +1112,7 @@ struct cfg80211_scan_request { | |||
1019 | 1112 | ||
1020 | /* internal */ | 1113 | /* internal */ |
1021 | struct wiphy *wiphy; | 1114 | struct wiphy *wiphy; |
1115 | unsigned long scan_start; | ||
1022 | bool aborted; | 1116 | bool aborted; |
1023 | bool no_cck; | 1117 | bool no_cck; |
1024 | 1118 | ||
@@ -1044,6 +1138,7 @@ struct cfg80211_match_set { | |||
1044 | * @interval: interval between each scheduled scan cycle | 1138 | * @interval: interval between each scheduled scan cycle |
1045 | * @ie: optional information element(s) to add into Probe Request or %NULL | 1139 | * @ie: optional information element(s) to add into Probe Request or %NULL |
1046 | * @ie_len: length of ie in octets | 1140 | * @ie_len: length of ie in octets |
1141 | * @flags: bit field of flags controlling operation | ||
1047 | * @match_sets: sets of parameters to be matched for a scan result | 1142 | * @match_sets: sets of parameters to be matched for a scan result |
1048 | * entry to be considered valid and to be passed to the host | 1143 | * entry to be considered valid and to be passed to the host |
1049 | * (others are filtered out). | 1144 | * (others are filtered out). |
@@ -1061,6 +1156,7 @@ struct cfg80211_sched_scan_request { | |||
1061 | u32 interval; | 1156 | u32 interval; |
1062 | const u8 *ie; | 1157 | const u8 *ie; |
1063 | size_t ie_len; | 1158 | size_t ie_len; |
1159 | u32 flags; | ||
1064 | struct cfg80211_match_set *match_sets; | 1160 | struct cfg80211_match_set *match_sets; |
1065 | int n_match_sets; | 1161 | int n_match_sets; |
1066 | s32 rssi_thold; | 1162 | s32 rssi_thold; |
@@ -1068,6 +1164,7 @@ struct cfg80211_sched_scan_request { | |||
1068 | /* internal */ | 1164 | /* internal */ |
1069 | struct wiphy *wiphy; | 1165 | struct wiphy *wiphy; |
1070 | struct net_device *dev; | 1166 | struct net_device *dev; |
1167 | unsigned long scan_start; | ||
1071 | 1168 | ||
1072 | /* keep last */ | 1169 | /* keep last */ |
1073 | struct ieee80211_channel *channels[0]; | 1170 | struct ieee80211_channel *channels[0]; |
@@ -1152,6 +1249,9 @@ const u8 *ieee80211_bss_get_ie(struct cfg80211_bss *bss, u8 ie); | |||
1152 | * @key_len: length of WEP key for shared key authentication | 1249 | * @key_len: length of WEP key for shared key authentication |
1153 | * @key_idx: index of WEP key for shared key authentication | 1250 | * @key_idx: index of WEP key for shared key authentication |
1154 | * @key: WEP key for shared key authentication | 1251 | * @key: WEP key for shared key authentication |
1252 | * @sae_data: Non-IE data to use with SAE or %NULL. This starts with | ||
1253 | * Authentication transaction sequence number field. | ||
1254 | * @sae_data_len: Length of sae_data buffer in octets | ||
1155 | */ | 1255 | */ |
1156 | struct cfg80211_auth_request { | 1256 | struct cfg80211_auth_request { |
1157 | struct cfg80211_bss *bss; | 1257 | struct cfg80211_bss *bss; |
@@ -1160,6 +1260,8 @@ struct cfg80211_auth_request { | |||
1160 | enum nl80211_auth_type auth_type; | 1260 | enum nl80211_auth_type auth_type; |
1161 | const u8 *key; | 1261 | const u8 *key; |
1162 | u8 key_len, key_idx; | 1262 | u8 key_len, key_idx; |
1263 | const u8 *sae_data; | ||
1264 | size_t sae_data_len; | ||
1163 | }; | 1265 | }; |
1164 | 1266 | ||
1165 | /** | 1267 | /** |
@@ -1218,6 +1320,7 @@ struct cfg80211_deauth_request { | |||
1218 | const u8 *ie; | 1320 | const u8 *ie; |
1219 | size_t ie_len; | 1321 | size_t ie_len; |
1220 | u16 reason_code; | 1322 | u16 reason_code; |
1323 | bool local_state_change; | ||
1221 | }; | 1324 | }; |
1222 | 1325 | ||
1223 | /** | 1326 | /** |
@@ -1251,8 +1354,7 @@ struct cfg80211_disassoc_request { | |||
1251 | * @ssid_len: The length of the SSID, will always be non-zero. | 1354 | * @ssid_len: The length of the SSID, will always be non-zero. |
1252 | * @bssid: Fixed BSSID requested, maybe be %NULL, if set do not | 1355 | * @bssid: Fixed BSSID requested, maybe be %NULL, if set do not |
1253 | * search for IBSSs with a different BSSID. | 1356 | * search for IBSSs with a different BSSID. |
1254 | * @channel: The channel to use if no IBSS can be found to join. | 1357 | * @chandef: defines the channel to use if no other IBSS to join can be found |
1255 | * @channel_type: channel type (HT mode) | ||
1256 | * @channel_fixed: The channel should be fixed -- do not search for | 1358 | * @channel_fixed: The channel should be fixed -- do not search for |
1257 | * IBSSs to join on other channels. | 1359 | * IBSSs to join on other channels. |
1258 | * @ie: information element(s) to include in the beacon | 1360 | * @ie: information element(s) to include in the beacon |
@@ -1270,8 +1372,7 @@ struct cfg80211_disassoc_request { | |||
1270 | struct cfg80211_ibss_params { | 1372 | struct cfg80211_ibss_params { |
1271 | u8 *ssid; | 1373 | u8 *ssid; |
1272 | u8 *bssid; | 1374 | u8 *bssid; |
1273 | struct ieee80211_channel *channel; | 1375 | struct cfg80211_chan_def chandef; |
1274 | enum nl80211_channel_type channel_type; | ||
1275 | u8 *ie; | 1376 | u8 *ie; |
1276 | u8 ssid_len, ie_len; | 1377 | u8 ssid_len, ie_len; |
1277 | u16 beacon_interval; | 1378 | u16 beacon_interval; |
@@ -1530,13 +1631,19 @@ struct cfg80211_gtk_rekey_data { | |||
1530 | * to a merge. | 1631 | * to a merge. |
1531 | * @leave_ibss: Leave the IBSS. | 1632 | * @leave_ibss: Leave the IBSS. |
1532 | * | 1633 | * |
1634 | * @set_mcast_rate: Set the specified multicast rate (only if vif is in ADHOC or | ||
1635 | * MESH mode) | ||
1636 | * | ||
1533 | * @set_wiphy_params: Notify that wiphy parameters have changed; | 1637 | * @set_wiphy_params: Notify that wiphy parameters have changed; |
1534 | * @changed bitfield (see &enum wiphy_params_flags) describes which values | 1638 | * @changed bitfield (see &enum wiphy_params_flags) describes which values |
1535 | * have changed. The actual parameter values are available in | 1639 | * have changed. The actual parameter values are available in |
1536 | * struct wiphy. If returning an error, no value should be changed. | 1640 | * struct wiphy. If returning an error, no value should be changed. |
1537 | * | 1641 | * |
1538 | * @set_tx_power: set the transmit power according to the parameters, | 1642 | * @set_tx_power: set the transmit power according to the parameters, |
1539 | * the power passed is in mBm, to get dBm use MBM_TO_DBM(). | 1643 | * the power passed is in mBm, to get dBm use MBM_TO_DBM(). The |
1644 | * wdev may be %NULL if power was set for the wiphy, and will | ||
1645 | * always be %NULL unless the driver supports per-vif TX power | ||
1646 | * (as advertised by the nl80211 feature flag.) | ||
1540 | * @get_tx_power: store the current TX power into the dbm variable; | 1647 | * @get_tx_power: store the current TX power into the dbm variable; |
1541 | * return 0 if successful | 1648 | * return 0 if successful |
1542 | * | 1649 | * |
@@ -1707,8 +1814,7 @@ struct cfg80211_ops { | |||
1707 | struct ieee80211_channel *chan); | 1814 | struct ieee80211_channel *chan); |
1708 | 1815 | ||
1709 | int (*set_monitor_channel)(struct wiphy *wiphy, | 1816 | int (*set_monitor_channel)(struct wiphy *wiphy, |
1710 | struct ieee80211_channel *chan, | 1817 | struct cfg80211_chan_def *chandef); |
1711 | enum nl80211_channel_type channel_type); | ||
1712 | 1818 | ||
1713 | int (*scan)(struct wiphy *wiphy, | 1819 | int (*scan)(struct wiphy *wiphy, |
1714 | struct cfg80211_scan_request *request); | 1820 | struct cfg80211_scan_request *request); |
@@ -1731,11 +1837,15 @@ struct cfg80211_ops { | |||
1731 | struct cfg80211_ibss_params *params); | 1837 | struct cfg80211_ibss_params *params); |
1732 | int (*leave_ibss)(struct wiphy *wiphy, struct net_device *dev); | 1838 | int (*leave_ibss)(struct wiphy *wiphy, struct net_device *dev); |
1733 | 1839 | ||
1840 | int (*set_mcast_rate)(struct wiphy *wiphy, struct net_device *dev, | ||
1841 | int rate[IEEE80211_NUM_BANDS]); | ||
1842 | |||
1734 | int (*set_wiphy_params)(struct wiphy *wiphy, u32 changed); | 1843 | int (*set_wiphy_params)(struct wiphy *wiphy, u32 changed); |
1735 | 1844 | ||
1736 | int (*set_tx_power)(struct wiphy *wiphy, | 1845 | int (*set_tx_power)(struct wiphy *wiphy, struct wireless_dev *wdev, |
1737 | enum nl80211_tx_power_setting type, int mbm); | 1846 | enum nl80211_tx_power_setting type, int mbm); |
1738 | int (*get_tx_power)(struct wiphy *wiphy, int *dbm); | 1847 | int (*get_tx_power)(struct wiphy *wiphy, struct wireless_dev *wdev, |
1848 | int *dbm); | ||
1739 | 1849 | ||
1740 | int (*set_wds_peer)(struct wiphy *wiphy, struct net_device *dev, | 1850 | int (*set_wds_peer)(struct wiphy *wiphy, struct net_device *dev, |
1741 | const u8 *addr); | 1851 | const u8 *addr); |
@@ -1766,7 +1876,6 @@ struct cfg80211_ops { | |||
1766 | int (*remain_on_channel)(struct wiphy *wiphy, | 1876 | int (*remain_on_channel)(struct wiphy *wiphy, |
1767 | struct wireless_dev *wdev, | 1877 | struct wireless_dev *wdev, |
1768 | struct ieee80211_channel *chan, | 1878 | struct ieee80211_channel *chan, |
1769 | enum nl80211_channel_type channel_type, | ||
1770 | unsigned int duration, | 1879 | unsigned int duration, |
1771 | u64 *cookie); | 1880 | u64 *cookie); |
1772 | int (*cancel_remain_on_channel)(struct wiphy *wiphy, | 1881 | int (*cancel_remain_on_channel)(struct wiphy *wiphy, |
@@ -1775,10 +1884,8 @@ struct cfg80211_ops { | |||
1775 | 1884 | ||
1776 | int (*mgmt_tx)(struct wiphy *wiphy, struct wireless_dev *wdev, | 1885 | int (*mgmt_tx)(struct wiphy *wiphy, struct wireless_dev *wdev, |
1777 | struct ieee80211_channel *chan, bool offchan, | 1886 | struct ieee80211_channel *chan, bool offchan, |
1778 | enum nl80211_channel_type channel_type, | 1887 | unsigned int wait, const u8 *buf, size_t len, |
1779 | bool channel_type_valid, unsigned int wait, | 1888 | bool no_cck, bool dont_wait_for_ack, u64 *cookie); |
1780 | const u8 *buf, size_t len, bool no_cck, | ||
1781 | bool dont_wait_for_ack, u64 *cookie); | ||
1782 | int (*mgmt_tx_cancel_wait)(struct wiphy *wiphy, | 1889 | int (*mgmt_tx_cancel_wait)(struct wiphy *wiphy, |
1783 | struct wireless_dev *wdev, | 1890 | struct wireless_dev *wdev, |
1784 | u64 cookie); | 1891 | u64 cookie); |
@@ -1833,10 +1940,9 @@ struct cfg80211_ops { | |||
1833 | void (*get_et_strings)(struct wiphy *wiphy, struct net_device *dev, | 1940 | void (*get_et_strings)(struct wiphy *wiphy, struct net_device *dev, |
1834 | u32 sset, u8 *data); | 1941 | u32 sset, u8 *data); |
1835 | 1942 | ||
1836 | struct ieee80211_channel * | 1943 | int (*get_channel)(struct wiphy *wiphy, |
1837 | (*get_channel)(struct wiphy *wiphy, | ||
1838 | struct wireless_dev *wdev, | 1944 | struct wireless_dev *wdev, |
1839 | enum nl80211_channel_type *type); | 1945 | struct cfg80211_chan_def *chandef); |
1840 | 1946 | ||
1841 | int (*start_p2p_device)(struct wiphy *wiphy, | 1947 | int (*start_p2p_device)(struct wiphy *wiphy, |
1842 | struct wireless_dev *wdev); | 1948 | struct wireless_dev *wdev); |
@@ -2444,8 +2550,7 @@ struct wireless_dev { | |||
2444 | spinlock_t event_lock; | 2550 | spinlock_t event_lock; |
2445 | 2551 | ||
2446 | struct cfg80211_internal_bss *current_bss; /* associated / joined */ | 2552 | struct cfg80211_internal_bss *current_bss; /* associated / joined */ |
2447 | struct ieee80211_channel *preset_chan; | 2553 | struct cfg80211_chan_def preset_chandef; |
2448 | enum nl80211_channel_type preset_chantype; | ||
2449 | 2554 | ||
2450 | /* for AP and mesh channel tracking */ | 2555 | /* for AP and mesh channel tracking */ |
2451 | struct ieee80211_channel *channel; | 2556 | struct ieee80211_channel *channel; |
@@ -2651,6 +2756,15 @@ unsigned int ieee80211_get_hdrlen_from_skb(const struct sk_buff *skb); | |||
2651 | unsigned int __attribute_const__ ieee80211_hdrlen(__le16 fc); | 2756 | unsigned int __attribute_const__ ieee80211_hdrlen(__le16 fc); |
2652 | 2757 | ||
2653 | /** | 2758 | /** |
2759 | * ieee80211_get_mesh_hdrlen - get mesh extension header length | ||
2760 | * @meshhdr: the mesh extension header, only the flags field | ||
2761 | * (first byte) will be accessed | ||
2762 | * Returns the length of the extension header, which is always at | ||
2763 | * least 6 bytes and at most 18 if address 5 and 6 are present. | ||
2764 | */ | ||
2765 | unsigned int ieee80211_get_mesh_hdrlen(struct ieee80211s_hdr *meshhdr); | ||
2766 | |||
2767 | /** | ||
2654 | * DOC: Data path helpers | 2768 | * DOC: Data path helpers |
2655 | * | 2769 | * |
2656 | * In addition to generic utilities, cfg80211 also offers | 2770 | * In addition to generic utilities, cfg80211 also offers |
@@ -3316,14 +3430,12 @@ void cfg80211_disconnected(struct net_device *dev, u16 reason, | |||
3316 | * @wdev: wireless device | 3430 | * @wdev: wireless device |
3317 | * @cookie: the request cookie | 3431 | * @cookie: the request cookie |
3318 | * @chan: The current channel (from remain_on_channel request) | 3432 | * @chan: The current channel (from remain_on_channel request) |
3319 | * @channel_type: Channel type | ||
3320 | * @duration: Duration in milliseconds that the driver intents to remain on the | 3433 | * @duration: Duration in milliseconds that the driver intents to remain on the |
3321 | * channel | 3434 | * channel |
3322 | * @gfp: allocation flags | 3435 | * @gfp: allocation flags |
3323 | */ | 3436 | */ |
3324 | void cfg80211_ready_on_channel(struct wireless_dev *wdev, u64 cookie, | 3437 | void cfg80211_ready_on_channel(struct wireless_dev *wdev, u64 cookie, |
3325 | struct ieee80211_channel *chan, | 3438 | struct ieee80211_channel *chan, |
3326 | enum nl80211_channel_type channel_type, | ||
3327 | unsigned int duration, gfp_t gfp); | 3439 | unsigned int duration, gfp_t gfp); |
3328 | 3440 | ||
3329 | /** | 3441 | /** |
@@ -3331,12 +3443,10 @@ void cfg80211_ready_on_channel(struct wireless_dev *wdev, u64 cookie, | |||
3331 | * @wdev: wireless device | 3443 | * @wdev: wireless device |
3332 | * @cookie: the request cookie | 3444 | * @cookie: the request cookie |
3333 | * @chan: The current channel (from remain_on_channel request) | 3445 | * @chan: The current channel (from remain_on_channel request) |
3334 | * @channel_type: Channel type | ||
3335 | * @gfp: allocation flags | 3446 | * @gfp: allocation flags |
3336 | */ | 3447 | */ |
3337 | void cfg80211_remain_on_channel_expired(struct wireless_dev *wdev, u64 cookie, | 3448 | void cfg80211_remain_on_channel_expired(struct wireless_dev *wdev, u64 cookie, |
3338 | struct ieee80211_channel *chan, | 3449 | struct ieee80211_channel *chan, |
3339 | enum nl80211_channel_type channel_type, | ||
3340 | gfp_t gfp); | 3450 | gfp_t gfp); |
3341 | 3451 | ||
3342 | 3452 | ||
@@ -3526,7 +3636,6 @@ void cfg80211_probe_status(struct net_device *dev, const u8 *addr, | |||
3526 | * @len: length of the frame | 3636 | * @len: length of the frame |
3527 | * @freq: frequency the frame was received on | 3637 | * @freq: frequency the frame was received on |
3528 | * @sig_dbm: signal strength in mBm, or 0 if unknown | 3638 | * @sig_dbm: signal strength in mBm, or 0 if unknown |
3529 | * @gfp: allocation flags | ||
3530 | * | 3639 | * |
3531 | * Use this function to report to userspace when a beacon was | 3640 | * Use this function to report to userspace when a beacon was |
3532 | * received. It is not useful to call this when there is no | 3641 | * received. It is not useful to call this when there is no |
@@ -3534,31 +3643,47 @@ void cfg80211_probe_status(struct net_device *dev, const u8 *addr, | |||
3534 | */ | 3643 | */ |
3535 | void cfg80211_report_obss_beacon(struct wiphy *wiphy, | 3644 | void cfg80211_report_obss_beacon(struct wiphy *wiphy, |
3536 | const u8 *frame, size_t len, | 3645 | const u8 *frame, size_t len, |
3537 | int freq, int sig_dbm, gfp_t gfp); | 3646 | int freq, int sig_dbm); |
3538 | 3647 | ||
3539 | /** | 3648 | /** |
3540 | * cfg80211_can_beacon_sec_chan - test if ht40 on extension channel can be used | 3649 | * cfg80211_reg_can_beacon - check if beaconing is allowed |
3541 | * @wiphy: the wiphy | 3650 | * @wiphy: the wiphy |
3542 | * @chan: main channel | 3651 | * @chandef: the channel definition |
3543 | * @channel_type: HT mode | ||
3544 | * | 3652 | * |
3545 | * This function returns true if there is no secondary channel or the secondary | 3653 | * This function returns true if there is no secondary channel or the secondary |
3546 | * channel can be used for beaconing (i.e. is not a radar channel etc.) | 3654 | * channel(s) can be used for beaconing (i.e. is not a radar channel etc.) |
3547 | */ | 3655 | */ |
3548 | bool cfg80211_can_beacon_sec_chan(struct wiphy *wiphy, | 3656 | bool cfg80211_reg_can_beacon(struct wiphy *wiphy, |
3549 | struct ieee80211_channel *chan, | 3657 | struct cfg80211_chan_def *chandef); |
3550 | enum nl80211_channel_type channel_type); | ||
3551 | 3658 | ||
3552 | /* | 3659 | /* |
3553 | * cfg80211_ch_switch_notify - update wdev channel and notify userspace | 3660 | * cfg80211_ch_switch_notify - update wdev channel and notify userspace |
3554 | * @dev: the device which switched channels | 3661 | * @dev: the device which switched channels |
3555 | * @freq: new channel frequency (in MHz) | 3662 | * @chandef: the new channel definition |
3556 | * @type: channel type | ||
3557 | * | 3663 | * |
3558 | * Acquires wdev_lock, so must only be called from sleepable driver context! | 3664 | * Acquires wdev_lock, so must only be called from sleepable driver context! |
3559 | */ | 3665 | */ |
3560 | void cfg80211_ch_switch_notify(struct net_device *dev, int freq, | 3666 | void cfg80211_ch_switch_notify(struct net_device *dev, |
3561 | enum nl80211_channel_type type); | 3667 | struct cfg80211_chan_def *chandef); |
3668 | |||
3669 | /* | ||
3670 | * cfg80211_tdls_oper_request - request userspace to perform TDLS operation | ||
3671 | * @dev: the device on which the operation is requested | ||
3672 | * @peer: the MAC address of the peer device | ||
3673 | * @oper: the requested TDLS operation (NL80211_TDLS_SETUP or | ||
3674 | * NL80211_TDLS_TEARDOWN) | ||
3675 | * @reason_code: the reason code for teardown request | ||
3676 | * @gfp: allocation flags | ||
3677 | * | ||
3678 | * This function is used to request userspace to perform TDLS operation that | ||
3679 | * requires knowledge of keys, i.e., link setup or teardown when the AP | ||
3680 | * connection uses encryption. This is optional mechanism for the driver to use | ||
3681 | * if it can automatically determine when a TDLS link could be useful (e.g., | ||
3682 | * based on traffic and signal strength for a peer). | ||
3683 | */ | ||
3684 | void cfg80211_tdls_oper_request(struct net_device *dev, const u8 *peer, | ||
3685 | enum nl80211_tdls_operation oper, | ||
3686 | u16 reason_code, gfp_t gfp); | ||
3562 | 3687 | ||
3563 | /* | 3688 | /* |
3564 | * cfg80211_calculate_bitrate - calculate actual bitrate (in 100Kbps units) | 3689 | * cfg80211_calculate_bitrate - calculate actual bitrate (in 100Kbps units) |
@@ -3584,6 +3709,26 @@ u32 cfg80211_calculate_bitrate(struct rate_info *rate); | |||
3584 | */ | 3709 | */ |
3585 | void cfg80211_unregister_wdev(struct wireless_dev *wdev); | 3710 | void cfg80211_unregister_wdev(struct wireless_dev *wdev); |
3586 | 3711 | ||
3712 | /** | ||
3713 | * cfg80211_get_p2p_attr - find and copy a P2P attribute from IE buffer | ||
3714 | * @ies: the input IE buffer | ||
3715 | * @len: the input length | ||
3716 | * @attr: the attribute ID to find | ||
3717 | * @buf: output buffer, can be %NULL if the data isn't needed, e.g. | ||
3718 | * if the function is only called to get the needed buffer size | ||
3719 | * @bufsize: size of the output buffer | ||
3720 | * | ||
3721 | * The function finds a given P2P attribute in the (vendor) IEs and | ||
3722 | * copies its contents to the given buffer. | ||
3723 | * | ||
3724 | * The return value is a negative error code (-%EILSEQ or -%ENOENT) if | ||
3725 | * the data is malformed or the attribute can't be found (respectively), | ||
3726 | * or the length of the found attribute (which can be zero). | ||
3727 | */ | ||
3728 | int cfg80211_get_p2p_attr(const u8 *ies, unsigned int len, | ||
3729 | enum ieee80211_p2p_attr_id attr, | ||
3730 | u8 *buf, unsigned int bufsize); | ||
3731 | |||
3587 | /* Logging, debugging and troubleshooting/diagnostic helpers. */ | 3732 | /* Logging, debugging and troubleshooting/diagnostic helpers. */ |
3588 | 3733 | ||
3589 | /* wiphy_printk helpers, similar to dev_printk */ | 3734 | /* wiphy_printk helpers, similar to dev_printk */ |
diff --git a/include/net/cls_cgroup.h b/include/net/cls_cgroup.h index b6a6eeb3905f..2581638f4a3d 100644 --- a/include/net/cls_cgroup.h +++ b/include/net/cls_cgroup.h | |||
@@ -24,12 +24,12 @@ struct cgroup_cls_state | |||
24 | u32 classid; | 24 | u32 classid; |
25 | }; | 25 | }; |
26 | 26 | ||
27 | extern void sock_update_classid(struct sock *sk); | 27 | extern void sock_update_classid(struct sock *sk, struct task_struct *task); |
28 | 28 | ||
29 | #if IS_BUILTIN(CONFIG_NET_CLS_CGROUP) | 29 | #if IS_BUILTIN(CONFIG_NET_CLS_CGROUP) |
30 | static inline u32 task_cls_classid(struct task_struct *p) | 30 | static inline u32 task_cls_classid(struct task_struct *p) |
31 | { | 31 | { |
32 | int classid; | 32 | u32 classid; |
33 | 33 | ||
34 | if (in_interrupt()) | 34 | if (in_interrupt()) |
35 | return 0; | 35 | return 0; |
@@ -61,7 +61,7 @@ static inline u32 task_cls_classid(struct task_struct *p) | |||
61 | } | 61 | } |
62 | #endif | 62 | #endif |
63 | #else /* !CGROUP_NET_CLS_CGROUP */ | 63 | #else /* !CGROUP_NET_CLS_CGROUP */ |
64 | static inline void sock_update_classid(struct sock *sk) | 64 | static inline void sock_update_classid(struct sock *sk, struct task_struct *task) |
65 | { | 65 | { |
66 | } | 66 | } |
67 | 67 | ||
diff --git a/include/net/ip6_checksum.h b/include/net/ip6_checksum.h index bc1b0fda2b04..652d3d309357 100644 --- a/include/net/ip6_checksum.h +++ b/include/net/ip6_checksum.h | |||
@@ -31,6 +31,8 @@ | |||
31 | #include <net/ip.h> | 31 | #include <net/ip.h> |
32 | #include <asm/checksum.h> | 32 | #include <asm/checksum.h> |
33 | #include <linux/in6.h> | 33 | #include <linux/in6.h> |
34 | #include <linux/tcp.h> | ||
35 | #include <linux/ipv6.h> | ||
34 | 36 | ||
35 | #ifndef _HAVE_ARCH_IPV6_CSUM | 37 | #ifndef _HAVE_ARCH_IPV6_CSUM |
36 | 38 | ||
@@ -91,4 +93,37 @@ static __inline__ __sum16 csum_ipv6_magic(const struct in6_addr *saddr, | |||
91 | } | 93 | } |
92 | 94 | ||
93 | #endif | 95 | #endif |
96 | |||
97 | static __inline__ __sum16 tcp_v6_check(int len, | ||
98 | const struct in6_addr *saddr, | ||
99 | const struct in6_addr *daddr, | ||
100 | __wsum base) | ||
101 | { | ||
102 | return csum_ipv6_magic(saddr, daddr, len, IPPROTO_TCP, base); | ||
103 | } | ||
104 | |||
105 | static inline void __tcp_v6_send_check(struct sk_buff *skb, | ||
106 | const struct in6_addr *saddr, | ||
107 | const struct in6_addr *daddr) | ||
108 | { | ||
109 | struct tcphdr *th = tcp_hdr(skb); | ||
110 | |||
111 | if (skb->ip_summed == CHECKSUM_PARTIAL) { | ||
112 | th->check = ~tcp_v6_check(skb->len, saddr, daddr, 0); | ||
113 | skb->csum_start = skb_transport_header(skb) - skb->head; | ||
114 | skb->csum_offset = offsetof(struct tcphdr, check); | ||
115 | } else { | ||
116 | th->check = tcp_v6_check(skb->len, saddr, daddr, | ||
117 | csum_partial(th, th->doff << 2, | ||
118 | skb->csum)); | ||
119 | } | ||
120 | } | ||
121 | |||
122 | static inline void tcp_v6_send_check(struct sock *sk, struct sk_buff *skb) | ||
123 | { | ||
124 | struct ipv6_pinfo *np = inet6_sk(sk); | ||
125 | |||
126 | __tcp_v6_send_check(skb, &np->saddr, &np->daddr); | ||
127 | } | ||
128 | |||
94 | #endif | 129 | #endif |
diff --git a/include/net/ip6_fib.h b/include/net/ip6_fib.h index 8a2a203eb15d..fdc48a94a063 100644 --- a/include/net/ip6_fib.h +++ b/include/net/ip6_fib.h | |||
@@ -47,6 +47,8 @@ struct fib6_config { | |||
47 | unsigned long fc_expires; | 47 | unsigned long fc_expires; |
48 | struct nlattr *fc_mx; | 48 | struct nlattr *fc_mx; |
49 | int fc_mx_len; | 49 | int fc_mx_len; |
50 | int fc_mp_len; | ||
51 | struct nlattr *fc_mp; | ||
50 | 52 | ||
51 | struct nl_info fc_nlinfo; | 53 | struct nl_info fc_nlinfo; |
52 | }; | 54 | }; |
@@ -99,6 +101,14 @@ struct rt6_info { | |||
99 | 101 | ||
100 | struct in6_addr rt6i_gateway; | 102 | struct in6_addr rt6i_gateway; |
101 | 103 | ||
104 | /* Multipath routes: | ||
105 | * siblings is a list of rt6_info that have the the same metric/weight, | ||
106 | * destination, but not the same gateway. nsiblings is just a cache | ||
107 | * to speed up lookup. | ||
108 | */ | ||
109 | struct list_head rt6i_siblings; | ||
110 | unsigned int rt6i_nsiblings; | ||
111 | |||
102 | atomic_t rt6i_ref; | 112 | atomic_t rt6i_ref; |
103 | 113 | ||
104 | /* These are in a separate cache line. */ | 114 | /* These are in a separate cache line. */ |
@@ -107,7 +117,6 @@ struct rt6_info { | |||
107 | struct rt6key rt6i_src; | 117 | struct rt6key rt6i_src; |
108 | struct rt6key rt6i_prefsrc; | 118 | struct rt6key rt6i_prefsrc; |
109 | u32 rt6i_metric; | 119 | u32 rt6i_metric; |
110 | u32 rt6i_peer_genid; | ||
111 | 120 | ||
112 | struct inet6_dev *rt6i_idev; | 121 | struct inet6_dev *rt6i_idev; |
113 | unsigned long _rt6i_peer; | 122 | unsigned long _rt6i_peer; |
@@ -203,6 +212,15 @@ static inline void rt6_set_from(struct rt6_info *rt, struct rt6_info *from) | |||
203 | dst_hold(new); | 212 | dst_hold(new); |
204 | } | 213 | } |
205 | 214 | ||
215 | static inline void ip6_rt_put(struct rt6_info *rt) | ||
216 | { | ||
217 | /* dst_release() accepts a NULL parameter. | ||
218 | * We rely on dst being first structure in struct rt6_info | ||
219 | */ | ||
220 | BUILD_BUG_ON(offsetof(struct rt6_info, dst) != 0); | ||
221 | dst_release(&rt->dst); | ||
222 | } | ||
223 | |||
206 | struct fib6_walker_t { | 224 | struct fib6_walker_t { |
207 | struct list_head lh; | 225 | struct list_head lh; |
208 | struct fib6_node *root, *node; | 226 | struct fib6_node *root, *node; |
diff --git a/include/net/ip6_route.h b/include/net/ip6_route.h index 5fa2af00634a..27d83183e615 100644 --- a/include/net/ip6_route.h +++ b/include/net/ip6_route.h | |||
@@ -1,9 +1,6 @@ | |||
1 | #ifndef _NET_IP6_ROUTE_H | 1 | #ifndef _NET_IP6_ROUTE_H |
2 | #define _NET_IP6_ROUTE_H | 2 | #define _NET_IP6_ROUTE_H |
3 | 3 | ||
4 | #define IP6_RT_PRIO_USER 1024 | ||
5 | #define IP6_RT_PRIO_ADDRCONF 256 | ||
6 | |||
7 | struct route_info { | 4 | struct route_info { |
8 | __u8 type; | 5 | __u8 type; |
9 | __u8 length; | 6 | __u8 length; |
diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h index ee75ccdf5188..68c69d54d392 100644 --- a/include/net/ip_vs.h +++ b/include/net/ip_vs.h | |||
@@ -22,7 +22,10 @@ | |||
22 | #include <linux/ip.h> | 22 | #include <linux/ip.h> |
23 | #include <linux/ipv6.h> /* for struct ipv6hdr */ | 23 | #include <linux/ipv6.h> /* for struct ipv6hdr */ |
24 | #include <net/ipv6.h> | 24 | #include <net/ipv6.h> |
25 | #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) | 25 | #if IS_ENABLED(CONFIG_IP_VS_IPV6) |
26 | #include <linux/netfilter_ipv6/ip6_tables.h> | ||
27 | #endif | ||
28 | #if IS_ENABLED(CONFIG_NF_CONNTRACK) | ||
26 | #include <net/netfilter/nf_conntrack.h> | 29 | #include <net/netfilter/nf_conntrack.h> |
27 | #endif | 30 | #endif |
28 | #include <net/net_namespace.h> /* Netw namespace */ | 31 | #include <net/net_namespace.h> /* Netw namespace */ |
@@ -103,30 +106,117 @@ static inline struct net *seq_file_single_net(struct seq_file *seq) | |||
103 | /* Connections' size value needed by ip_vs_ctl.c */ | 106 | /* Connections' size value needed by ip_vs_ctl.c */ |
104 | extern int ip_vs_conn_tab_size; | 107 | extern int ip_vs_conn_tab_size; |
105 | 108 | ||
106 | |||
107 | struct ip_vs_iphdr { | 109 | struct ip_vs_iphdr { |
108 | int len; | 110 | __u32 len; /* IPv4 simply where L4 starts |
109 | __u8 protocol; | 111 | IPv6 where L4 Transport Header starts */ |
112 | __u32 thoff_reasm; /* Transport Header Offset in nfct_reasm skb */ | ||
113 | __u16 fragoffs; /* IPv6 fragment offset, 0 if first frag (or not frag)*/ | ||
114 | __s16 protocol; | ||
115 | __s32 flags; | ||
110 | union nf_inet_addr saddr; | 116 | union nf_inet_addr saddr; |
111 | union nf_inet_addr daddr; | 117 | union nf_inet_addr daddr; |
112 | }; | 118 | }; |
113 | 119 | ||
120 | /* Dependency to module: nf_defrag_ipv6 */ | ||
121 | #if defined(CONFIG_NF_DEFRAG_IPV6) || defined(CONFIG_NF_DEFRAG_IPV6_MODULE) | ||
122 | static inline struct sk_buff *skb_nfct_reasm(const struct sk_buff *skb) | ||
123 | { | ||
124 | return skb->nfct_reasm; | ||
125 | } | ||
126 | static inline void *frag_safe_skb_hp(const struct sk_buff *skb, int offset, | ||
127 | int len, void *buffer, | ||
128 | const struct ip_vs_iphdr *ipvsh) | ||
129 | { | ||
130 | if (unlikely(ipvsh->fragoffs && skb_nfct_reasm(skb))) | ||
131 | return skb_header_pointer(skb_nfct_reasm(skb), | ||
132 | ipvsh->thoff_reasm, len, buffer); | ||
133 | |||
134 | return skb_header_pointer(skb, offset, len, buffer); | ||
135 | } | ||
136 | #else | ||
137 | static inline struct sk_buff *skb_nfct_reasm(const struct sk_buff *skb) | ||
138 | { | ||
139 | return NULL; | ||
140 | } | ||
141 | static inline void *frag_safe_skb_hp(const struct sk_buff *skb, int offset, | ||
142 | int len, void *buffer, | ||
143 | const struct ip_vs_iphdr *ipvsh) | ||
144 | { | ||
145 | return skb_header_pointer(skb, offset, len, buffer); | ||
146 | } | ||
147 | #endif | ||
148 | |||
114 | static inline void | 149 | static inline void |
115 | ip_vs_fill_iphdr(int af, const void *nh, struct ip_vs_iphdr *iphdr) | 150 | ip_vs_fill_ip4hdr(const void *nh, struct ip_vs_iphdr *iphdr) |
151 | { | ||
152 | const struct iphdr *iph = nh; | ||
153 | |||
154 | iphdr->len = iph->ihl * 4; | ||
155 | iphdr->fragoffs = 0; | ||
156 | iphdr->protocol = iph->protocol; | ||
157 | iphdr->saddr.ip = iph->saddr; | ||
158 | iphdr->daddr.ip = iph->daddr; | ||
159 | } | ||
160 | |||
161 | /* This function handles filling *ip_vs_iphdr, both for IPv4 and IPv6. | ||
162 | * IPv6 requires some extra work, as finding proper header position, | ||
163 | * depend on the IPv6 extension headers. | ||
164 | */ | ||
165 | static inline void | ||
166 | ip_vs_fill_iph_skb(int af, const struct sk_buff *skb, struct ip_vs_iphdr *iphdr) | ||
116 | { | 167 | { |
117 | #ifdef CONFIG_IP_VS_IPV6 | 168 | #ifdef CONFIG_IP_VS_IPV6 |
118 | if (af == AF_INET6) { | 169 | if (af == AF_INET6) { |
119 | const struct ipv6hdr *iph = nh; | 170 | const struct ipv6hdr *iph = |
120 | iphdr->len = sizeof(struct ipv6hdr); | 171 | (struct ipv6hdr *)skb_network_header(skb); |
121 | iphdr->protocol = iph->nexthdr; | ||
122 | iphdr->saddr.in6 = iph->saddr; | 172 | iphdr->saddr.in6 = iph->saddr; |
123 | iphdr->daddr.in6 = iph->daddr; | 173 | iphdr->daddr.in6 = iph->daddr; |
174 | /* ipv6_find_hdr() updates len, flags, thoff_reasm */ | ||
175 | iphdr->thoff_reasm = 0; | ||
176 | iphdr->len = 0; | ||
177 | iphdr->flags = 0; | ||
178 | iphdr->protocol = ipv6_find_hdr(skb, &iphdr->len, -1, | ||
179 | &iphdr->fragoffs, | ||
180 | &iphdr->flags); | ||
181 | /* get proto from re-assembled packet and it's offset */ | ||
182 | if (skb_nfct_reasm(skb)) | ||
183 | iphdr->protocol = ipv6_find_hdr(skb_nfct_reasm(skb), | ||
184 | &iphdr->thoff_reasm, | ||
185 | -1, NULL, NULL); | ||
186 | |||
124 | } else | 187 | } else |
125 | #endif | 188 | #endif |
126 | { | 189 | { |
127 | const struct iphdr *iph = nh; | 190 | const struct iphdr *iph = |
128 | iphdr->len = iph->ihl * 4; | 191 | (struct iphdr *)skb_network_header(skb); |
129 | iphdr->protocol = iph->protocol; | 192 | iphdr->len = iph->ihl * 4; |
193 | iphdr->fragoffs = 0; | ||
194 | iphdr->protocol = iph->protocol; | ||
195 | iphdr->saddr.ip = iph->saddr; | ||
196 | iphdr->daddr.ip = iph->daddr; | ||
197 | } | ||
198 | } | ||
199 | |||
200 | /* This function is a faster version of ip_vs_fill_iph_skb(). | ||
201 | * Where we only populate {s,d}addr (and avoid calling ipv6_find_hdr()). | ||
202 | * This is used by the some of the ip_vs_*_schedule() functions. | ||
203 | * (Mostly done to avoid ABI breakage of external schedulers) | ||
204 | */ | ||
205 | static inline void | ||
206 | ip_vs_fill_iph_addr_only(int af, const struct sk_buff *skb, | ||
207 | struct ip_vs_iphdr *iphdr) | ||
208 | { | ||
209 | #ifdef CONFIG_IP_VS_IPV6 | ||
210 | if (af == AF_INET6) { | ||
211 | const struct ipv6hdr *iph = | ||
212 | (struct ipv6hdr *)skb_network_header(skb); | ||
213 | iphdr->saddr.in6 = iph->saddr; | ||
214 | iphdr->daddr.in6 = iph->daddr; | ||
215 | } else | ||
216 | #endif | ||
217 | { | ||
218 | const struct iphdr *iph = | ||
219 | (struct iphdr *)skb_network_header(skb); | ||
130 | iphdr->saddr.ip = iph->saddr; | 220 | iphdr->saddr.ip = iph->saddr; |
131 | iphdr->daddr.ip = iph->daddr; | 221 | iphdr->daddr.ip = iph->daddr; |
132 | } | 222 | } |
@@ -165,7 +255,7 @@ static inline const char *ip_vs_dbg_addr(int af, char *buf, size_t buf_len, | |||
165 | int len; | 255 | int len; |
166 | #ifdef CONFIG_IP_VS_IPV6 | 256 | #ifdef CONFIG_IP_VS_IPV6 |
167 | if (af == AF_INET6) | 257 | if (af == AF_INET6) |
168 | len = snprintf(&buf[*idx], buf_len - *idx, "[%pI6]", | 258 | len = snprintf(&buf[*idx], buf_len - *idx, "[%pI6c]", |
169 | &addr->in6) + 1; | 259 | &addr->in6) + 1; |
170 | else | 260 | else |
171 | #endif | 261 | #endif |
@@ -398,27 +488,26 @@ struct ip_vs_protocol { | |||
398 | 488 | ||
399 | int (*conn_schedule)(int af, struct sk_buff *skb, | 489 | int (*conn_schedule)(int af, struct sk_buff *skb, |
400 | struct ip_vs_proto_data *pd, | 490 | struct ip_vs_proto_data *pd, |
401 | int *verdict, struct ip_vs_conn **cpp); | 491 | int *verdict, struct ip_vs_conn **cpp, |
492 | struct ip_vs_iphdr *iph); | ||
402 | 493 | ||
403 | struct ip_vs_conn * | 494 | struct ip_vs_conn * |
404 | (*conn_in_get)(int af, | 495 | (*conn_in_get)(int af, |
405 | const struct sk_buff *skb, | 496 | const struct sk_buff *skb, |
406 | const struct ip_vs_iphdr *iph, | 497 | const struct ip_vs_iphdr *iph, |
407 | unsigned int proto_off, | ||
408 | int inverse); | 498 | int inverse); |
409 | 499 | ||
410 | struct ip_vs_conn * | 500 | struct ip_vs_conn * |
411 | (*conn_out_get)(int af, | 501 | (*conn_out_get)(int af, |
412 | const struct sk_buff *skb, | 502 | const struct sk_buff *skb, |
413 | const struct ip_vs_iphdr *iph, | 503 | const struct ip_vs_iphdr *iph, |
414 | unsigned int proto_off, | ||
415 | int inverse); | 504 | int inverse); |
416 | 505 | ||
417 | int (*snat_handler)(struct sk_buff *skb, | 506 | int (*snat_handler)(struct sk_buff *skb, struct ip_vs_protocol *pp, |
418 | struct ip_vs_protocol *pp, struct ip_vs_conn *cp); | 507 | struct ip_vs_conn *cp, struct ip_vs_iphdr *iph); |
419 | 508 | ||
420 | int (*dnat_handler)(struct sk_buff *skb, | 509 | int (*dnat_handler)(struct sk_buff *skb, struct ip_vs_protocol *pp, |
421 | struct ip_vs_protocol *pp, struct ip_vs_conn *cp); | 510 | struct ip_vs_conn *cp, struct ip_vs_iphdr *iph); |
422 | 511 | ||
423 | int (*csum_check)(int af, struct sk_buff *skb, | 512 | int (*csum_check)(int af, struct sk_buff *skb, |
424 | struct ip_vs_protocol *pp); | 513 | struct ip_vs_protocol *pp); |
@@ -518,7 +607,7 @@ struct ip_vs_conn { | |||
518 | NF_ACCEPT can be returned when destination is local. | 607 | NF_ACCEPT can be returned when destination is local. |
519 | */ | 608 | */ |
520 | int (*packet_xmit)(struct sk_buff *skb, struct ip_vs_conn *cp, | 609 | int (*packet_xmit)(struct sk_buff *skb, struct ip_vs_conn *cp, |
521 | struct ip_vs_protocol *pp); | 610 | struct ip_vs_protocol *pp, struct ip_vs_iphdr *iph); |
522 | 611 | ||
523 | /* Note: we can group the following members into a structure, | 612 | /* Note: we can group the following members into a structure, |
524 | in order to save more space, and the following members are | 613 | in order to save more space, and the following members are |
@@ -769,13 +858,11 @@ struct ip_vs_app { | |||
769 | 858 | ||
770 | struct ip_vs_conn * | 859 | struct ip_vs_conn * |
771 | (*conn_in_get)(const struct sk_buff *skb, struct ip_vs_app *app, | 860 | (*conn_in_get)(const struct sk_buff *skb, struct ip_vs_app *app, |
772 | const struct iphdr *iph, unsigned int proto_off, | 861 | const struct iphdr *iph, int inverse); |
773 | int inverse); | ||
774 | 862 | ||
775 | struct ip_vs_conn * | 863 | struct ip_vs_conn * |
776 | (*conn_out_get)(const struct sk_buff *skb, struct ip_vs_app *app, | 864 | (*conn_out_get)(const struct sk_buff *skb, struct ip_vs_app *app, |
777 | const struct iphdr *iph, unsigned int proto_off, | 865 | const struct iphdr *iph, int inverse); |
778 | int inverse); | ||
779 | 866 | ||
780 | int (*state_transition)(struct ip_vs_conn *cp, int direction, | 867 | int (*state_transition)(struct ip_vs_conn *cp, int direction, |
781 | const struct sk_buff *skb, | 868 | const struct sk_buff *skb, |
@@ -1074,14 +1161,12 @@ struct ip_vs_conn *ip_vs_ct_in_get(const struct ip_vs_conn_param *p); | |||
1074 | 1161 | ||
1075 | struct ip_vs_conn * ip_vs_conn_in_get_proto(int af, const struct sk_buff *skb, | 1162 | struct ip_vs_conn * ip_vs_conn_in_get_proto(int af, const struct sk_buff *skb, |
1076 | const struct ip_vs_iphdr *iph, | 1163 | const struct ip_vs_iphdr *iph, |
1077 | unsigned int proto_off, | ||
1078 | int inverse); | 1164 | int inverse); |
1079 | 1165 | ||
1080 | struct ip_vs_conn *ip_vs_conn_out_get(const struct ip_vs_conn_param *p); | 1166 | struct ip_vs_conn *ip_vs_conn_out_get(const struct ip_vs_conn_param *p); |
1081 | 1167 | ||
1082 | struct ip_vs_conn * ip_vs_conn_out_get_proto(int af, const struct sk_buff *skb, | 1168 | struct ip_vs_conn * ip_vs_conn_out_get_proto(int af, const struct sk_buff *skb, |
1083 | const struct ip_vs_iphdr *iph, | 1169 | const struct ip_vs_iphdr *iph, |
1084 | unsigned int proto_off, | ||
1085 | int inverse); | 1170 | int inverse); |
1086 | 1171 | ||
1087 | /* put back the conn without restarting its timer */ | 1172 | /* put back the conn without restarting its timer */ |
@@ -1254,9 +1339,10 @@ extern struct ip_vs_scheduler *ip_vs_scheduler_get(const char *sched_name); | |||
1254 | extern void ip_vs_scheduler_put(struct ip_vs_scheduler *scheduler); | 1339 | extern void ip_vs_scheduler_put(struct ip_vs_scheduler *scheduler); |
1255 | extern struct ip_vs_conn * | 1340 | extern struct ip_vs_conn * |
1256 | ip_vs_schedule(struct ip_vs_service *svc, struct sk_buff *skb, | 1341 | ip_vs_schedule(struct ip_vs_service *svc, struct sk_buff *skb, |
1257 | struct ip_vs_proto_data *pd, int *ignored); | 1342 | struct ip_vs_proto_data *pd, int *ignored, |
1343 | struct ip_vs_iphdr *iph); | ||
1258 | extern int ip_vs_leave(struct ip_vs_service *svc, struct sk_buff *skb, | 1344 | extern int ip_vs_leave(struct ip_vs_service *svc, struct sk_buff *skb, |
1259 | struct ip_vs_proto_data *pd); | 1345 | struct ip_vs_proto_data *pd, struct ip_vs_iphdr *iph); |
1260 | 1346 | ||
1261 | extern void ip_vs_scheduler_err(struct ip_vs_service *svc, const char *msg); | 1347 | extern void ip_vs_scheduler_err(struct ip_vs_service *svc, const char *msg); |
1262 | 1348 | ||
@@ -1315,33 +1401,38 @@ extern void ip_vs_read_estimator(struct ip_vs_stats_user *dst, | |||
1315 | /* | 1401 | /* |
1316 | * Various IPVS packet transmitters (from ip_vs_xmit.c) | 1402 | * Various IPVS packet transmitters (from ip_vs_xmit.c) |
1317 | */ | 1403 | */ |
1318 | extern int ip_vs_null_xmit | 1404 | extern int ip_vs_null_xmit(struct sk_buff *skb, struct ip_vs_conn *cp, |
1319 | (struct sk_buff *skb, struct ip_vs_conn *cp, struct ip_vs_protocol *pp); | 1405 | struct ip_vs_protocol *pp, struct ip_vs_iphdr *iph); |
1320 | extern int ip_vs_bypass_xmit | 1406 | extern int ip_vs_bypass_xmit(struct sk_buff *skb, struct ip_vs_conn *cp, |
1321 | (struct sk_buff *skb, struct ip_vs_conn *cp, struct ip_vs_protocol *pp); | 1407 | struct ip_vs_protocol *pp, |
1322 | extern int ip_vs_nat_xmit | 1408 | struct ip_vs_iphdr *iph); |
1323 | (struct sk_buff *skb, struct ip_vs_conn *cp, struct ip_vs_protocol *pp); | 1409 | extern int ip_vs_nat_xmit(struct sk_buff *skb, struct ip_vs_conn *cp, |
1324 | extern int ip_vs_tunnel_xmit | 1410 | struct ip_vs_protocol *pp, struct ip_vs_iphdr *iph); |
1325 | (struct sk_buff *skb, struct ip_vs_conn *cp, struct ip_vs_protocol *pp); | 1411 | extern int ip_vs_tunnel_xmit(struct sk_buff *skb, struct ip_vs_conn *cp, |
1326 | extern int ip_vs_dr_xmit | 1412 | struct ip_vs_protocol *pp, |
1327 | (struct sk_buff *skb, struct ip_vs_conn *cp, struct ip_vs_protocol *pp); | 1413 | struct ip_vs_iphdr *iph); |
1328 | extern int ip_vs_icmp_xmit | 1414 | extern int ip_vs_dr_xmit(struct sk_buff *skb, struct ip_vs_conn *cp, |
1329 | (struct sk_buff *skb, struct ip_vs_conn *cp, struct ip_vs_protocol *pp, | 1415 | struct ip_vs_protocol *pp, struct ip_vs_iphdr *iph); |
1330 | int offset, unsigned int hooknum); | 1416 | extern int ip_vs_icmp_xmit(struct sk_buff *skb, struct ip_vs_conn *cp, |
1417 | struct ip_vs_protocol *pp, int offset, | ||
1418 | unsigned int hooknum, struct ip_vs_iphdr *iph); | ||
1331 | extern void ip_vs_dst_reset(struct ip_vs_dest *dest); | 1419 | extern void ip_vs_dst_reset(struct ip_vs_dest *dest); |
1332 | 1420 | ||
1333 | #ifdef CONFIG_IP_VS_IPV6 | 1421 | #ifdef CONFIG_IP_VS_IPV6 |
1334 | extern int ip_vs_bypass_xmit_v6 | 1422 | extern int ip_vs_bypass_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp, |
1335 | (struct sk_buff *skb, struct ip_vs_conn *cp, struct ip_vs_protocol *pp); | 1423 | struct ip_vs_protocol *pp, |
1336 | extern int ip_vs_nat_xmit_v6 | 1424 | struct ip_vs_iphdr *iph); |
1337 | (struct sk_buff *skb, struct ip_vs_conn *cp, struct ip_vs_protocol *pp); | 1425 | extern int ip_vs_nat_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp, |
1338 | extern int ip_vs_tunnel_xmit_v6 | 1426 | struct ip_vs_protocol *pp, |
1339 | (struct sk_buff *skb, struct ip_vs_conn *cp, struct ip_vs_protocol *pp); | 1427 | struct ip_vs_iphdr *iph); |
1340 | extern int ip_vs_dr_xmit_v6 | 1428 | extern int ip_vs_tunnel_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp, |
1341 | (struct sk_buff *skb, struct ip_vs_conn *cp, struct ip_vs_protocol *pp); | 1429 | struct ip_vs_protocol *pp, |
1342 | extern int ip_vs_icmp_xmit_v6 | 1430 | struct ip_vs_iphdr *iph); |
1343 | (struct sk_buff *skb, struct ip_vs_conn *cp, struct ip_vs_protocol *pp, | 1431 | extern int ip_vs_dr_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp, |
1344 | int offset, unsigned int hooknum); | 1432 | struct ip_vs_protocol *pp, struct ip_vs_iphdr *iph); |
1433 | extern int ip_vs_icmp_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp, | ||
1434 | struct ip_vs_protocol *pp, int offset, | ||
1435 | unsigned int hooknum, struct ip_vs_iphdr *iph); | ||
1345 | #endif | 1436 | #endif |
1346 | 1437 | ||
1347 | #ifdef CONFIG_SYSCTL | 1438 | #ifdef CONFIG_SYSCTL |
diff --git a/include/net/ipip.h b/include/net/ipip.h index ddc077c51f32..21947cf4fa46 100644 --- a/include/net/ipip.h +++ b/include/net/ipip.h | |||
@@ -48,25 +48,27 @@ struct ip_tunnel_prl_entry { | |||
48 | struct rcu_head rcu_head; | 48 | struct rcu_head rcu_head; |
49 | }; | 49 | }; |
50 | 50 | ||
51 | #define __IPTUNNEL_XMIT(stats1, stats2) do { \ | 51 | static inline void iptunnel_xmit(struct sk_buff *skb, struct net_device *dev) |
52 | int err; \ | 52 | { |
53 | int pkt_len = skb->len - skb_transport_offset(skb); \ | 53 | int err; |
54 | \ | 54 | struct iphdr *iph = ip_hdr(skb); |
55 | skb->ip_summed = CHECKSUM_NONE; \ | 55 | int pkt_len = skb->len - skb_transport_offset(skb); |
56 | ip_select_ident(iph, &rt->dst, NULL); \ | 56 | struct pcpu_tstats *tstats = this_cpu_ptr(dev->tstats); |
57 | \ | ||
58 | err = ip_local_out(skb); \ | ||
59 | if (likely(net_xmit_eval(err) == 0)) { \ | ||
60 | u64_stats_update_begin(&(stats1)->syncp); \ | ||
61 | (stats1)->tx_bytes += pkt_len; \ | ||
62 | (stats1)->tx_packets++; \ | ||
63 | u64_stats_update_end(&(stats1)->syncp); \ | ||
64 | } else { \ | ||
65 | (stats2)->tx_errors++; \ | ||
66 | (stats2)->tx_aborted_errors++; \ | ||
67 | } \ | ||
68 | } while (0) | ||
69 | 57 | ||
70 | #define IPTUNNEL_XMIT() __IPTUNNEL_XMIT(txq, stats) | 58 | nf_reset(skb); |
59 | skb->ip_summed = CHECKSUM_NONE; | ||
60 | ip_select_ident(iph, skb_dst(skb), NULL); | ||
61 | |||
62 | err = ip_local_out(skb); | ||
63 | if (likely(net_xmit_eval(err) == 0)) { | ||
64 | u64_stats_update_begin(&tstats->syncp); | ||
65 | tstats->tx_bytes += pkt_len; | ||
66 | tstats->tx_packets++; | ||
67 | u64_stats_update_end(&tstats->syncp); | ||
68 | } else { | ||
69 | dev->stats.tx_errors++; | ||
70 | dev->stats.tx_aborted_errors++; | ||
71 | } | ||
72 | } | ||
71 | 73 | ||
72 | #endif | 74 | #endif |
diff --git a/include/net/mac80211.h b/include/net/mac80211.h index 82558c8decf8..db7680acd0da 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h | |||
@@ -144,6 +144,39 @@ struct ieee80211_low_level_stats { | |||
144 | }; | 144 | }; |
145 | 145 | ||
146 | /** | 146 | /** |
147 | * enum ieee80211_chanctx_change - change flag for channel context | ||
148 | * @IEEE80211_CHANCTX_CHANGE_WIDTH: The channel width changed | ||
149 | * @IEEE80211_CHANCTX_CHANGE_RX_CHAINS: The number of RX chains changed | ||
150 | */ | ||
151 | enum ieee80211_chanctx_change { | ||
152 | IEEE80211_CHANCTX_CHANGE_WIDTH = BIT(0), | ||
153 | IEEE80211_CHANCTX_CHANGE_RX_CHAINS = BIT(1), | ||
154 | }; | ||
155 | |||
156 | /** | ||
157 | * struct ieee80211_chanctx_conf - channel context that vifs may be tuned to | ||
158 | * | ||
159 | * This is the driver-visible part. The ieee80211_chanctx | ||
160 | * that contains it is visible in mac80211 only. | ||
161 | * | ||
162 | * @def: the channel definition | ||
163 | * @rx_chains_static: The number of RX chains that must always be | ||
164 | * active on the channel to receive MIMO transmissions | ||
165 | * @rx_chains_dynamic: The number of RX chains that must be enabled | ||
166 | * after RTS/CTS handshake to receive SMPS MIMO transmissions; | ||
167 | * this will always be >= @rx_chains_always. | ||
168 | * @drv_priv: data area for driver use, will always be aligned to | ||
169 | * sizeof(void *), size is determined in hw information. | ||
170 | */ | ||
171 | struct ieee80211_chanctx_conf { | ||
172 | struct cfg80211_chan_def def; | ||
173 | |||
174 | u8 rx_chains_static, rx_chains_dynamic; | ||
175 | |||
176 | u8 drv_priv[0] __attribute__((__aligned__(sizeof(void *)))); | ||
177 | }; | ||
178 | |||
179 | /** | ||
147 | * enum ieee80211_bss_change - BSS change notification flags | 180 | * enum ieee80211_bss_change - BSS change notification flags |
148 | * | 181 | * |
149 | * These flags are used with the bss_info_changed() callback | 182 | * These flags are used with the bss_info_changed() callback |
@@ -172,6 +205,9 @@ struct ieee80211_low_level_stats { | |||
172 | * @BSS_CHANGED_SSID: SSID changed for this BSS (AP mode) | 205 | * @BSS_CHANGED_SSID: SSID changed for this BSS (AP mode) |
173 | * @BSS_CHANGED_AP_PROBE_RESP: Probe Response changed for this BSS (AP mode) | 206 | * @BSS_CHANGED_AP_PROBE_RESP: Probe Response changed for this BSS (AP mode) |
174 | * @BSS_CHANGED_PS: PS changed for this BSS (STA mode) | 207 | * @BSS_CHANGED_PS: PS changed for this BSS (STA mode) |
208 | * @BSS_CHANGED_TXPOWER: TX power setting changed for this interface | ||
209 | * @BSS_CHANGED_P2P_PS: P2P powersave settings (CTWindow, opportunistic PS) | ||
210 | * changed (currently only in P2P client mode, GO mode will be later) | ||
175 | */ | 211 | */ |
176 | enum ieee80211_bss_change { | 212 | enum ieee80211_bss_change { |
177 | BSS_CHANGED_ASSOC = 1<<0, | 213 | BSS_CHANGED_ASSOC = 1<<0, |
@@ -192,6 +228,8 @@ enum ieee80211_bss_change { | |||
192 | BSS_CHANGED_SSID = 1<<15, | 228 | BSS_CHANGED_SSID = 1<<15, |
193 | BSS_CHANGED_AP_PROBE_RESP = 1<<16, | 229 | BSS_CHANGED_AP_PROBE_RESP = 1<<16, |
194 | BSS_CHANGED_PS = 1<<17, | 230 | BSS_CHANGED_PS = 1<<17, |
231 | BSS_CHANGED_TXPOWER = 1<<18, | ||
232 | BSS_CHANGED_P2P_PS = 1<<19, | ||
195 | 233 | ||
196 | /* when adding here, make sure to change ieee80211_reconfig */ | 234 | /* when adding here, make sure to change ieee80211_reconfig */ |
197 | }; | 235 | }; |
@@ -223,6 +261,7 @@ enum ieee80211_rssi_event { | |||
223 | * @assoc: association status | 261 | * @assoc: association status |
224 | * @ibss_joined: indicates whether this station is part of an IBSS | 262 | * @ibss_joined: indicates whether this station is part of an IBSS |
225 | * or not | 263 | * or not |
264 | * @ibss_creator: indicates if a new IBSS network is being created | ||
226 | * @aid: association ID number, valid only when @assoc is true | 265 | * @aid: association ID number, valid only when @assoc is true |
227 | * @use_cts_prot: use CTS protection | 266 | * @use_cts_prot: use CTS protection |
228 | * @use_short_preamble: use 802.11b short preamble; | 267 | * @use_short_preamble: use 802.11b short preamble; |
@@ -247,9 +286,8 @@ enum ieee80211_rssi_event { | |||
247 | * @mcast_rate: per-band multicast rate index + 1 (0: disabled) | 286 | * @mcast_rate: per-band multicast rate index + 1 (0: disabled) |
248 | * @bssid: The BSSID for this BSS | 287 | * @bssid: The BSSID for this BSS |
249 | * @enable_beacon: whether beaconing should be enabled or not | 288 | * @enable_beacon: whether beaconing should be enabled or not |
250 | * @channel_type: Channel type for this BSS -- the hardware might be | 289 | * @chandef: Channel definition for this BSS -- the hardware might be |
251 | * configured for HT40+ while this BSS only uses no-HT, for | 290 | * configured a higher bandwidth than this BSS uses, for example. |
252 | * example. | ||
253 | * @ht_operation_mode: HT operation mode like in &struct ieee80211_ht_operation. | 291 | * @ht_operation_mode: HT operation mode like in &struct ieee80211_ht_operation. |
254 | * This field is only valid when the channel type is one of the HT types. | 292 | * This field is only valid when the channel type is one of the HT types. |
255 | * @cqm_rssi_thold: Connection quality monitor RSSI threshold, a zero value | 293 | * @cqm_rssi_thold: Connection quality monitor RSSI threshold, a zero value |
@@ -273,11 +311,15 @@ enum ieee80211_rssi_event { | |||
273 | * @ssid: The SSID of the current vif. Only valid in AP-mode. | 311 | * @ssid: The SSID of the current vif. Only valid in AP-mode. |
274 | * @ssid_len: Length of SSID given in @ssid. | 312 | * @ssid_len: Length of SSID given in @ssid. |
275 | * @hidden_ssid: The SSID of the current vif is hidden. Only valid in AP-mode. | 313 | * @hidden_ssid: The SSID of the current vif is hidden. Only valid in AP-mode. |
314 | * @txpower: TX power in dBm | ||
315 | * @p2p_ctwindow: P2P CTWindow, only for P2P client interfaces | ||
316 | * @p2p_oppps: P2P opportunistic PS is enabled | ||
276 | */ | 317 | */ |
277 | struct ieee80211_bss_conf { | 318 | struct ieee80211_bss_conf { |
278 | const u8 *bssid; | 319 | const u8 *bssid; |
279 | /* association related data */ | 320 | /* association related data */ |
280 | bool assoc, ibss_joined; | 321 | bool assoc, ibss_joined; |
322 | bool ibss_creator; | ||
281 | u16 aid; | 323 | u16 aid; |
282 | /* erp related data */ | 324 | /* erp related data */ |
283 | bool use_cts_prot; | 325 | bool use_cts_prot; |
@@ -294,7 +336,7 @@ struct ieee80211_bss_conf { | |||
294 | u16 ht_operation_mode; | 336 | u16 ht_operation_mode; |
295 | s32 cqm_rssi_thold; | 337 | s32 cqm_rssi_thold; |
296 | u32 cqm_rssi_hyst; | 338 | u32 cqm_rssi_hyst; |
297 | enum nl80211_channel_type channel_type; | 339 | struct cfg80211_chan_def chandef; |
298 | __be32 arp_addr_list[IEEE80211_BSS_ARP_ADDR_LIST_LEN]; | 340 | __be32 arp_addr_list[IEEE80211_BSS_ARP_ADDR_LIST_LEN]; |
299 | u8 arp_addr_cnt; | 341 | u8 arp_addr_cnt; |
300 | bool arp_filter_enabled; | 342 | bool arp_filter_enabled; |
@@ -304,6 +346,9 @@ struct ieee80211_bss_conf { | |||
304 | u8 ssid[IEEE80211_MAX_SSID_LEN]; | 346 | u8 ssid[IEEE80211_MAX_SSID_LEN]; |
305 | size_t ssid_len; | 347 | size_t ssid_len; |
306 | bool hidden_ssid; | 348 | bool hidden_ssid; |
349 | int txpower; | ||
350 | u8 p2p_ctwindow; | ||
351 | bool p2p_oppps; | ||
307 | }; | 352 | }; |
308 | 353 | ||
309 | /** | 354 | /** |
@@ -454,9 +499,14 @@ enum mac80211_tx_control_flags { | |||
454 | * This is set if the current BSS requires ERP protection. | 499 | * This is set if the current BSS requires ERP protection. |
455 | * @IEEE80211_TX_RC_USE_SHORT_PREAMBLE: Use short preamble. | 500 | * @IEEE80211_TX_RC_USE_SHORT_PREAMBLE: Use short preamble. |
456 | * @IEEE80211_TX_RC_MCS: HT rate. | 501 | * @IEEE80211_TX_RC_MCS: HT rate. |
502 | * @IEEE80211_TX_RC_VHT_MCS: VHT MCS rate, in this case the idx field is split | ||
503 | * into a higher 4 bits (Nss) and lower 4 bits (MCS number) | ||
457 | * @IEEE80211_TX_RC_GREEN_FIELD: Indicates whether this rate should be used in | 504 | * @IEEE80211_TX_RC_GREEN_FIELD: Indicates whether this rate should be used in |
458 | * Greenfield mode. | 505 | * Greenfield mode. |
459 | * @IEEE80211_TX_RC_40_MHZ_WIDTH: Indicates if the Channel Width should be 40 MHz. | 506 | * @IEEE80211_TX_RC_40_MHZ_WIDTH: Indicates if the Channel Width should be 40 MHz. |
507 | * @IEEE80211_TX_RC_80_MHZ_WIDTH: Indicates 80 MHz transmission | ||
508 | * @IEEE80211_TX_RC_160_MHZ_WIDTH: Indicates 160 MHz transmission | ||
509 | * (80+80 isn't supported yet) | ||
460 | * @IEEE80211_TX_RC_DUP_DATA: The frame should be transmitted on both of the | 510 | * @IEEE80211_TX_RC_DUP_DATA: The frame should be transmitted on both of the |
461 | * adjacent 20 MHz channels, if the current channel type is | 511 | * adjacent 20 MHz channels, if the current channel type is |
462 | * NL80211_CHAN_HT40MINUS or NL80211_CHAN_HT40PLUS. | 512 | * NL80211_CHAN_HT40MINUS or NL80211_CHAN_HT40PLUS. |
@@ -467,12 +517,15 @@ enum mac80211_rate_control_flags { | |||
467 | IEEE80211_TX_RC_USE_CTS_PROTECT = BIT(1), | 517 | IEEE80211_TX_RC_USE_CTS_PROTECT = BIT(1), |
468 | IEEE80211_TX_RC_USE_SHORT_PREAMBLE = BIT(2), | 518 | IEEE80211_TX_RC_USE_SHORT_PREAMBLE = BIT(2), |
469 | 519 | ||
470 | /* rate index is an MCS rate number instead of an index */ | 520 | /* rate index is an HT/VHT MCS instead of an index */ |
471 | IEEE80211_TX_RC_MCS = BIT(3), | 521 | IEEE80211_TX_RC_MCS = BIT(3), |
472 | IEEE80211_TX_RC_GREEN_FIELD = BIT(4), | 522 | IEEE80211_TX_RC_GREEN_FIELD = BIT(4), |
473 | IEEE80211_TX_RC_40_MHZ_WIDTH = BIT(5), | 523 | IEEE80211_TX_RC_40_MHZ_WIDTH = BIT(5), |
474 | IEEE80211_TX_RC_DUP_DATA = BIT(6), | 524 | IEEE80211_TX_RC_DUP_DATA = BIT(6), |
475 | IEEE80211_TX_RC_SHORT_GI = BIT(7), | 525 | IEEE80211_TX_RC_SHORT_GI = BIT(7), |
526 | IEEE80211_TX_RC_VHT_MCS = BIT(8), | ||
527 | IEEE80211_TX_RC_80_MHZ_WIDTH = BIT(9), | ||
528 | IEEE80211_TX_RC_160_MHZ_WIDTH = BIT(10), | ||
476 | }; | 529 | }; |
477 | 530 | ||
478 | 531 | ||
@@ -515,10 +568,32 @@ enum mac80211_rate_control_flags { | |||
515 | */ | 568 | */ |
516 | struct ieee80211_tx_rate { | 569 | struct ieee80211_tx_rate { |
517 | s8 idx; | 570 | s8 idx; |
518 | u8 count; | 571 | u16 count:5, |
519 | u8 flags; | 572 | flags:11; |
520 | } __packed; | 573 | } __packed; |
521 | 574 | ||
575 | #define IEEE80211_MAX_TX_RETRY 31 | ||
576 | |||
577 | static inline void ieee80211_rate_set_vht(struct ieee80211_tx_rate *rate, | ||
578 | u8 mcs, u8 nss) | ||
579 | { | ||
580 | WARN_ON(mcs & ~0xF); | ||
581 | WARN_ON(nss & ~0x7); | ||
582 | rate->idx = (nss << 4) | mcs; | ||
583 | } | ||
584 | |||
585 | static inline u8 | ||
586 | ieee80211_rate_get_vht_mcs(const struct ieee80211_tx_rate *rate) | ||
587 | { | ||
588 | return rate->idx & 0xF; | ||
589 | } | ||
590 | |||
591 | static inline u8 | ||
592 | ieee80211_rate_get_vht_nss(const struct ieee80211_tx_rate *rate) | ||
593 | { | ||
594 | return rate->idx >> 4; | ||
595 | } | ||
596 | |||
522 | /** | 597 | /** |
523 | * struct ieee80211_tx_info - skb transmit information | 598 | * struct ieee80211_tx_info - skb transmit information |
524 | * | 599 | * |
@@ -663,13 +738,20 @@ ieee80211_tx_info_clear_status(struct ieee80211_tx_info *info) | |||
663 | * the frame. | 738 | * the frame. |
664 | * @RX_FLAG_FAILED_PLCP_CRC: Set this flag if the PCLP check failed on | 739 | * @RX_FLAG_FAILED_PLCP_CRC: Set this flag if the PCLP check failed on |
665 | * the frame. | 740 | * the frame. |
666 | * @RX_FLAG_MACTIME_MPDU: The timestamp passed in the RX status (@mactime | 741 | * @RX_FLAG_MACTIME_START: The timestamp passed in the RX status (@mactime |
667 | * field) is valid and contains the time the first symbol of the MPDU | 742 | * field) is valid and contains the time the first symbol of the MPDU |
668 | * was received. This is useful in monitor mode and for proper IBSS | 743 | * was received. This is useful in monitor mode and for proper IBSS |
669 | * merging. | 744 | * merging. |
745 | * @RX_FLAG_MACTIME_END: The timestamp passed in the RX status (@mactime | ||
746 | * field) is valid and contains the time the last symbol of the MPDU | ||
747 | * (including FCS) was received. | ||
670 | * @RX_FLAG_SHORTPRE: Short preamble was used for this frame | 748 | * @RX_FLAG_SHORTPRE: Short preamble was used for this frame |
671 | * @RX_FLAG_HT: HT MCS was used and rate_idx is MCS index | 749 | * @RX_FLAG_HT: HT MCS was used and rate_idx is MCS index |
750 | * @RX_FLAG_VHT: VHT MCS was used and rate_index is MCS index | ||
672 | * @RX_FLAG_40MHZ: HT40 (40 MHz) was used | 751 | * @RX_FLAG_40MHZ: HT40 (40 MHz) was used |
752 | * @RX_FLAG_80MHZ: 80 MHz was used | ||
753 | * @RX_FLAG_80P80MHZ: 80+80 MHz was used | ||
754 | * @RX_FLAG_160MHZ: 160 MHz was used | ||
673 | * @RX_FLAG_SHORT_GI: Short guard interval was used | 755 | * @RX_FLAG_SHORT_GI: Short guard interval was used |
674 | * @RX_FLAG_NO_SIGNAL_VAL: The signal strength value is not present. | 756 | * @RX_FLAG_NO_SIGNAL_VAL: The signal strength value is not present. |
675 | * Valid only for data frames (mainly A-MPDU) | 757 | * Valid only for data frames (mainly A-MPDU) |
@@ -697,7 +779,7 @@ enum mac80211_rx_flags { | |||
697 | RX_FLAG_IV_STRIPPED = BIT(4), | 779 | RX_FLAG_IV_STRIPPED = BIT(4), |
698 | RX_FLAG_FAILED_FCS_CRC = BIT(5), | 780 | RX_FLAG_FAILED_FCS_CRC = BIT(5), |
699 | RX_FLAG_FAILED_PLCP_CRC = BIT(6), | 781 | RX_FLAG_FAILED_PLCP_CRC = BIT(6), |
700 | RX_FLAG_MACTIME_MPDU = BIT(7), | 782 | RX_FLAG_MACTIME_START = BIT(7), |
701 | RX_FLAG_SHORTPRE = BIT(8), | 783 | RX_FLAG_SHORTPRE = BIT(8), |
702 | RX_FLAG_HT = BIT(9), | 784 | RX_FLAG_HT = BIT(9), |
703 | RX_FLAG_40MHZ = BIT(10), | 785 | RX_FLAG_40MHZ = BIT(10), |
@@ -711,6 +793,11 @@ enum mac80211_rx_flags { | |||
711 | RX_FLAG_AMPDU_IS_LAST = BIT(18), | 793 | RX_FLAG_AMPDU_IS_LAST = BIT(18), |
712 | RX_FLAG_AMPDU_DELIM_CRC_ERROR = BIT(19), | 794 | RX_FLAG_AMPDU_DELIM_CRC_ERROR = BIT(19), |
713 | RX_FLAG_AMPDU_DELIM_CRC_KNOWN = BIT(20), | 795 | RX_FLAG_AMPDU_DELIM_CRC_KNOWN = BIT(20), |
796 | RX_FLAG_MACTIME_END = BIT(21), | ||
797 | RX_FLAG_VHT = BIT(22), | ||
798 | RX_FLAG_80MHZ = BIT(23), | ||
799 | RX_FLAG_80P80MHZ = BIT(24), | ||
800 | RX_FLAG_160MHZ = BIT(25), | ||
714 | }; | 801 | }; |
715 | 802 | ||
716 | /** | 803 | /** |
@@ -731,25 +818,39 @@ enum mac80211_rx_flags { | |||
731 | * @IEEE80211_HW_SIGNAL_* | 818 | * @IEEE80211_HW_SIGNAL_* |
732 | * @antenna: antenna used | 819 | * @antenna: antenna used |
733 | * @rate_idx: index of data rate into band's supported rates or MCS index if | 820 | * @rate_idx: index of data rate into band's supported rates or MCS index if |
734 | * HT rates are use (RX_FLAG_HT) | 821 | * HT or VHT is used (%RX_FLAG_HT/%RX_FLAG_VHT) |
822 | * @vht_nss: number of streams (VHT only) | ||
735 | * @flag: %RX_FLAG_* | 823 | * @flag: %RX_FLAG_* |
736 | * @rx_flags: internal RX flags for mac80211 | 824 | * @rx_flags: internal RX flags for mac80211 |
737 | * @ampdu_reference: A-MPDU reference number, must be a different value for | 825 | * @ampdu_reference: A-MPDU reference number, must be a different value for |
738 | * each A-MPDU but the same for each subframe within one A-MPDU | 826 | * each A-MPDU but the same for each subframe within one A-MPDU |
739 | * @ampdu_delimiter_crc: A-MPDU delimiter CRC | 827 | * @ampdu_delimiter_crc: A-MPDU delimiter CRC |
828 | * @vendor_radiotap_bitmap: radiotap vendor namespace presence bitmap | ||
829 | * @vendor_radiotap_len: radiotap vendor namespace length | ||
830 | * @vendor_radiotap_align: radiotap vendor namespace alignment. Note | ||
831 | * that the actual data must be at the start of the SKB data | ||
832 | * already. | ||
833 | * @vendor_radiotap_oui: radiotap vendor namespace OUI | ||
834 | * @vendor_radiotap_subns: radiotap vendor sub namespace | ||
740 | */ | 835 | */ |
741 | struct ieee80211_rx_status { | 836 | struct ieee80211_rx_status { |
742 | u64 mactime; | 837 | u64 mactime; |
743 | u32 device_timestamp; | 838 | u32 device_timestamp; |
744 | u32 ampdu_reference; | 839 | u32 ampdu_reference; |
745 | u32 flag; | 840 | u32 flag; |
841 | u32 vendor_radiotap_bitmap; | ||
842 | u16 vendor_radiotap_len; | ||
746 | u16 freq; | 843 | u16 freq; |
747 | u8 rate_idx; | 844 | u8 rate_idx; |
845 | u8 vht_nss; | ||
748 | u8 rx_flags; | 846 | u8 rx_flags; |
749 | u8 band; | 847 | u8 band; |
750 | u8 antenna; | 848 | u8 antenna; |
751 | s8 signal; | 849 | s8 signal; |
752 | u8 ampdu_delimiter_crc; | 850 | u8 ampdu_delimiter_crc; |
851 | u8 vendor_radiotap_align; | ||
852 | u8 vendor_radiotap_oui[3]; | ||
853 | u8 vendor_radiotap_subns; | ||
753 | }; | 854 | }; |
754 | 855 | ||
755 | /** | 856 | /** |
@@ -794,6 +895,8 @@ enum ieee80211_conf_flags { | |||
794 | * @IEEE80211_CONF_CHANGE_RETRY_LIMITS: retry limits changed | 895 | * @IEEE80211_CONF_CHANGE_RETRY_LIMITS: retry limits changed |
795 | * @IEEE80211_CONF_CHANGE_IDLE: Idle flag changed | 896 | * @IEEE80211_CONF_CHANGE_IDLE: Idle flag changed |
796 | * @IEEE80211_CONF_CHANGE_SMPS: Spatial multiplexing powersave mode changed | 897 | * @IEEE80211_CONF_CHANGE_SMPS: Spatial multiplexing powersave mode changed |
898 | * Note that this is only valid if channel contexts are not used, | ||
899 | * otherwise each channel context has the number of chains listed. | ||
797 | */ | 900 | */ |
798 | enum ieee80211_conf_changed { | 901 | enum ieee80211_conf_changed { |
799 | IEEE80211_CONF_CHANGE_SMPS = BIT(1), | 902 | IEEE80211_CONF_CHANGE_SMPS = BIT(1), |
@@ -845,7 +948,8 @@ enum ieee80211_smps_mode { | |||
845 | * powersave documentation below. This variable is valid only when | 948 | * powersave documentation below. This variable is valid only when |
846 | * the CONF_PS flag is set. | 949 | * the CONF_PS flag is set. |
847 | * | 950 | * |
848 | * @power_level: requested transmit power (in dBm) | 951 | * @power_level: requested transmit power (in dBm), backward compatibility |
952 | * value only that is set to the minimum of all interfaces | ||
849 | * | 953 | * |
850 | * @channel: the channel to tune to | 954 | * @channel: the channel to tune to |
851 | * @channel_type: the channel (HT) type | 955 | * @channel_type: the channel (HT) type |
@@ -859,7 +963,9 @@ enum ieee80211_smps_mode { | |||
859 | * | 963 | * |
860 | * @smps_mode: spatial multiplexing powersave mode; note that | 964 | * @smps_mode: spatial multiplexing powersave mode; note that |
861 | * %IEEE80211_SMPS_STATIC is used when the device is not | 965 | * %IEEE80211_SMPS_STATIC is used when the device is not |
862 | * configured for an HT channel | 966 | * configured for an HT channel. |
967 | * Note that this is only valid if channel contexts are not used, | ||
968 | * otherwise each channel context has the number of chains listed. | ||
863 | */ | 969 | */ |
864 | struct ieee80211_conf { | 970 | struct ieee80211_conf { |
865 | u32 flags; | 971 | u32 flags; |
@@ -931,6 +1037,11 @@ enum ieee80211_vif_flags { | |||
931 | * at runtime, mac80211 will never touch this field | 1037 | * at runtime, mac80211 will never touch this field |
932 | * @hw_queue: hardware queue for each AC | 1038 | * @hw_queue: hardware queue for each AC |
933 | * @cab_queue: content-after-beacon (DTIM beacon really) queue, AP mode only | 1039 | * @cab_queue: content-after-beacon (DTIM beacon really) queue, AP mode only |
1040 | * @chanctx_conf: The channel context this interface is assigned to, or %NULL | ||
1041 | * when it is not assigned. This pointer is RCU-protected due to the TX | ||
1042 | * path needing to access it; even though the netdev carrier will always | ||
1043 | * be off when it is %NULL there can still be races and packets could be | ||
1044 | * processed after it switches back to %NULL. | ||
934 | * @drv_priv: data area for driver use, will always be aligned to | 1045 | * @drv_priv: data area for driver use, will always be aligned to |
935 | * sizeof(void *). | 1046 | * sizeof(void *). |
936 | */ | 1047 | */ |
@@ -943,6 +1054,8 @@ struct ieee80211_vif { | |||
943 | u8 cab_queue; | 1054 | u8 cab_queue; |
944 | u8 hw_queue[IEEE80211_NUM_ACS]; | 1055 | u8 hw_queue[IEEE80211_NUM_ACS]; |
945 | 1056 | ||
1057 | struct ieee80211_chanctx_conf __rcu *chanctx_conf; | ||
1058 | |||
946 | u32 driver_flags; | 1059 | u32 driver_flags; |
947 | 1060 | ||
948 | /* must be last */ | 1061 | /* must be last */ |
@@ -1076,6 +1189,8 @@ enum ieee80211_sta_state { | |||
1076 | * @aid: AID we assigned to the station if we're an AP | 1189 | * @aid: AID we assigned to the station if we're an AP |
1077 | * @supp_rates: Bitmap of supported rates (per band) | 1190 | * @supp_rates: Bitmap of supported rates (per band) |
1078 | * @ht_cap: HT capabilities of this STA; restricted to our own TX capabilities | 1191 | * @ht_cap: HT capabilities of this STA; restricted to our own TX capabilities |
1192 | * @vht_cap: VHT capabilities of this STA; Not restricting any capabilities | ||
1193 | * of remote STA. Taking as is. | ||
1079 | * @wme: indicates whether the STA supports WME. Only valid during AP-mode. | 1194 | * @wme: indicates whether the STA supports WME. Only valid during AP-mode. |
1080 | * @drv_priv: data area for driver use, will always be aligned to | 1195 | * @drv_priv: data area for driver use, will always be aligned to |
1081 | * sizeof(void *), size is determined in hw information. | 1196 | * sizeof(void *), size is determined in hw information. |
@@ -1088,6 +1203,7 @@ struct ieee80211_sta { | |||
1088 | u8 addr[ETH_ALEN]; | 1203 | u8 addr[ETH_ALEN]; |
1089 | u16 aid; | 1204 | u16 aid; |
1090 | struct ieee80211_sta_ht_cap ht_cap; | 1205 | struct ieee80211_sta_ht_cap ht_cap; |
1206 | struct ieee80211_sta_vht_cap vht_cap; | ||
1091 | bool wme; | 1207 | bool wme; |
1092 | u8 uapsd_queues; | 1208 | u8 uapsd_queues; |
1093 | u8 max_sp; | 1209 | u8 max_sp; |
@@ -1325,6 +1441,8 @@ enum ieee80211_hw_flags { | |||
1325 | * within &struct ieee80211_vif. | 1441 | * within &struct ieee80211_vif. |
1326 | * @sta_data_size: size (in bytes) of the drv_priv data area | 1442 | * @sta_data_size: size (in bytes) of the drv_priv data area |
1327 | * within &struct ieee80211_sta. | 1443 | * within &struct ieee80211_sta. |
1444 | * @chanctx_data_size: size (in bytes) of the drv_priv data area | ||
1445 | * within &struct ieee80211_chanctx_conf. | ||
1328 | * | 1446 | * |
1329 | * @max_rates: maximum number of alternate rate retry stages the hw | 1447 | * @max_rates: maximum number of alternate rate retry stages the hw |
1330 | * can handle. | 1448 | * can handle. |
@@ -1369,6 +1487,7 @@ struct ieee80211_hw { | |||
1369 | int channel_change_time; | 1487 | int channel_change_time; |
1370 | int vif_data_size; | 1488 | int vif_data_size; |
1371 | int sta_data_size; | 1489 | int sta_data_size; |
1490 | int chanctx_data_size; | ||
1372 | int napi_weight; | 1491 | int napi_weight; |
1373 | u16 queues; | 1492 | u16 queues; |
1374 | u16 max_listen_interval; | 1493 | u16 max_listen_interval; |
@@ -2126,6 +2245,14 @@ enum ieee80211_rate_control_changed { | |||
2126 | * @sta_remove: Notifies low level driver about removal of an associated | 2245 | * @sta_remove: Notifies low level driver about removal of an associated |
2127 | * station, AP, IBSS/WDS/mesh peer etc. This callback can sleep. | 2246 | * station, AP, IBSS/WDS/mesh peer etc. This callback can sleep. |
2128 | * | 2247 | * |
2248 | * @sta_add_debugfs: Drivers can use this callback to add debugfs files | ||
2249 | * when a station is added to mac80211's station list. This callback | ||
2250 | * and @sta_remove_debugfs should be within a CONFIG_MAC80211_DEBUGFS | ||
2251 | * conditional. This callback can sleep. | ||
2252 | * | ||
2253 | * @sta_remove_debugfs: Remove the debugfs files which were added using | ||
2254 | * @sta_add_debugfs. This callback can sleep. | ||
2255 | * | ||
2129 | * @sta_notify: Notifies low level driver about power state transition of an | 2256 | * @sta_notify: Notifies low level driver about power state transition of an |
2130 | * associated station, AP, IBSS/WDS/mesh peer etc. For a VIF operating | 2257 | * associated station, AP, IBSS/WDS/mesh peer etc. For a VIF operating |
2131 | * in AP mode, this callback will not be called when the flag | 2258 | * in AP mode, this callback will not be called when the flag |
@@ -2317,6 +2444,27 @@ enum ieee80211_rate_control_changed { | |||
2317 | * The callback will be called before each transmission and upon return | 2444 | * The callback will be called before each transmission and upon return |
2318 | * mac80211 will transmit the frame right away. | 2445 | * mac80211 will transmit the frame right away. |
2319 | * The callback is optional and can (should!) sleep. | 2446 | * The callback is optional and can (should!) sleep. |
2447 | * | ||
2448 | * @add_chanctx: Notifies device driver about new channel context creation. | ||
2449 | * @remove_chanctx: Notifies device driver about channel context destruction. | ||
2450 | * @change_chanctx: Notifies device driver about channel context changes that | ||
2451 | * may happen when combining different virtual interfaces on the same | ||
2452 | * channel context with different settings | ||
2453 | * @assign_vif_chanctx: Notifies device driver about channel context being bound | ||
2454 | * to vif. Possible use is for hw queue remapping. | ||
2455 | * @unassign_vif_chanctx: Notifies device driver about channel context being | ||
2456 | * unbound from vif. | ||
2457 | * @start_ap: Start operation on the AP interface, this is called after all the | ||
2458 | * information in bss_conf is set and beacon can be retrieved. A channel | ||
2459 | * context is bound before this is called. Note that if the driver uses | ||
2460 | * software scan or ROC, this (and @stop_ap) isn't called when the AP is | ||
2461 | * just "paused" for scanning/ROC, which is indicated by the beacon being | ||
2462 | * disabled/enabled via @bss_info_changed. | ||
2463 | * @stop_ap: Stop operation on the AP interface. | ||
2464 | * | ||
2465 | * @restart_complete: Called after a call to ieee80211_restart_hw(), when the | ||
2466 | * reconfiguration has completed. This can help the driver implement the | ||
2467 | * reconfiguration step. This callback may sleep. | ||
2320 | */ | 2468 | */ |
2321 | struct ieee80211_ops { | 2469 | struct ieee80211_ops { |
2322 | void (*tx)(struct ieee80211_hw *hw, | 2470 | void (*tx)(struct ieee80211_hw *hw, |
@@ -2342,6 +2490,9 @@ struct ieee80211_ops { | |||
2342 | struct ieee80211_bss_conf *info, | 2490 | struct ieee80211_bss_conf *info, |
2343 | u32 changed); | 2491 | u32 changed); |
2344 | 2492 | ||
2493 | int (*start_ap)(struct ieee80211_hw *hw, struct ieee80211_vif *vif); | ||
2494 | void (*stop_ap)(struct ieee80211_hw *hw, struct ieee80211_vif *vif); | ||
2495 | |||
2345 | u64 (*prepare_multicast)(struct ieee80211_hw *hw, | 2496 | u64 (*prepare_multicast)(struct ieee80211_hw *hw, |
2346 | struct netdev_hw_addr_list *mc_list); | 2497 | struct netdev_hw_addr_list *mc_list); |
2347 | void (*configure_filter)(struct ieee80211_hw *hw, | 2498 | void (*configure_filter)(struct ieee80211_hw *hw, |
@@ -2383,6 +2534,16 @@ struct ieee80211_ops { | |||
2383 | struct ieee80211_sta *sta); | 2534 | struct ieee80211_sta *sta); |
2384 | int (*sta_remove)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, | 2535 | int (*sta_remove)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, |
2385 | struct ieee80211_sta *sta); | 2536 | struct ieee80211_sta *sta); |
2537 | #ifdef CONFIG_MAC80211_DEBUGFS | ||
2538 | void (*sta_add_debugfs)(struct ieee80211_hw *hw, | ||
2539 | struct ieee80211_vif *vif, | ||
2540 | struct ieee80211_sta *sta, | ||
2541 | struct dentry *dir); | ||
2542 | void (*sta_remove_debugfs)(struct ieee80211_hw *hw, | ||
2543 | struct ieee80211_vif *vif, | ||
2544 | struct ieee80211_sta *sta, | ||
2545 | struct dentry *dir); | ||
2546 | #endif | ||
2386 | void (*sta_notify)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, | 2547 | void (*sta_notify)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, |
2387 | enum sta_notify_cmd, struct ieee80211_sta *sta); | 2548 | enum sta_notify_cmd, struct ieee80211_sta *sta); |
2388 | int (*sta_state)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, | 2549 | int (*sta_state)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, |
@@ -2424,8 +2585,8 @@ struct ieee80211_ops { | |||
2424 | int (*get_antenna)(struct ieee80211_hw *hw, u32 *tx_ant, u32 *rx_ant); | 2585 | int (*get_antenna)(struct ieee80211_hw *hw, u32 *tx_ant, u32 *rx_ant); |
2425 | 2586 | ||
2426 | int (*remain_on_channel)(struct ieee80211_hw *hw, | 2587 | int (*remain_on_channel)(struct ieee80211_hw *hw, |
2588 | struct ieee80211_vif *vif, | ||
2427 | struct ieee80211_channel *chan, | 2589 | struct ieee80211_channel *chan, |
2428 | enum nl80211_channel_type channel_type, | ||
2429 | int duration); | 2590 | int duration); |
2430 | int (*cancel_remain_on_channel)(struct ieee80211_hw *hw); | 2591 | int (*cancel_remain_on_channel)(struct ieee80211_hw *hw); |
2431 | int (*set_ringparam)(struct ieee80211_hw *hw, u32 tx, u32 rx); | 2592 | int (*set_ringparam)(struct ieee80211_hw *hw, u32 tx, u32 rx); |
@@ -2461,6 +2622,22 @@ struct ieee80211_ops { | |||
2461 | 2622 | ||
2462 | void (*mgd_prepare_tx)(struct ieee80211_hw *hw, | 2623 | void (*mgd_prepare_tx)(struct ieee80211_hw *hw, |
2463 | struct ieee80211_vif *vif); | 2624 | struct ieee80211_vif *vif); |
2625 | |||
2626 | int (*add_chanctx)(struct ieee80211_hw *hw, | ||
2627 | struct ieee80211_chanctx_conf *ctx); | ||
2628 | void (*remove_chanctx)(struct ieee80211_hw *hw, | ||
2629 | struct ieee80211_chanctx_conf *ctx); | ||
2630 | void (*change_chanctx)(struct ieee80211_hw *hw, | ||
2631 | struct ieee80211_chanctx_conf *ctx, | ||
2632 | u32 changed); | ||
2633 | int (*assign_vif_chanctx)(struct ieee80211_hw *hw, | ||
2634 | struct ieee80211_vif *vif, | ||
2635 | struct ieee80211_chanctx_conf *ctx); | ||
2636 | void (*unassign_vif_chanctx)(struct ieee80211_hw *hw, | ||
2637 | struct ieee80211_vif *vif, | ||
2638 | struct ieee80211_chanctx_conf *ctx); | ||
2639 | |||
2640 | void (*restart_complete)(struct ieee80211_hw *hw); | ||
2464 | }; | 2641 | }; |
2465 | 2642 | ||
2466 | /** | 2643 | /** |
@@ -3145,6 +3322,19 @@ void ieee80211_get_tkip_p2k(struct ieee80211_key_conf *keyconf, | |||
3145 | struct sk_buff *skb, u8 *p2k); | 3322 | struct sk_buff *skb, u8 *p2k); |
3146 | 3323 | ||
3147 | /** | 3324 | /** |
3325 | * ieee80211_aes_cmac_calculate_k1_k2 - calculate the AES-CMAC sub keys | ||
3326 | * | ||
3327 | * This function computes the two AES-CMAC sub-keys, based on the | ||
3328 | * previously installed master key. | ||
3329 | * | ||
3330 | * @keyconf: the parameter passed with the set key | ||
3331 | * @k1: a buffer to be filled with the 1st sub-key | ||
3332 | * @k2: a buffer to be filled with the 2nd sub-key | ||
3333 | */ | ||
3334 | void ieee80211_aes_cmac_calculate_k1_k2(struct ieee80211_key_conf *keyconf, | ||
3335 | u8 *k1, u8 *k2); | ||
3336 | |||
3337 | /** | ||
3148 | * struct ieee80211_key_seq - key sequence counter | 3338 | * struct ieee80211_key_seq - key sequence counter |
3149 | * | 3339 | * |
3150 | * @tkip: TKIP data, containing IV32 and IV16 in host byte order | 3340 | * @tkip: TKIP data, containing IV32 and IV16 in host byte order |
@@ -3294,6 +3484,21 @@ void ieee80211_sched_scan_results(struct ieee80211_hw *hw); | |||
3294 | void ieee80211_sched_scan_stopped(struct ieee80211_hw *hw); | 3484 | void ieee80211_sched_scan_stopped(struct ieee80211_hw *hw); |
3295 | 3485 | ||
3296 | /** | 3486 | /** |
3487 | * enum ieee80211_interface_iteration_flags - interface iteration flags | ||
3488 | * @IEEE80211_IFACE_ITER_NORMAL: Iterate over all interfaces that have | ||
3489 | * been added to the driver; However, note that during hardware | ||
3490 | * reconfiguration (after restart_hw) it will iterate over a new | ||
3491 | * interface and over all the existing interfaces even if they | ||
3492 | * haven't been re-added to the driver yet. | ||
3493 | * @IEEE80211_IFACE_ITER_RESUME_ALL: During resume, iterate over all | ||
3494 | * interfaces, even if they haven't been re-added to the driver yet. | ||
3495 | */ | ||
3496 | enum ieee80211_interface_iteration_flags { | ||
3497 | IEEE80211_IFACE_ITER_NORMAL = 0, | ||
3498 | IEEE80211_IFACE_ITER_RESUME_ALL = BIT(0), | ||
3499 | }; | ||
3500 | |||
3501 | /** | ||
3297 | * ieee80211_iterate_active_interfaces - iterate active interfaces | 3502 | * ieee80211_iterate_active_interfaces - iterate active interfaces |
3298 | * | 3503 | * |
3299 | * This function iterates over the interfaces associated with a given | 3504 | * This function iterates over the interfaces associated with a given |
@@ -3301,13 +3506,15 @@ void ieee80211_sched_scan_stopped(struct ieee80211_hw *hw); | |||
3301 | * This function allows the iterator function to sleep, when the iterator | 3506 | * This function allows the iterator function to sleep, when the iterator |
3302 | * function is atomic @ieee80211_iterate_active_interfaces_atomic can | 3507 | * function is atomic @ieee80211_iterate_active_interfaces_atomic can |
3303 | * be used. | 3508 | * be used. |
3304 | * Does not iterate over a new interface during add_interface() | 3509 | * Does not iterate over a new interface during add_interface(). |
3305 | * | 3510 | * |
3306 | * @hw: the hardware struct of which the interfaces should be iterated over | 3511 | * @hw: the hardware struct of which the interfaces should be iterated over |
3512 | * @iter_flags: iteration flags, see &enum ieee80211_interface_iteration_flags | ||
3307 | * @iterator: the iterator function to call | 3513 | * @iterator: the iterator function to call |
3308 | * @data: first argument of the iterator function | 3514 | * @data: first argument of the iterator function |
3309 | */ | 3515 | */ |
3310 | void ieee80211_iterate_active_interfaces(struct ieee80211_hw *hw, | 3516 | void ieee80211_iterate_active_interfaces(struct ieee80211_hw *hw, |
3517 | u32 iter_flags, | ||
3311 | void (*iterator)(void *data, u8 *mac, | 3518 | void (*iterator)(void *data, u8 *mac, |
3312 | struct ieee80211_vif *vif), | 3519 | struct ieee80211_vif *vif), |
3313 | void *data); | 3520 | void *data); |
@@ -3319,13 +3526,15 @@ void ieee80211_iterate_active_interfaces(struct ieee80211_hw *hw, | |||
3319 | * hardware that are currently active and calls the callback for them. | 3526 | * hardware that are currently active and calls the callback for them. |
3320 | * This function requires the iterator callback function to be atomic, | 3527 | * This function requires the iterator callback function to be atomic, |
3321 | * if that is not desired, use @ieee80211_iterate_active_interfaces instead. | 3528 | * if that is not desired, use @ieee80211_iterate_active_interfaces instead. |
3322 | * Does not iterate over a new interface during add_interface() | 3529 | * Does not iterate over a new interface during add_interface(). |
3323 | * | 3530 | * |
3324 | * @hw: the hardware struct of which the interfaces should be iterated over | 3531 | * @hw: the hardware struct of which the interfaces should be iterated over |
3532 | * @iter_flags: iteration flags, see &enum ieee80211_interface_iteration_flags | ||
3325 | * @iterator: the iterator function to call, cannot sleep | 3533 | * @iterator: the iterator function to call, cannot sleep |
3326 | * @data: first argument of the iterator function | 3534 | * @data: first argument of the iterator function |
3327 | */ | 3535 | */ |
3328 | void ieee80211_iterate_active_interfaces_atomic(struct ieee80211_hw *hw, | 3536 | void ieee80211_iterate_active_interfaces_atomic(struct ieee80211_hw *hw, |
3537 | u32 iter_flags, | ||
3329 | void (*iterator)(void *data, | 3538 | void (*iterator)(void *data, |
3330 | u8 *mac, | 3539 | u8 *mac, |
3331 | struct ieee80211_vif *vif), | 3540 | struct ieee80211_vif *vif), |
@@ -3524,6 +3733,27 @@ void ieee80211_iter_keys(struct ieee80211_hw *hw, | |||
3524 | void *iter_data); | 3733 | void *iter_data); |
3525 | 3734 | ||
3526 | /** | 3735 | /** |
3736 | * ieee80211_iter_chan_contexts_atomic - iterate channel contexts | ||
3737 | * @hw: pointre obtained from ieee80211_alloc_hw(). | ||
3738 | * @iter: iterator function | ||
3739 | * @iter_data: data passed to iterator function | ||
3740 | * | ||
3741 | * Iterate all active channel contexts. This function is atomic and | ||
3742 | * doesn't acquire any locks internally that might be held in other | ||
3743 | * places while calling into the driver. | ||
3744 | * | ||
3745 | * The iterator will not find a context that's being added (during | ||
3746 | * the driver callback to add it) but will find it while it's being | ||
3747 | * removed. | ||
3748 | */ | ||
3749 | void ieee80211_iter_chan_contexts_atomic( | ||
3750 | struct ieee80211_hw *hw, | ||
3751 | void (*iter)(struct ieee80211_hw *hw, | ||
3752 | struct ieee80211_chanctx_conf *chanctx_conf, | ||
3753 | void *data), | ||
3754 | void *iter_data); | ||
3755 | |||
3756 | /** | ||
3527 | * ieee80211_ap_probereq_get - retrieve a Probe Request template | 3757 | * ieee80211_ap_probereq_get - retrieve a Probe Request template |
3528 | * @hw: pointer obtained from ieee80211_alloc_hw(). | 3758 | * @hw: pointer obtained from ieee80211_alloc_hw(). |
3529 | * @vif: &struct ieee80211_vif pointer from the add_interface callback. | 3759 | * @vif: &struct ieee80211_vif pointer from the add_interface callback. |
diff --git a/include/net/net_namespace.h b/include/net/net_namespace.h index 95e646641184..c5a43f56b796 100644 --- a/include/net/net_namespace.h +++ b/include/net/net_namespace.h | |||
@@ -23,6 +23,7 @@ | |||
23 | #endif | 23 | #endif |
24 | #include <net/netns/xfrm.h> | 24 | #include <net/netns/xfrm.h> |
25 | 25 | ||
26 | struct user_namespace; | ||
26 | struct proc_dir_entry; | 27 | struct proc_dir_entry; |
27 | struct net_device; | 28 | struct net_device; |
28 | struct sock; | 29 | struct sock; |
@@ -53,6 +54,8 @@ struct net { | |||
53 | struct list_head cleanup_list; /* namespaces on death row */ | 54 | struct list_head cleanup_list; /* namespaces on death row */ |
54 | struct list_head exit_list; /* Use only net_mutex */ | 55 | struct list_head exit_list; /* Use only net_mutex */ |
55 | 56 | ||
57 | struct user_namespace *user_ns; /* Owning user namespace */ | ||
58 | |||
56 | struct proc_dir_entry *proc_net; | 59 | struct proc_dir_entry *proc_net; |
57 | struct proc_dir_entry *proc_net_stat; | 60 | struct proc_dir_entry *proc_net_stat; |
58 | 61 | ||
@@ -126,16 +129,21 @@ struct net { | |||
126 | /* Init's network namespace */ | 129 | /* Init's network namespace */ |
127 | extern struct net init_net; | 130 | extern struct net init_net; |
128 | 131 | ||
129 | #ifdef CONFIG_NET | 132 | #ifdef CONFIG_NET_NS |
130 | extern struct net *copy_net_ns(unsigned long flags, struct net *net_ns); | 133 | extern struct net *copy_net_ns(unsigned long flags, |
131 | 134 | struct user_namespace *user_ns, struct net *old_net); | |
132 | #else /* CONFIG_NET */ | 135 | |
133 | static inline struct net *copy_net_ns(unsigned long flags, struct net *net_ns) | 136 | #else /* CONFIG_NET_NS */ |
137 | #include <linux/sched.h> | ||
138 | #include <linux/nsproxy.h> | ||
139 | static inline struct net *copy_net_ns(unsigned long flags, | ||
140 | struct user_namespace *user_ns, struct net *old_net) | ||
134 | { | 141 | { |
135 | /* There is nothing to copy so this is a noop */ | 142 | if (flags & CLONE_NEWNET) |
136 | return net_ns; | 143 | return ERR_PTR(-EINVAL); |
144 | return old_net; | ||
137 | } | 145 | } |
138 | #endif /* CONFIG_NET */ | 146 | #endif /* CONFIG_NET_NS */ |
139 | 147 | ||
140 | 148 | ||
141 | extern struct list_head net_namespace_list; | 149 | extern struct list_head net_namespace_list; |
diff --git a/include/net/netns/sctp.h b/include/net/netns/sctp.h index 5e5eb1f9f14b..3573a81815ad 100644 --- a/include/net/netns/sctp.h +++ b/include/net/netns/sctp.h | |||
@@ -62,6 +62,9 @@ struct netns_sctp { | |||
62 | /* Whether Cookie Preservative is enabled(1) or not(0) */ | 62 | /* Whether Cookie Preservative is enabled(1) or not(0) */ |
63 | int cookie_preserve_enable; | 63 | int cookie_preserve_enable; |
64 | 64 | ||
65 | /* The namespace default hmac alg */ | ||
66 | char *sctp_hmac_alg; | ||
67 | |||
65 | /* Valid.Cookie.Life - 60 seconds */ | 68 | /* Valid.Cookie.Life - 60 seconds */ |
66 | unsigned int valid_cookie_life; | 69 | unsigned int valid_cookie_life; |
67 | 70 | ||
diff --git a/include/net/nfc/hci.h b/include/net/nfc/hci.h index e900072950cb..671953e11575 100644 --- a/include/net/nfc/hci.h +++ b/include/net/nfc/hci.h | |||
@@ -24,6 +24,12 @@ | |||
24 | 24 | ||
25 | #include <net/nfc/nfc.h> | 25 | #include <net/nfc/nfc.h> |
26 | 26 | ||
27 | struct nfc_phy_ops { | ||
28 | int (*write)(void *dev_id, struct sk_buff *skb); | ||
29 | int (*enable)(void *dev_id); | ||
30 | void (*disable)(void *dev_id); | ||
31 | }; | ||
32 | |||
27 | struct nfc_hci_dev; | 33 | struct nfc_hci_dev; |
28 | 34 | ||
29 | struct nfc_hci_ops { | 35 | struct nfc_hci_ops { |
@@ -38,15 +44,21 @@ struct nfc_hci_ops { | |||
38 | int (*xmit) (struct nfc_hci_dev *hdev, struct sk_buff *skb); | 44 | int (*xmit) (struct nfc_hci_dev *hdev, struct sk_buff *skb); |
39 | int (*start_poll) (struct nfc_hci_dev *hdev, | 45 | int (*start_poll) (struct nfc_hci_dev *hdev, |
40 | u32 im_protocols, u32 tm_protocols); | 46 | u32 im_protocols, u32 tm_protocols); |
47 | int (*dep_link_up)(struct nfc_hci_dev *hdev, struct nfc_target *target, | ||
48 | u8 comm_mode, u8 *gb, size_t gb_len); | ||
49 | int (*dep_link_down)(struct nfc_hci_dev *hdev); | ||
41 | int (*target_from_gate) (struct nfc_hci_dev *hdev, u8 gate, | 50 | int (*target_from_gate) (struct nfc_hci_dev *hdev, u8 gate, |
42 | struct nfc_target *target); | 51 | struct nfc_target *target); |
43 | int (*complete_target_discovered) (struct nfc_hci_dev *hdev, u8 gate, | 52 | int (*complete_target_discovered) (struct nfc_hci_dev *hdev, u8 gate, |
44 | struct nfc_target *target); | 53 | struct nfc_target *target); |
45 | int (*data_exchange) (struct nfc_hci_dev *hdev, | 54 | int (*im_transceive) (struct nfc_hci_dev *hdev, |
46 | struct nfc_target *target, struct sk_buff *skb, | 55 | struct nfc_target *target, struct sk_buff *skb, |
47 | data_exchange_cb_t cb, void *cb_context); | 56 | data_exchange_cb_t cb, void *cb_context); |
57 | int (*tm_send)(struct nfc_hci_dev *hdev, struct sk_buff *skb); | ||
48 | int (*check_presence)(struct nfc_hci_dev *hdev, | 58 | int (*check_presence)(struct nfc_hci_dev *hdev, |
49 | struct nfc_target *target); | 59 | struct nfc_target *target); |
60 | void (*event_received)(struct nfc_hci_dev *hdev, u8 gate, u8 event, | ||
61 | struct sk_buff *skb); | ||
50 | }; | 62 | }; |
51 | 63 | ||
52 | /* Pipes */ | 64 | /* Pipes */ |
@@ -114,6 +126,9 @@ struct nfc_hci_dev { | |||
114 | int async_cb_type; | 126 | int async_cb_type; |
115 | data_exchange_cb_t async_cb; | 127 | data_exchange_cb_t async_cb; |
116 | void *async_cb_context; | 128 | void *async_cb_context; |
129 | |||
130 | u8 *gb; | ||
131 | size_t gb_len; | ||
117 | }; | 132 | }; |
118 | 133 | ||
119 | /* hci device allocation */ | 134 | /* hci device allocation */ |
@@ -134,6 +149,8 @@ void *nfc_hci_get_clientdata(struct nfc_hci_dev *hdev); | |||
134 | 149 | ||
135 | void nfc_hci_driver_failure(struct nfc_hci_dev *hdev, int err); | 150 | void nfc_hci_driver_failure(struct nfc_hci_dev *hdev, int err); |
136 | 151 | ||
152 | int nfc_hci_result_to_errno(u8 result); | ||
153 | |||
137 | /* Host IDs */ | 154 | /* Host IDs */ |
138 | #define NFC_HCI_HOST_CONTROLLER_ID 0x00 | 155 | #define NFC_HCI_HOST_CONTROLLER_ID 0x00 |
139 | #define NFC_HCI_TERMINAL_HOST_ID 0x01 | 156 | #define NFC_HCI_TERMINAL_HOST_ID 0x01 |
@@ -219,5 +236,7 @@ int nfc_hci_send_response(struct nfc_hci_dev *hdev, u8 gate, u8 response, | |||
219 | const u8 *param, size_t param_len); | 236 | const u8 *param, size_t param_len); |
220 | int nfc_hci_send_event(struct nfc_hci_dev *hdev, u8 gate, u8 event, | 237 | int nfc_hci_send_event(struct nfc_hci_dev *hdev, u8 gate, u8 event, |
221 | const u8 *param, size_t param_len); | 238 | const u8 *param, size_t param_len); |
239 | int nfc_hci_target_discovered(struct nfc_hci_dev *hdev, u8 gate); | ||
240 | u32 nfc_hci_sak_to_protocol(u8 sak); | ||
222 | 241 | ||
223 | #endif /* __NET_HCI_H */ | 242 | #endif /* __NET_HCI_H */ |
diff --git a/include/net/nfc/nfc.h b/include/net/nfc/nfc.h index f05b10682c9d..fce80b2f9be7 100644 --- a/include/net/nfc/nfc.h +++ b/include/net/nfc/nfc.h | |||
@@ -95,7 +95,7 @@ struct nfc_genl_data { | |||
95 | }; | 95 | }; |
96 | 96 | ||
97 | struct nfc_dev { | 97 | struct nfc_dev { |
98 | unsigned int idx; | 98 | int idx; |
99 | u32 target_next_idx; | 99 | u32 target_next_idx; |
100 | struct nfc_target *targets; | 100 | struct nfc_target *targets; |
101 | int n_targets; | 101 | int n_targets; |
diff --git a/include/net/protocol.h b/include/net/protocol.h index 929528c73fe8..047c0476c0a0 100644 --- a/include/net/protocol.h +++ b/include/net/protocol.h | |||
@@ -25,9 +25,11 @@ | |||
25 | #define _PROTOCOL_H | 25 | #define _PROTOCOL_H |
26 | 26 | ||
27 | #include <linux/in6.h> | 27 | #include <linux/in6.h> |
28 | #include <linux/skbuff.h> | ||
28 | #if IS_ENABLED(CONFIG_IPV6) | 29 | #if IS_ENABLED(CONFIG_IPV6) |
29 | #include <linux/ipv6.h> | 30 | #include <linux/ipv6.h> |
30 | #endif | 31 | #endif |
32 | #include <linux/netdevice.h> | ||
31 | 33 | ||
32 | /* This is one larger than the largest protocol value that can be | 34 | /* This is one larger than the largest protocol value that can be |
33 | * found in an ipv4 or ipv6 header. Since in both cases the protocol | 35 | * found in an ipv4 or ipv6 header. Since in both cases the protocol |
@@ -40,12 +42,6 @@ struct net_protocol { | |||
40 | void (*early_demux)(struct sk_buff *skb); | 42 | void (*early_demux)(struct sk_buff *skb); |
41 | int (*handler)(struct sk_buff *skb); | 43 | int (*handler)(struct sk_buff *skb); |
42 | void (*err_handler)(struct sk_buff *skb, u32 info); | 44 | void (*err_handler)(struct sk_buff *skb, u32 info); |
43 | int (*gso_send_check)(struct sk_buff *skb); | ||
44 | struct sk_buff *(*gso_segment)(struct sk_buff *skb, | ||
45 | netdev_features_t features); | ||
46 | struct sk_buff **(*gro_receive)(struct sk_buff **head, | ||
47 | struct sk_buff *skb); | ||
48 | int (*gro_complete)(struct sk_buff *skb); | ||
49 | unsigned int no_policy:1, | 45 | unsigned int no_policy:1, |
50 | netns_ok:1; | 46 | netns_ok:1; |
51 | }; | 47 | }; |
@@ -60,23 +56,20 @@ struct inet6_protocol { | |||
60 | struct inet6_skb_parm *opt, | 56 | struct inet6_skb_parm *opt, |
61 | u8 type, u8 code, int offset, | 57 | u8 type, u8 code, int offset, |
62 | __be32 info); | 58 | __be32 info); |
63 | |||
64 | int (*gso_send_check)(struct sk_buff *skb); | ||
65 | struct sk_buff *(*gso_segment)(struct sk_buff *skb, | ||
66 | netdev_features_t features); | ||
67 | struct sk_buff **(*gro_receive)(struct sk_buff **head, | ||
68 | struct sk_buff *skb); | ||
69 | int (*gro_complete)(struct sk_buff *skb); | ||
70 | |||
71 | unsigned int flags; /* INET6_PROTO_xxx */ | 59 | unsigned int flags; /* INET6_PROTO_xxx */ |
72 | }; | 60 | }; |
73 | 61 | ||
74 | #define INET6_PROTO_NOPOLICY 0x1 | 62 | #define INET6_PROTO_NOPOLICY 0x1 |
75 | #define INET6_PROTO_FINAL 0x2 | 63 | #define INET6_PROTO_FINAL 0x2 |
76 | /* This should be set for any extension header which is compatible with GSO. */ | ||
77 | #define INET6_PROTO_GSO_EXTHDR 0x4 | ||
78 | #endif | 64 | #endif |
79 | 65 | ||
66 | struct net_offload { | ||
67 | struct offload_callbacks callbacks; | ||
68 | unsigned int flags; /* Flags used by IPv6 for now */ | ||
69 | }; | ||
70 | /* This should be set for any extension header which is compatible with GSO. */ | ||
71 | #define INET6_PROTO_GSO_EXTHDR 0x1 | ||
72 | |||
80 | /* This is used to register socket interfaces for IP protocols. */ | 73 | /* This is used to register socket interfaces for IP protocols. */ |
81 | struct inet_protosw { | 74 | struct inet_protosw { |
82 | struct list_head list; | 75 | struct list_head list; |
@@ -96,6 +89,8 @@ struct inet_protosw { | |||
96 | #define INET_PROTOSW_ICSK 0x04 /* Is this an inet_connection_sock? */ | 89 | #define INET_PROTOSW_ICSK 0x04 /* Is this an inet_connection_sock? */ |
97 | 90 | ||
98 | extern const struct net_protocol __rcu *inet_protos[MAX_INET_PROTOS]; | 91 | extern const struct net_protocol __rcu *inet_protos[MAX_INET_PROTOS]; |
92 | extern const struct net_offload __rcu *inet_offloads[MAX_INET_PROTOS]; | ||
93 | extern const struct net_offload __rcu *inet6_offloads[MAX_INET_PROTOS]; | ||
99 | 94 | ||
100 | #if IS_ENABLED(CONFIG_IPV6) | 95 | #if IS_ENABLED(CONFIG_IPV6) |
101 | extern const struct inet6_protocol __rcu *inet6_protos[MAX_INET_PROTOS]; | 96 | extern const struct inet6_protocol __rcu *inet6_protos[MAX_INET_PROTOS]; |
@@ -103,6 +98,8 @@ extern const struct inet6_protocol __rcu *inet6_protos[MAX_INET_PROTOS]; | |||
103 | 98 | ||
104 | extern int inet_add_protocol(const struct net_protocol *prot, unsigned char num); | 99 | extern int inet_add_protocol(const struct net_protocol *prot, unsigned char num); |
105 | extern int inet_del_protocol(const struct net_protocol *prot, unsigned char num); | 100 | extern int inet_del_protocol(const struct net_protocol *prot, unsigned char num); |
101 | extern int inet_add_offload(const struct net_offload *prot, unsigned char num); | ||
102 | extern int inet_del_offload(const struct net_offload *prot, unsigned char num); | ||
106 | extern void inet_register_protosw(struct inet_protosw *p); | 103 | extern void inet_register_protosw(struct inet_protosw *p); |
107 | extern void inet_unregister_protosw(struct inet_protosw *p); | 104 | extern void inet_unregister_protosw(struct inet_protosw *p); |
108 | 105 | ||
@@ -112,5 +109,7 @@ extern int inet6_del_protocol(const struct inet6_protocol *prot, unsigned char n | |||
112 | extern int inet6_register_protosw(struct inet_protosw *p); | 109 | extern int inet6_register_protosw(struct inet_protosw *p); |
113 | extern void inet6_unregister_protosw(struct inet_protosw *p); | 110 | extern void inet6_unregister_protosw(struct inet_protosw *p); |
114 | #endif | 111 | #endif |
112 | extern int inet6_add_offload(const struct net_offload *prot, unsigned char num); | ||
113 | extern int inet6_del_offload(const struct net_offload *prot, unsigned char num); | ||
115 | 114 | ||
116 | #endif /* _PROTOCOL_H */ | 115 | #endif /* _PROTOCOL_H */ |
diff --git a/include/net/request_sock.h b/include/net/request_sock.h index b01d8dd9ee7c..a51dbd17c2de 100644 --- a/include/net/request_sock.h +++ b/include/net/request_sock.h | |||
@@ -49,13 +49,16 @@ struct request_sock_ops { | |||
49 | struct request_sock *req); | 49 | struct request_sock *req); |
50 | }; | 50 | }; |
51 | 51 | ||
52 | extern int inet_rtx_syn_ack(struct sock *parent, struct request_sock *req); | ||
53 | |||
52 | /* struct request_sock - mini sock to represent a connection request | 54 | /* struct request_sock - mini sock to represent a connection request |
53 | */ | 55 | */ |
54 | struct request_sock { | 56 | struct request_sock { |
55 | struct request_sock *dl_next; /* Must be first member! */ | 57 | struct request_sock *dl_next; /* Must be first member! */ |
56 | u16 mss; | 58 | u16 mss; |
57 | u8 retrans; | 59 | u8 num_retrans; /* number of retransmits */ |
58 | u8 cookie_ts; /* syncookie: encode tcpopts in timestamp */ | 60 | u8 cookie_ts:1; /* syncookie: encode tcpopts in timestamp */ |
61 | u8 num_timeout:7; /* number of timeouts */ | ||
59 | /* The following two fields can be easily recomputed I think -AK */ | 62 | /* The following two fields can be easily recomputed I think -AK */ |
60 | u32 window_clamp; /* window clamp at creation time */ | 63 | u32 window_clamp; /* window clamp at creation time */ |
61 | u32 rcv_wnd; /* rcv_wnd offered first time */ | 64 | u32 rcv_wnd; /* rcv_wnd offered first time */ |
@@ -231,7 +234,7 @@ static inline int reqsk_queue_removed(struct request_sock_queue *queue, | |||
231 | { | 234 | { |
232 | struct listen_sock *lopt = queue->listen_opt; | 235 | struct listen_sock *lopt = queue->listen_opt; |
233 | 236 | ||
234 | if (req->retrans == 0) | 237 | if (req->num_timeout == 0) |
235 | --lopt->qlen_young; | 238 | --lopt->qlen_young; |
236 | 239 | ||
237 | return --lopt->qlen; | 240 | return --lopt->qlen; |
@@ -269,7 +272,8 @@ static inline void reqsk_queue_hash_req(struct request_sock_queue *queue, | |||
269 | struct listen_sock *lopt = queue->listen_opt; | 272 | struct listen_sock *lopt = queue->listen_opt; |
270 | 273 | ||
271 | req->expires = jiffies + timeout; | 274 | req->expires = jiffies + timeout; |
272 | req->retrans = 0; | 275 | req->num_retrans = 0; |
276 | req->num_timeout = 0; | ||
273 | req->sk = NULL; | 277 | req->sk = NULL; |
274 | req->dl_next = lopt->syn_table[hash]; | 278 | req->dl_next = lopt->syn_table[hash]; |
275 | 279 | ||
diff --git a/include/net/route.h b/include/net/route.h index bc40b633a5c4..2ea40c1b5e00 100644 --- a/include/net/route.h +++ b/include/net/route.h | |||
@@ -198,10 +198,13 @@ struct in_ifaddr; | |||
198 | extern void fib_add_ifaddr(struct in_ifaddr *); | 198 | extern void fib_add_ifaddr(struct in_ifaddr *); |
199 | extern void fib_del_ifaddr(struct in_ifaddr *, struct in_ifaddr *); | 199 | extern void fib_del_ifaddr(struct in_ifaddr *, struct in_ifaddr *); |
200 | 200 | ||
201 | static inline void ip_rt_put(struct rtable * rt) | 201 | static inline void ip_rt_put(struct rtable *rt) |
202 | { | 202 | { |
203 | if (rt) | 203 | /* dst_release() accepts a NULL parameter. |
204 | dst_release(&rt->dst); | 204 | * We rely on dst being first structure in struct rtable |
205 | */ | ||
206 | BUILD_BUG_ON(offsetof(struct rtable, dst) != 0); | ||
207 | dst_release(&rt->dst); | ||
205 | } | 208 | } |
206 | 209 | ||
207 | #define IPTOS_RT_MASK (IPTOS_TOS_MASK & ~3) | 210 | #define IPTOS_RT_MASK (IPTOS_TOS_MASK & ~3) |
diff --git a/include/net/sctp/command.h b/include/net/sctp/command.h index 712b3bebeda7..35247271e557 100644 --- a/include/net/sctp/command.h +++ b/include/net/sctp/command.h | |||
@@ -130,8 +130,6 @@ typedef union { | |||
130 | __be16 err; | 130 | __be16 err; |
131 | sctp_state_t state; | 131 | sctp_state_t state; |
132 | sctp_event_timeout_t to; | 132 | sctp_event_timeout_t to; |
133 | unsigned long zero; | ||
134 | void *ptr; | ||
135 | struct sctp_chunk *chunk; | 133 | struct sctp_chunk *chunk; |
136 | struct sctp_association *asoc; | 134 | struct sctp_association *asoc; |
137 | struct sctp_transport *transport; | 135 | struct sctp_transport *transport; |
@@ -154,23 +152,15 @@ typedef union { | |||
154 | * which takes an __s32 and returns a sctp_arg_t containing the | 152 | * which takes an __s32 and returns a sctp_arg_t containing the |
155 | * __s32. So, after foo = SCTP_I32(arg), foo.i32 == arg. | 153 | * __s32. So, after foo = SCTP_I32(arg), foo.i32 == arg. |
156 | */ | 154 | */ |
157 | static inline sctp_arg_t SCTP_NULL(void) | ||
158 | { | ||
159 | sctp_arg_t retval; retval.ptr = NULL; return retval; | ||
160 | } | ||
161 | static inline sctp_arg_t SCTP_NOFORCE(void) | ||
162 | { | ||
163 | sctp_arg_t retval = {.zero = 0UL}; retval.i32 = 0; return retval; | ||
164 | } | ||
165 | static inline sctp_arg_t SCTP_FORCE(void) | ||
166 | { | ||
167 | sctp_arg_t retval = {.zero = 0UL}; retval.i32 = 1; return retval; | ||
168 | } | ||
169 | 155 | ||
170 | #define SCTP_ARG_CONSTRUCTOR(name, type, elt) \ | 156 | #define SCTP_ARG_CONSTRUCTOR(name, type, elt) \ |
171 | static inline sctp_arg_t \ | 157 | static inline sctp_arg_t \ |
172 | SCTP_## name (type arg) \ | 158 | SCTP_## name (type arg) \ |
173 | { sctp_arg_t retval = {.zero = 0UL}; retval.elt = arg; return retval; } | 159 | { sctp_arg_t retval;\ |
160 | memset(&retval, 0, sizeof(sctp_arg_t));\ | ||
161 | retval.elt = arg;\ | ||
162 | return retval;\ | ||
163 | } | ||
174 | 164 | ||
175 | SCTP_ARG_CONSTRUCTOR(I32, __s32, i32) | 165 | SCTP_ARG_CONSTRUCTOR(I32, __s32, i32) |
176 | SCTP_ARG_CONSTRUCTOR(U32, __u32, u32) | 166 | SCTP_ARG_CONSTRUCTOR(U32, __u32, u32) |
@@ -181,7 +171,6 @@ SCTP_ARG_CONSTRUCTOR(ERROR, int, error) | |||
181 | SCTP_ARG_CONSTRUCTOR(PERR, __be16, err) /* protocol error */ | 171 | SCTP_ARG_CONSTRUCTOR(PERR, __be16, err) /* protocol error */ |
182 | SCTP_ARG_CONSTRUCTOR(STATE, sctp_state_t, state) | 172 | SCTP_ARG_CONSTRUCTOR(STATE, sctp_state_t, state) |
183 | SCTP_ARG_CONSTRUCTOR(TO, sctp_event_timeout_t, to) | 173 | SCTP_ARG_CONSTRUCTOR(TO, sctp_event_timeout_t, to) |
184 | SCTP_ARG_CONSTRUCTOR(PTR, void *, ptr) | ||
185 | SCTP_ARG_CONSTRUCTOR(CHUNK, struct sctp_chunk *, chunk) | 174 | SCTP_ARG_CONSTRUCTOR(CHUNK, struct sctp_chunk *, chunk) |
186 | SCTP_ARG_CONSTRUCTOR(ASOC, struct sctp_association *, asoc) | 175 | SCTP_ARG_CONSTRUCTOR(ASOC, struct sctp_association *, asoc) |
187 | SCTP_ARG_CONSTRUCTOR(TRANSPORT, struct sctp_transport *, transport) | 176 | SCTP_ARG_CONSTRUCTOR(TRANSPORT, struct sctp_transport *, transport) |
@@ -192,6 +181,23 @@ SCTP_ARG_CONSTRUCTOR(PACKET, struct sctp_packet *, packet) | |||
192 | SCTP_ARG_CONSTRUCTOR(SACKH, sctp_sackhdr_t *, sackh) | 181 | SCTP_ARG_CONSTRUCTOR(SACKH, sctp_sackhdr_t *, sackh) |
193 | SCTP_ARG_CONSTRUCTOR(DATAMSG, struct sctp_datamsg *, msg) | 182 | SCTP_ARG_CONSTRUCTOR(DATAMSG, struct sctp_datamsg *, msg) |
194 | 183 | ||
184 | static inline sctp_arg_t SCTP_FORCE(void) | ||
185 | { | ||
186 | return SCTP_I32(1); | ||
187 | } | ||
188 | |||
189 | static inline sctp_arg_t SCTP_NOFORCE(void) | ||
190 | { | ||
191 | return SCTP_I32(0); | ||
192 | } | ||
193 | |||
194 | static inline sctp_arg_t SCTP_NULL(void) | ||
195 | { | ||
196 | sctp_arg_t retval; | ||
197 | memset(&retval, 0, sizeof(sctp_arg_t)); | ||
198 | return retval; | ||
199 | } | ||
200 | |||
195 | typedef struct { | 201 | typedef struct { |
196 | sctp_arg_t obj; | 202 | sctp_arg_t obj; |
197 | sctp_verb_t verb; | 203 | sctp_verb_t verb; |
diff --git a/include/net/sctp/constants.h b/include/net/sctp/constants.h index d053d2e99876..c29707d654c0 100644 --- a/include/net/sctp/constants.h +++ b/include/net/sctp/constants.h | |||
@@ -312,14 +312,6 @@ enum { SCTP_MAX_GABS = 16 }; | |||
312 | * functions simpler to write. | 312 | * functions simpler to write. |
313 | */ | 313 | */ |
314 | 314 | ||
315 | #if defined (CONFIG_SCTP_HMAC_MD5) | ||
316 | #define SCTP_COOKIE_HMAC_ALG "hmac(md5)" | ||
317 | #elif defined (CONFIG_SCTP_HMAC_SHA1) | ||
318 | #define SCTP_COOKIE_HMAC_ALG "hmac(sha1)" | ||
319 | #else | ||
320 | #define SCTP_COOKIE_HMAC_ALG NULL | ||
321 | #endif | ||
322 | |||
323 | /* These return values describe the success or failure of a number of | 315 | /* These return values describe the success or failure of a number of |
324 | * routines which form the lower interface to SCTP_outqueue. | 316 | * routines which form the lower interface to SCTP_outqueue. |
325 | */ | 317 | */ |
diff --git a/include/net/sctp/sm.h b/include/net/sctp/sm.h index b5887e1677e4..2a82d1384706 100644 --- a/include/net/sctp/sm.h +++ b/include/net/sctp/sm.h | |||
@@ -234,6 +234,8 @@ struct sctp_chunk *sctp_make_abort_violation(const struct sctp_association *, | |||
234 | struct sctp_chunk *sctp_make_violation_paramlen(const struct sctp_association *, | 234 | struct sctp_chunk *sctp_make_violation_paramlen(const struct sctp_association *, |
235 | const struct sctp_chunk *, | 235 | const struct sctp_chunk *, |
236 | struct sctp_paramhdr *); | 236 | struct sctp_paramhdr *); |
237 | struct sctp_chunk *sctp_make_violation_max_retrans(const struct sctp_association *, | ||
238 | const struct sctp_chunk *); | ||
237 | struct sctp_chunk *sctp_make_heartbeat(const struct sctp_association *, | 239 | struct sctp_chunk *sctp_make_heartbeat(const struct sctp_association *, |
238 | const struct sctp_transport *); | 240 | const struct sctp_transport *); |
239 | struct sctp_chunk *sctp_make_heartbeat_ack(const struct sctp_association *, | 241 | struct sctp_chunk *sctp_make_heartbeat_ack(const struct sctp_association *, |
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h index 64158aa1bb5f..2b2f61dd4036 100644 --- a/include/net/sctp/structs.h +++ b/include/net/sctp/structs.h | |||
@@ -177,6 +177,7 @@ struct sctp_sock { | |||
177 | 177 | ||
178 | /* Access to HMAC transform. */ | 178 | /* Access to HMAC transform. */ |
179 | struct crypto_hash *hmac; | 179 | struct crypto_hash *hmac; |
180 | char *sctp_hmac_alg; | ||
180 | 181 | ||
181 | /* What is our base endpointer? */ | 182 | /* What is our base endpointer? */ |
182 | struct sctp_endpoint *ep; | 183 | struct sctp_endpoint *ep; |
diff --git a/include/net/sctp/ulpqueue.h b/include/net/sctp/ulpqueue.h index 2e5ee0d8458d..ff1b8ba73ab1 100644 --- a/include/net/sctp/ulpqueue.h +++ b/include/net/sctp/ulpqueue.h | |||
@@ -72,7 +72,7 @@ int sctp_ulpq_tail_event(struct sctp_ulpq *, struct sctp_ulpevent *ev); | |||
72 | void sctp_ulpq_renege(struct sctp_ulpq *, struct sctp_chunk *, gfp_t); | 72 | void sctp_ulpq_renege(struct sctp_ulpq *, struct sctp_chunk *, gfp_t); |
73 | 73 | ||
74 | /* Perform partial delivery. */ | 74 | /* Perform partial delivery. */ |
75 | void sctp_ulpq_partial_delivery(struct sctp_ulpq *, struct sctp_chunk *, gfp_t); | 75 | void sctp_ulpq_partial_delivery(struct sctp_ulpq *, gfp_t); |
76 | 76 | ||
77 | /* Abort the partial delivery. */ | 77 | /* Abort the partial delivery. */ |
78 | void sctp_ulpq_abort_pd(struct sctp_ulpq *, gfp_t); | 78 | void sctp_ulpq_abort_pd(struct sctp_ulpq *, gfp_t); |
diff --git a/include/net/tcp.h b/include/net/tcp.h index 6feeccd83dd7..3202bde2a741 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h | |||
@@ -369,7 +369,6 @@ extern void tcp_shutdown (struct sock *sk, int how); | |||
369 | extern void tcp_v4_early_demux(struct sk_buff *skb); | 369 | extern void tcp_v4_early_demux(struct sk_buff *skb); |
370 | extern int tcp_v4_rcv(struct sk_buff *skb); | 370 | extern int tcp_v4_rcv(struct sk_buff *skb); |
371 | 371 | ||
372 | extern struct inet_peer *tcp_v4_get_peer(struct sock *sk); | ||
373 | extern int tcp_v4_tw_remember_stamp(struct inet_timewait_sock *tw); | 372 | extern int tcp_v4_tw_remember_stamp(struct inet_timewait_sock *tw); |
374 | extern int tcp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, | 373 | extern int tcp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, |
375 | size_t size); | 374 | size_t size); |
diff --git a/include/net/xfrm.h b/include/net/xfrm.h index 6f0ba01afe73..63445ede48bb 100644 --- a/include/net/xfrm.h +++ b/include/net/xfrm.h | |||
@@ -1351,7 +1351,7 @@ struct xfrm6_tunnel { | |||
1351 | }; | 1351 | }; |
1352 | 1352 | ||
1353 | extern void xfrm_init(void); | 1353 | extern void xfrm_init(void); |
1354 | extern void xfrm4_init(int rt_hash_size); | 1354 | extern void xfrm4_init(void); |
1355 | extern int xfrm_state_init(struct net *net); | 1355 | extern int xfrm_state_init(struct net *net); |
1356 | extern void xfrm_state_fini(struct net *net); | 1356 | extern void xfrm_state_fini(struct net *net); |
1357 | extern void xfrm4_state_init(void); | 1357 | extern void xfrm4_state_init(void); |