aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/bluetooth/l2cap.h
diff options
context:
space:
mode:
authorJohn W. Linville <linville@tuxdriver.com>2011-02-22 15:10:22 -0500
committerJohn W. Linville <linville@tuxdriver.com>2011-02-22 15:10:22 -0500
commit5db5e44cdcdc5ee9cc821bd4d63445af0bb34bce (patch)
treeb5e5787a6d5c15e589d275c7434ebbf341257234 /include/net/bluetooth/l2cap.h
parentdb62983a1e4b2af9e79c97af768f0c8b80bd93f0 (diff)
parent320d6c1b56de5f461c6062625b9664095f90ee95 (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6 into for-davem
Diffstat (limited to 'include/net/bluetooth/l2cap.h')
-rw-r--r--include/net/bluetooth/l2cap.h53
1 files changed, 52 insertions, 1 deletions
diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h
index 7ad25ca60ec0..4f4bff1eaed6 100644
--- a/include/net/bluetooth/l2cap.h
+++ b/include/net/bluetooth/l2cap.h
@@ -38,6 +38,7 @@
38#define L2CAP_DEFAULT_MAX_PDU_SIZE 1009 /* Sized for 3-DH5 packet */ 38#define L2CAP_DEFAULT_MAX_PDU_SIZE 1009 /* Sized for 3-DH5 packet */
39#define L2CAP_DEFAULT_ACK_TO 200 39#define L2CAP_DEFAULT_ACK_TO 200
40#define L2CAP_LOCAL_BUSY_TRIES 12 40#define L2CAP_LOCAL_BUSY_TRIES 12
41#define L2CAP_LE_DEFAULT_MTU 23
41 42
42#define L2CAP_CONN_TIMEOUT (40000) /* 40 seconds */ 43#define L2CAP_CONN_TIMEOUT (40000) /* 40 seconds */
43#define L2CAP_INFO_TIMEOUT (4000) /* 4 seconds */ 44#define L2CAP_INFO_TIMEOUT (4000) /* 4 seconds */
@@ -88,6 +89,8 @@ struct l2cap_conninfo {
88#define L2CAP_ECHO_RSP 0x09 89#define L2CAP_ECHO_RSP 0x09
89#define L2CAP_INFO_REQ 0x0a 90#define L2CAP_INFO_REQ 0x0a
90#define L2CAP_INFO_RSP 0x0b 91#define L2CAP_INFO_RSP 0x0b
92#define L2CAP_CONN_PARAM_UPDATE_REQ 0x12
93#define L2CAP_CONN_PARAM_UPDATE_RSP 0x13
91 94
92/* L2CAP feature mask */ 95/* L2CAP feature mask */
93#define L2CAP_FEAT_FLOWCTL 0x00000001 96#define L2CAP_FEAT_FLOWCTL 0x00000001
@@ -160,6 +163,9 @@ struct l2cap_conn_rsp {
160/* channel indentifier */ 163/* channel indentifier */
161#define L2CAP_CID_SIGNALING 0x0001 164#define L2CAP_CID_SIGNALING 0x0001
162#define L2CAP_CID_CONN_LESS 0x0002 165#define L2CAP_CID_CONN_LESS 0x0002
166#define L2CAP_CID_LE_DATA 0x0004
167#define L2CAP_CID_LE_SIGNALING 0x0005
168#define L2CAP_CID_SMP 0x0006
163#define L2CAP_CID_DYN_START 0x0040 169#define L2CAP_CID_DYN_START 0x0040
164#define L2CAP_CID_DYN_END 0xffff 170#define L2CAP_CID_DYN_END 0xffff
165 171
@@ -255,6 +261,21 @@ struct l2cap_info_rsp {
255#define L2CAP_IR_SUCCESS 0x0000 261#define L2CAP_IR_SUCCESS 0x0000
256#define L2CAP_IR_NOTSUPP 0x0001 262#define L2CAP_IR_NOTSUPP 0x0001
257 263
264struct l2cap_conn_param_update_req {
265 __le16 min;
266 __le16 max;
267 __le16 latency;
268 __le16 to_multiplier;
269} __packed;
270
271struct l2cap_conn_param_update_rsp {
272 __le16 result;
273} __packed;
274
275/* Connection Parameters result */
276#define L2CAP_CONN_PARAM_ACCEPTED 0x0000
277#define L2CAP_CONN_PARAM_REJECTED 0x0001
278
258/* ----- L2CAP connections ----- */ 279/* ----- L2CAP connections ----- */
259struct l2cap_chan_list { 280struct l2cap_chan_list {
260 struct sock *head; 281 struct sock *head;
@@ -327,6 +348,7 @@ struct l2cap_pinfo {
327 __u8 sec_level; 348 __u8 sec_level;
328 __u8 role_switch; 349 __u8 role_switch;
329 __u8 force_reliable; 350 __u8 force_reliable;
351 __u8 flushable;
330 352
331 __u8 conf_req[64]; 353 __u8 conf_req[64];
332 __u8 conf_len; 354 __u8 conf_len;
@@ -423,6 +445,35 @@ static inline int l2cap_tx_window_full(struct sock *sk)
423#define __is_sframe(ctrl) ((ctrl) & L2CAP_CTRL_FRAME_TYPE) 445#define __is_sframe(ctrl) ((ctrl) & L2CAP_CTRL_FRAME_TYPE)
424#define __is_sar_start(ctrl) (((ctrl) & L2CAP_CTRL_SAR) == L2CAP_SDU_START) 446#define __is_sar_start(ctrl) (((ctrl) & L2CAP_CTRL_SAR) == L2CAP_SDU_START)
425 447
426void l2cap_load(void); 448extern int disable_ertm;
449extern const struct proto_ops l2cap_sock_ops;
450extern struct bt_sock_list l2cap_sk_list;
451
452int l2cap_init_sockets(void);
453void l2cap_cleanup_sockets(void);
454
455u8 l2cap_get_ident(struct l2cap_conn *conn);
456void l2cap_send_cmd(struct l2cap_conn *conn, u8 ident, u8 code, u16 len, void *data);
457int l2cap_build_conf_req(struct sock *sk, void *data);
458int __l2cap_wait_ack(struct sock *sk);
459
460struct sk_buff *l2cap_create_connless_pdu(struct sock *sk, struct msghdr *msg, size_t len);
461struct sk_buff *l2cap_create_basic_pdu(struct sock *sk, struct msghdr *msg, size_t len);
462struct sk_buff *l2cap_create_iframe_pdu(struct sock *sk, struct msghdr *msg, size_t len, u16 control, u16 sdulen);
463int l2cap_sar_segment_sdu(struct sock *sk, struct msghdr *msg, size_t len);
464void l2cap_do_send(struct sock *sk, struct sk_buff *skb);
465void l2cap_streaming_send(struct sock *sk);
466int l2cap_ertm_send(struct sock *sk);
467
468void l2cap_sock_set_timer(struct sock *sk, long timeout);
469void l2cap_sock_clear_timer(struct sock *sk);
470void __l2cap_sock_close(struct sock *sk, int reason);
471void l2cap_sock_kill(struct sock *sk);
472void l2cap_sock_init(struct sock *sk, struct sock *parent);
473struct sock *l2cap_sock_alloc(struct net *net, struct socket *sock,
474 int proto, gfp_t prio);
475void l2cap_send_disconn_req(struct l2cap_conn *conn, struct sock *sk, int err);
476void l2cap_chan_del(struct sock *sk, int err);
477int l2cap_do_connect(struct sock *sk);
427 478
428#endif /* __L2CAP_H */ 479#endif /* __L2CAP_H */