38
38
#define L2CAP_DEFAULT_MAX_PDU_SIZE 1009 /* Sized for 3-DH5 packet */
39
39
#define L2CAP_DEFAULT_ACK_TO 200
40
40
#define L2CAP_LOCAL_BUSY_TRIES 12
41
#define L2CAP_LE_DEFAULT_MTU 23
42
43
#define L2CAP_CONN_TIMEOUT (40000) /* 40 seconds */
43
44
#define L2CAP_INFO_TIMEOUT (4000) /* 4 seconds */
88
89
#define L2CAP_ECHO_RSP 0x09
89
90
#define L2CAP_INFO_REQ 0x0a
90
91
#define L2CAP_INFO_RSP 0x0b
92
#define L2CAP_CONN_PARAM_UPDATE_REQ 0x12
93
#define L2CAP_CONN_PARAM_UPDATE_RSP 0x13
92
95
/* L2CAP feature mask */
93
96
#define L2CAP_FEAT_FLOWCTL 0x00000001
160
163
/* channel indentifier */
161
164
#define L2CAP_CID_SIGNALING 0x0001
162
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
169
#define L2CAP_CID_DYN_START 0x0040
164
170
#define L2CAP_CID_DYN_END 0xffff
255
261
#define L2CAP_IR_SUCCESS 0x0000
256
262
#define L2CAP_IR_NOTSUPP 0x0001
264
struct l2cap_conn_param_update_req {
268
__le16 to_multiplier;
271
struct l2cap_conn_param_update_rsp {
275
/* Connection Parameters result */
276
#define L2CAP_CONN_PARAM_ACCEPTED 0x0000
277
#define L2CAP_CONN_PARAM_REJECTED 0x0001
258
279
/* ----- L2CAP connections ----- */
259
280
struct l2cap_chan_list {
260
281
struct sock *head;
423
445
#define __is_sframe(ctrl) ((ctrl) & L2CAP_CTRL_FRAME_TYPE)
424
446
#define __is_sar_start(ctrl) (((ctrl) & L2CAP_CTRL_SAR) == L2CAP_SDU_START)
426
void l2cap_load(void);
448
extern int disable_ertm;
449
extern const struct proto_ops l2cap_sock_ops;
450
extern struct bt_sock_list l2cap_sk_list;
452
int l2cap_init_sockets(void);
453
void l2cap_cleanup_sockets(void);
455
u8 l2cap_get_ident(struct l2cap_conn *conn);
456
void l2cap_send_cmd(struct l2cap_conn *conn, u8 ident, u8 code, u16 len, void *data);
457
int l2cap_build_conf_req(struct sock *sk, void *data);
458
int __l2cap_wait_ack(struct sock *sk);
460
struct sk_buff *l2cap_create_connless_pdu(struct sock *sk, struct msghdr *msg, size_t len);
461
struct sk_buff *l2cap_create_basic_pdu(struct sock *sk, struct msghdr *msg, size_t len);
462
struct sk_buff *l2cap_create_iframe_pdu(struct sock *sk, struct msghdr *msg, size_t len, u16 control, u16 sdulen);
463
int l2cap_sar_segment_sdu(struct sock *sk, struct msghdr *msg, size_t len);
464
void l2cap_do_send(struct sock *sk, struct sk_buff *skb);
465
void l2cap_streaming_send(struct sock *sk);
466
int l2cap_ertm_send(struct sock *sk);
468
void l2cap_sock_set_timer(struct sock *sk, long timeout);
469
void l2cap_sock_clear_timer(struct sock *sk);
470
void __l2cap_sock_close(struct sock *sk, int reason);
471
void l2cap_sock_kill(struct sock *sk);
472
void l2cap_sock_init(struct sock *sk, struct sock *parent);
473
struct sock *l2cap_sock_alloc(struct net *net, struct socket *sock,
474
int proto, gfp_t prio);
475
void l2cap_send_disconn_req(struct l2cap_conn *conn, struct sock *sk, int err);
476
void l2cap_chan_del(struct sock *sk, int err);
477
int l2cap_do_connect(struct sock *sk);
428
479
#endif /* __L2CAP_H */