diff options
| author | Johannes Berg <johannes.berg@intel.com> | 2013-04-22 09:31:43 -0400 |
|---|---|---|
| committer | Johannes Berg <johannes.berg@intel.com> | 2013-04-22 09:31:43 -0400 |
| commit | a42c74ee608a424342ef7069ccddf196d873040c (patch) | |
| tree | 75adfb9f5e06ebb7c7d5d5e5a5408fa0d6d504b9 /include/net | |
| parent | 97990a060e6757f48b931a3946b17c1c4362c3fb (diff) | |
| parent | 9b383672452bb1097124c76fcb4903e0021f6baf (diff) | |
Merge remote-tracking branch 'wireless-next/master' into mac80211-next
Diffstat (limited to 'include/net')
| -rw-r--r-- | include/net/bluetooth/bluetooth.h | 12 | ||||
| -rw-r--r-- | include/net/bluetooth/hci.h | 21 | ||||
| -rw-r--r-- | include/net/bluetooth/hci_core.h | 28 | ||||
| -rw-r--r-- | include/net/bluetooth/rfcomm.h | 6 | ||||
| -rw-r--r-- | include/net/tcp.h | 4 |
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 | ||
| 234 | int bt_sock_register(int proto, const struct net_proto_family *ops); | 234 | int bt_sock_register(int proto, const struct net_proto_family *ops); |
| 235 | int bt_sock_unregister(int proto); | 235 | void bt_sock_unregister(int proto); |
| 236 | void bt_sock_link(struct bt_sock_list *l, struct sock *s); | 236 | void bt_sock_link(struct bt_sock_list *l, struct sock *s); |
| 237 | void bt_sock_unlink(struct bt_sock_list *l, struct sock *s); | 237 | void bt_sock_unlink(struct bt_sock_list *l, struct sock *s); |
| 238 | int bt_sock_recvmsg(struct kiocb *iocb, struct socket *sock, | 238 | int 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 | ||
| 263 | struct hci_dev; | ||
| 264 | |||
| 265 | typedef void (*hci_req_complete_t)(struct hci_dev *hdev, u8 status); | ||
| 266 | |||
| 267 | struct hci_req_ctrl { | ||
| 268 | bool start; | ||
| 269 | hci_req_complete_t complete; | ||
| 270 | }; | ||
| 271 | |||
| 263 | struct bt_skb_cb { | 272 | struct 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 | ||
| 891 | struct 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 |
| 885 | struct hci_cp_write_page_scan_activity { | 898 | struct 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 | ||
| 904 | struct 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 | ||
| 577 | void hci_acl_disconn(struct hci_conn *conn, __u8 reason); | 579 | void hci_disconnect(struct hci_conn *conn, __u8 reason); |
| 578 | void hci_setup_sync(struct hci_conn *conn, __u16 handle); | 580 | void hci_setup_sync(struct hci_conn *conn, __u16 handle); |
| 579 | void hci_sco_setup(struct hci_conn *conn, __u8 status); | 581 | void 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); |
| 743 | int hci_remove_remote_oob_data(struct hci_dev *hdev, bdaddr_t *bdaddr); | 745 | int hci_remove_remote_oob_data(struct hci_dev *hdev, bdaddr_t *bdaddr); |
| 744 | 746 | ||
| 745 | int hci_update_ad(struct hci_dev *hdev); | ||
| 746 | |||
| 747 | void hci_event_packet(struct hci_dev *hdev, struct sk_buff *skb); | 747 | void hci_event_packet(struct hci_dev *hdev, struct sk_buff *skb); |
| 748 | 748 | ||
| 749 | int hci_recv_frame(struct sk_buff *skb); | 749 | int 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, | |||
| 1041 | int hci_register_cb(struct hci_cb *hcb); | 1041 | int hci_register_cb(struct hci_cb *hcb); |
| 1042 | int hci_unregister_cb(struct hci_cb *hcb); | 1042 | int hci_unregister_cb(struct hci_cb *hcb); |
| 1043 | 1043 | ||
| 1044 | struct 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 | |||
| 1054 | void hci_req_init(struct hci_request *req, struct hci_dev *hdev); | ||
| 1055 | int hci_req_run(struct hci_request *req, hci_req_complete_t complete); | ||
| 1056 | void hci_req_add(struct hci_request *req, u16 opcode, u32 plen, void *param); | ||
| 1057 | void hci_req_cmd_complete(struct hci_dev *hdev, u16 opcode, u8 status); | ||
| 1058 | void hci_req_cmd_status(struct hci_dev *hdev, u16 opcode, u8 status); | ||
| 1059 | |||
| 1044 | int hci_send_cmd(struct hci_dev *hdev, __u16 opcode, __u32 plen, void *param); | 1060 | int hci_send_cmd(struct hci_dev *hdev, __u16 opcode, __u32 plen, void *param); |
| 1045 | void hci_send_acl(struct hci_chan *chan, struct sk_buff *skb, __u16 flags); | 1061 | void hci_send_acl(struct hci_chan *chan, struct sk_buff *skb, __u16 flags); |
| 1046 | void hci_send_sco(struct hci_conn *conn, struct sk_buff *skb); | 1062 | void 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 | ||
| 1156 | void hci_req_complete(struct hci_dev *hdev, __u16 cmd, int result); | 1172 | void hci_update_ad(struct hci_request *req); |
| 1157 | 1173 | ||
| 1158 | void hci_le_conn_update(struct hci_conn *conn, u16 min, u16 max, | 1174 | void 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) | |||
| 276 | void rfcomm_session_getaddr(struct rfcomm_session *s, bdaddr_t *src, | 275 | void rfcomm_session_getaddr(struct rfcomm_session *s, bdaddr_t *src, |
| 277 | bdaddr_t *dst); | 276 | bdaddr_t *dst); |
| 278 | 277 | ||
| 279 | static inline void rfcomm_session_hold(struct rfcomm_session *s) | ||
| 280 | { | ||
| 281 | atomic_inc(&s->refcnt); | ||
| 282 | } | ||
| 283 | |||
| 284 | /* ---- RFCOMM sockets ---- */ | 278 | /* ---- RFCOMM sockets ---- */ |
| 285 | struct sockaddr_rc { | 279 | struct 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) { |
