diff options
author | Andrei Emeltchenko <andrei.emeltchenko@intel.com> | 2011-10-13 09:18:54 -0400 |
---|---|---|
committer | Gustavo F. Padovan <padovan@profusion.mobi> | 2011-10-13 16:09:08 -0400 |
commit | 8f7975b153faab4b78369458a892dd705e7c395b (patch) | |
tree | 79e98a532ee572125353c182f21887449e52210e | |
parent | 5a9e7057c5b3feed2d403ef69cfb0bdbacab3a6d (diff) |
Bluetooth: EFS: assign default values in chan add
Assign default EFS values when creating L2CAP channel
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
-rw-r--r-- | include/net/bluetooth/l2cap.h | 9 | ||||
-rw-r--r-- | net/bluetooth/l2cap_core.c | 7 |
2 files changed, 16 insertions, 0 deletions
diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h index 3b54e9b274ef..e67ecd12df8c 100644 --- a/include/net/bluetooth/l2cap.h +++ b/include/net/bluetooth/l2cap.h | |||
@@ -39,6 +39,9 @@ | |||
39 | #define L2CAP_DEFAULT_MAX_PDU_SIZE 1009 /* Sized for 3-DH5 packet */ | 39 | #define L2CAP_DEFAULT_MAX_PDU_SIZE 1009 /* Sized for 3-DH5 packet */ |
40 | #define L2CAP_DEFAULT_ACK_TO 200 | 40 | #define L2CAP_DEFAULT_ACK_TO 200 |
41 | #define L2CAP_LE_DEFAULT_MTU 23 | 41 | #define L2CAP_LE_DEFAULT_MTU 23 |
42 | #define L2CAP_DEFAULT_MAX_SDU_SIZE 0xFFFF | ||
43 | #define L2CAP_DEFAULT_SDU_ITIME 0xFFFFFFFF | ||
44 | #define L2CAP_DEFAULT_ACC_LAT 0xFFFFFFFF | ||
42 | 45 | ||
43 | #define L2CAP_CONN_TIMEOUT (40000) /* 40 seconds */ | 46 | #define L2CAP_CONN_TIMEOUT (40000) /* 40 seconds */ |
44 | #define L2CAP_INFO_TIMEOUT (4000) /* 4 seconds */ | 47 | #define L2CAP_INFO_TIMEOUT (4000) /* 4 seconds */ |
@@ -287,6 +290,12 @@ struct l2cap_conf_efs { | |||
287 | __le32 flush_to; | 290 | __le32 flush_to; |
288 | } __packed; | 291 | } __packed; |
289 | 292 | ||
293 | #define L2CAP_SERV_NOTRAFIC 0x00 | ||
294 | #define L2CAP_SERV_BESTEFFORT 0x01 | ||
295 | #define L2CAP_SERV_GUARANTEED 0x02 | ||
296 | |||
297 | #define L2CAP_BESTEFFORT_ID 0x01 | ||
298 | |||
290 | struct l2cap_disconn_req { | 299 | struct l2cap_disconn_req { |
291 | __le16 dcid; | 300 | __le16 dcid; |
292 | __le16 scid; | 301 | __le16 scid; |
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c index 439e7150f150..410c9cda057c 100644 --- a/net/bluetooth/l2cap_core.c +++ b/net/bluetooth/l2cap_core.c | |||
@@ -338,6 +338,13 @@ static void __l2cap_chan_add(struct l2cap_conn *conn, struct l2cap_chan *chan) | |||
338 | chan->omtu = L2CAP_DEFAULT_MTU; | 338 | chan->omtu = L2CAP_DEFAULT_MTU; |
339 | } | 339 | } |
340 | 340 | ||
341 | chan->local_id = L2CAP_BESTEFFORT_ID; | ||
342 | chan->local_stype = L2CAP_SERV_BESTEFFORT; | ||
343 | chan->local_msdu = L2CAP_DEFAULT_MAX_SDU_SIZE; | ||
344 | chan->local_sdu_itime = L2CAP_DEFAULT_SDU_ITIME; | ||
345 | chan->local_acc_lat = L2CAP_DEFAULT_ACC_LAT; | ||
346 | chan->local_flush_to = L2CAP_DEFAULT_FLUSH_TO; | ||
347 | |||
341 | chan_hold(chan); | 348 | chan_hold(chan); |
342 | 349 | ||
343 | list_add(&chan->list, &conn->chan_l); | 350 | list_add(&chan->list, &conn->chan_l); |