aboutsummaryrefslogtreecommitdiffstats
path: root/include/net
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2013-04-22 09:31:43 -0400
committerJohannes Berg <johannes.berg@intel.com>2013-04-22 09:31:43 -0400
commita42c74ee608a424342ef7069ccddf196d873040c (patch)
tree75adfb9f5e06ebb7c7d5d5e5a5408fa0d6d504b9 /include/net
parent97990a060e6757f48b931a3946b17c1c4362c3fb (diff)
parent9b383672452bb1097124c76fcb4903e0021f6baf (diff)
Merge remote-tracking branch 'wireless-next/master' into mac80211-next
Diffstat (limited to 'include/net')
-rw-r--r--include/net/bluetooth/bluetooth.h12
-rw-r--r--include/net/bluetooth/hci.h21
-rw-r--r--include/net/bluetooth/hci_core.h28
-rw-r--r--include/net/bluetooth/rfcomm.h6
-rw-r--r--include/net/tcp.h4
5 files changed, 57 insertions, 14 deletions
diff --git a/include/net/bluetooth/bluetooth.h b/include/net/bluetooth/bluetooth.h
index 9531beee09b5..ed6e9552252e 100644
--- a/include/net/bluetooth/bluetooth.h
+++ b/include/net/bluetooth/bluetooth.h
@@ -232,7 +232,7 @@ struct bt_sock_list {
232}; 232};
233 233
234int bt_sock_register(int proto, const struct net_proto_family *ops); 234int bt_sock_register(int proto, const struct net_proto_family *ops);
235int bt_sock_unregister(int proto); 235void bt_sock_unregister(int proto);
236void bt_sock_link(struct bt_sock_list *l, struct sock *s); 236void bt_sock_link(struct bt_sock_list *l, struct sock *s);
237void bt_sock_unlink(struct bt_sock_list *l, struct sock *s); 237void bt_sock_unlink(struct bt_sock_list *l, struct sock *s);
238int bt_sock_recvmsg(struct kiocb *iocb, struct socket *sock, 238int bt_sock_recvmsg(struct kiocb *iocb, struct socket *sock,
@@ -260,12 +260,22 @@ struct l2cap_ctrl {
260 __u8 retries; 260 __u8 retries;
261}; 261};
262 262
263struct hci_dev;
264
265typedef void (*hci_req_complete_t)(struct hci_dev *hdev, u8 status);
266
267struct hci_req_ctrl {
268 bool start;
269 hci_req_complete_t complete;
270};
271
263struct bt_skb_cb { 272struct bt_skb_cb {
264 __u8 pkt_type; 273 __u8 pkt_type;
265 __u8 incoming; 274 __u8 incoming;
266 __u16 expect; 275 __u16 expect;
267 __u8 force_active; 276 __u8 force_active;
268 struct l2cap_ctrl control; 277 struct l2cap_ctrl control;
278 struct hci_req_ctrl req;
269}; 279};
270#define bt_cb(skb) ((struct bt_skb_cb *)((skb)->cb)) 280#define bt_cb(skb) ((struct bt_skb_cb *)((skb)->cb))
271 281
diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h
index 7f12c25f1fca..b3308927a0a1 100644
--- a/include/net/bluetooth/hci.h
+++ b/include/net/bluetooth/hci.h
@@ -119,10 +119,16 @@ enum {
119 HCI_CONNECTABLE, 119 HCI_CONNECTABLE,
120 HCI_DISCOVERABLE, 120 HCI_DISCOVERABLE,
121 HCI_LINK_SECURITY, 121 HCI_LINK_SECURITY,
122 HCI_PENDING_CLASS,
123 HCI_PERIODIC_INQ, 122 HCI_PERIODIC_INQ,
123 HCI_FAST_CONNECTABLE,
124}; 124};
125 125
126/* A mask for the flags that are supposed to remain when a reset happens
127 * or the HCI device is closed.
128 */
129#define HCI_PERSISTENT_MASK (BIT(HCI_LE_SCAN) | BIT(HCI_PERIODIC_INQ) | \
130 BIT(HCI_FAST_CONNECTABLE))
131
126/* HCI ioctl defines */ 132/* HCI ioctl defines */
127#define HCIDEVUP _IOW('H', 201, int) 133#define HCIDEVUP _IOW('H', 201, int)
128#define HCIDEVDOWN _IOW('H', 202, int) 134#define HCIDEVDOWN _IOW('H', 202, int)
@@ -881,12 +887,25 @@ struct hci_rp_read_data_block_size {
881 __le16 num_blocks; 887 __le16 num_blocks;
882} __packed; 888} __packed;
883 889
890#define HCI_OP_READ_PAGE_SCAN_ACTIVITY 0x0c1b
891struct hci_rp_read_page_scan_activity {
892 __u8 status;
893 __le16 interval;
894 __le16 window;
895} __packed;
896
884#define HCI_OP_WRITE_PAGE_SCAN_ACTIVITY 0x0c1c 897#define HCI_OP_WRITE_PAGE_SCAN_ACTIVITY 0x0c1c
885struct hci_cp_write_page_scan_activity { 898struct hci_cp_write_page_scan_activity {
886 __le16 interval; 899 __le16 interval;
887 __le16 window; 900 __le16 window;
888} __packed; 901} __packed;
889 902
903#define HCI_OP_READ_PAGE_SCAN_TYPE 0x0c46
904struct hci_rp_read_page_scan_type {
905 __u8 status;
906 __u8 type;
907} __packed;
908
890#define HCI_OP_WRITE_PAGE_SCAN_TYPE 0x0c47 909#define HCI_OP_WRITE_PAGE_SCAN_TYPE 0x0c47
891 #define PAGE_SCAN_TYPE_STANDARD 0x00 910 #define PAGE_SCAN_TYPE_STANDARD 0x00
892 #define PAGE_SCAN_TYPE_INTERLACED 0x01 911 #define PAGE_SCAN_TYPE_INTERLACED 0x01
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
index 90cf75afcb02..358a6983d3bb 100644
--- a/include/net/bluetooth/hci_core.h
+++ b/include/net/bluetooth/hci_core.h
@@ -165,6 +165,10 @@ struct hci_dev {
165 __u16 voice_setting; 165 __u16 voice_setting;
166 __u8 io_capability; 166 __u8 io_capability;
167 __s8 inq_tx_power; 167 __s8 inq_tx_power;
168 __u16 page_scan_interval;
169 __u16 page_scan_window;
170 __u8 page_scan_type;
171
168 __u16 devid_source; 172 __u16 devid_source;
169 __u16 devid_vendor; 173 __u16 devid_vendor;
170 __u16 devid_product; 174 __u16 devid_product;
@@ -248,8 +252,6 @@ struct hci_dev {
248 __u32 req_status; 252 __u32 req_status;
249 __u32 req_result; 253 __u32 req_result;
250 254
251 __u16 init_last_cmd;
252
253 struct list_head mgmt_pending; 255 struct list_head mgmt_pending;
254 256
255 struct discovery_state discovery; 257 struct discovery_state discovery;
@@ -574,7 +576,7 @@ static inline struct hci_conn *hci_conn_hash_lookup_state(struct hci_dev *hdev,
574 return NULL; 576 return NULL;
575} 577}
576 578
577void hci_acl_disconn(struct hci_conn *conn, __u8 reason); 579void hci_disconnect(struct hci_conn *conn, __u8 reason);
578void hci_setup_sync(struct hci_conn *conn, __u16 handle); 580void hci_setup_sync(struct hci_conn *conn, __u16 handle);
579void hci_sco_setup(struct hci_conn *conn, __u8 status); 581void hci_sco_setup(struct hci_conn *conn, __u8 status);
580 582
@@ -742,8 +744,6 @@ int hci_add_remote_oob_data(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 *hash,
742 u8 *randomizer); 744 u8 *randomizer);
743int hci_remove_remote_oob_data(struct hci_dev *hdev, bdaddr_t *bdaddr); 745int hci_remove_remote_oob_data(struct hci_dev *hdev, bdaddr_t *bdaddr);
744 746
745int hci_update_ad(struct hci_dev *hdev);
746
747void hci_event_packet(struct hci_dev *hdev, struct sk_buff *skb); 747void hci_event_packet(struct hci_dev *hdev, struct sk_buff *skb);
748 748
749int hci_recv_frame(struct sk_buff *skb); 749int hci_recv_frame(struct sk_buff *skb);
@@ -1041,6 +1041,22 @@ static inline u16 eir_append_data(u8 *eir, u16 eir_len, u8 type, u8 *data,
1041int hci_register_cb(struct hci_cb *hcb); 1041int hci_register_cb(struct hci_cb *hcb);
1042int hci_unregister_cb(struct hci_cb *hcb); 1042int hci_unregister_cb(struct hci_cb *hcb);
1043 1043
1044struct hci_request {
1045 struct hci_dev *hdev;
1046 struct sk_buff_head cmd_q;
1047
1048 /* If something goes wrong when building the HCI request, the error
1049 * value is stored in this field.
1050 */
1051 int err;
1052};
1053
1054void hci_req_init(struct hci_request *req, struct hci_dev *hdev);
1055int hci_req_run(struct hci_request *req, hci_req_complete_t complete);
1056void hci_req_add(struct hci_request *req, u16 opcode, u32 plen, void *param);
1057void hci_req_cmd_complete(struct hci_dev *hdev, u16 opcode, u8 status);
1058void hci_req_cmd_status(struct hci_dev *hdev, u16 opcode, u8 status);
1059
1044int hci_send_cmd(struct hci_dev *hdev, __u16 opcode, __u32 plen, void *param); 1060int hci_send_cmd(struct hci_dev *hdev, __u16 opcode, __u32 plen, void *param);
1045void hci_send_acl(struct hci_chan *chan, struct sk_buff *skb, __u16 flags); 1061void hci_send_acl(struct hci_chan *chan, struct sk_buff *skb, __u16 flags);
1046void hci_send_sco(struct hci_conn *conn, struct sk_buff *skb); 1062void hci_send_sco(struct hci_conn *conn, struct sk_buff *skb);
@@ -1153,7 +1169,7 @@ struct hci_sec_filter {
1153#define hci_req_lock(d) mutex_lock(&d->req_lock) 1169#define hci_req_lock(d) mutex_lock(&d->req_lock)
1154#define hci_req_unlock(d) mutex_unlock(&d->req_lock) 1170#define hci_req_unlock(d) mutex_unlock(&d->req_lock)
1155 1171
1156void hci_req_complete(struct hci_dev *hdev, __u16 cmd, int result); 1172void hci_update_ad(struct hci_request *req);
1157 1173
1158void hci_le_conn_update(struct hci_conn *conn, u16 min, u16 max, 1174void hci_le_conn_update(struct hci_conn *conn, u16 min, u16 max,
1159 u16 latency, u16 to_multiplier); 1175 u16 latency, u16 to_multiplier);
diff --git a/include/net/bluetooth/rfcomm.h b/include/net/bluetooth/rfcomm.h
index e2e3ecad1008..7afd4199d6b6 100644
--- a/include/net/bluetooth/rfcomm.h
+++ b/include/net/bluetooth/rfcomm.h
@@ -158,7 +158,6 @@ struct rfcomm_session {
158 struct timer_list timer; 158 struct timer_list timer;
159 unsigned long state; 159 unsigned long state;
160 unsigned long flags; 160 unsigned long flags;
161 atomic_t refcnt;
162 int initiator; 161 int initiator;
163 162
164 /* Default DLC parameters */ 163 /* Default DLC parameters */
@@ -276,11 +275,6 @@ static inline void rfcomm_dlc_unthrottle(struct rfcomm_dlc *d)
276void rfcomm_session_getaddr(struct rfcomm_session *s, bdaddr_t *src, 275void rfcomm_session_getaddr(struct rfcomm_session *s, bdaddr_t *src,
277 bdaddr_t *dst); 276 bdaddr_t *dst);
278 277
279static inline void rfcomm_session_hold(struct rfcomm_session *s)
280{
281 atomic_inc(&s->refcnt);
282}
283
284/* ---- RFCOMM sockets ---- */ 278/* ---- RFCOMM sockets ---- */
285struct sockaddr_rc { 279struct sockaddr_rc {
286 sa_family_t rc_family; 280 sa_family_t rc_family;
diff --git a/include/net/tcp.h b/include/net/tcp.h
index 23f2e98d4b65..cf0694d4ad60 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -1045,6 +1045,10 @@ static inline bool tcp_prequeue(struct sock *sk, struct sk_buff *skb)
1045 if (sysctl_tcp_low_latency || !tp->ucopy.task) 1045 if (sysctl_tcp_low_latency || !tp->ucopy.task)
1046 return false; 1046 return false;
1047 1047
1048 if (skb->len <= tcp_hdrlen(skb) &&
1049 skb_queue_len(&tp->ucopy.prequeue) == 0)
1050 return false;
1051
1048 __skb_queue_tail(&tp->ucopy.prequeue, skb); 1052 __skb_queue_tail(&tp->ucopy.prequeue, skb);
1049 tp->ucopy.memory += skb->truesize; 1053 tp->ucopy.memory += skb->truesize;
1050 if (tp->ucopy.memory > sk->sk_rcvbuf) { 1054 if (tp->ucopy.memory > sk->sk_rcvbuf) {