aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorGustavo F. Padovan <gustavo@las.ic.unicamp.br>2009-07-04 14:06:24 -0400
committerMarcel Holtmann <marcel@holtmann.org>2009-08-22 17:50:07 -0400
commitf2fcfcd670257236ebf2088bbdf26f6a8ef459fe (patch)
tree5bc6061e3b684ae545b24e2919ab43b711e04c4d /include
parent65c7c4918450f8c4545ccb02a9c7a3d77e073535 (diff)
Bluetooth: Add configuration support for ERTM and Streaming mode
Add support to config_req and config_rsp to configure ERTM and Streaming mode. If the remote device specifies ERTM or Streaming mode, then the same mode is proposed. Otherwise ERTM or Basic mode is used. And in case of a state 2 device, the remote device should propose the same mode. If not, then the channel gets disconnected. Signed-off-by: Gustavo F. Padovan <gustavo@las.ic.unicamp.br> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'include')
-rw-r--r--include/net/bluetooth/l2cap.h28
1 files changed, 21 insertions, 7 deletions
diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h
index 06b072fd6d54..6fc76986d70a 100644
--- a/include/net/bluetooth/l2cap.h
+++ b/include/net/bluetooth/l2cap.h
@@ -27,8 +27,9 @@
27 27
28/* L2CAP defaults */ 28/* L2CAP defaults */
29#define L2CAP_DEFAULT_MTU 672 29#define L2CAP_DEFAULT_MTU 672
30#define L2CAP_DEFAULT_MIN_MTU 48
30#define L2CAP_DEFAULT_FLUSH_TO 0xffff 31#define L2CAP_DEFAULT_FLUSH_TO 0xffff
31#define L2CAP_DEFAULT_RX_WINDOW 1 32#define L2CAP_DEFAULT_TX_WINDOW 1
32#define L2CAP_DEFAULT_MAX_RECEIVE 1 33#define L2CAP_DEFAULT_MAX_RECEIVE 1
33#define L2CAP_DEFAULT_RETRANS_TO 300 /* 300 milliseconds */ 34#define L2CAP_DEFAULT_RETRANS_TO 300 /* 300 milliseconds */
34#define L2CAP_DEFAULT_MONITOR_TO 1000 /* 1 second */ 35#define L2CAP_DEFAULT_MONITOR_TO 1000 /* 1 second */
@@ -272,6 +273,9 @@ struct l2cap_pinfo {
272 __u16 omtu; 273 __u16 omtu;
273 __u16 flush_to; 274 __u16 flush_to;
274 __u8 mode; 275 __u8 mode;
276 __u8 num_conf_req;
277 __u8 num_conf_rsp;
278
275 __u8 fcs; 279 __u8 fcs;
276 __u8 sec_level; 280 __u8 sec_level;
277 __u8 role_switch; 281 __u8 role_switch;
@@ -280,10 +284,15 @@ struct l2cap_pinfo {
280 __u8 conf_req[64]; 284 __u8 conf_req[64];
281 __u8 conf_len; 285 __u8 conf_len;
282 __u8 conf_state; 286 __u8 conf_state;
283 __u8 conf_retry;
284 287
285 __u8 ident; 288 __u8 ident;
286 289
290 __u8 remote_tx_win;
291 __u8 remote_max_tx;
292 __u16 retrans_timeout;
293 __u16 monitor_timeout;
294 __u16 max_pdu_size;
295
287 __le16 sport; 296 __le16 sport;
288 297
289 struct l2cap_conn *conn; 298 struct l2cap_conn *conn;
@@ -291,12 +300,17 @@ struct l2cap_pinfo {
291 struct sock *prev_c; 300 struct sock *prev_c;
292}; 301};
293 302
294#define L2CAP_CONF_REQ_SENT 0x01 303#define L2CAP_CONF_REQ_SENT 0x01
295#define L2CAP_CONF_INPUT_DONE 0x02 304#define L2CAP_CONF_INPUT_DONE 0x02
296#define L2CAP_CONF_OUTPUT_DONE 0x04 305#define L2CAP_CONF_OUTPUT_DONE 0x04
297#define L2CAP_CONF_CONNECT_PEND 0x80 306#define L2CAP_CONF_MTU_DONE 0x08
307#define L2CAP_CONF_MODE_DONE 0x10
308#define L2CAP_CONF_CONNECT_PEND 0x20
309#define L2CAP_CONF_STATE2_DEVICE 0x80
310
311#define L2CAP_CONF_MAX_CONF_REQ 2
312#define L2CAP_CONF_MAX_CONF_RSP 2
298 313
299#define L2CAP_CONF_MAX_RETRIES 2
300 314
301void l2cap_load(void); 315void l2cap_load(void);
302 316