Skip to content

Commit 8f7975b

Browse files
finikorgGustavo F. Padovan
authored andcommitted
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>
1 parent 5a9e705 commit 8f7975b

2 files changed

Lines changed: 16 additions & 0 deletions

File tree

‎include/net/bluetooth/l2cap.h‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@
3939
#define L2CAP_DEFAULT_MAX_PDU_SIZE 1009 /* Sized for 3-DH5 packet */
4040
#define L2CAP_DEFAULT_ACK_TO 200
4141
#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
4245

4346
#define L2CAP_CONN_TIMEOUT (40000) /* 40 seconds */
4447
#define L2CAP_INFO_TIMEOUT (4000) /* 4 seconds */
@@ -287,6 +290,12 @@ struct l2cap_conf_efs {
287290
__le32 flush_to;
288291
} __packed;
289292

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+
290299
struct l2cap_disconn_req {
291300
__le16 dcid;
292301
__le16 scid;

‎net/bluetooth/l2cap_core.c‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,13 @@ static void __l2cap_chan_add(struct l2cap_conn *conn, struct l2cap_chan *chan)
338338
chan->omtu = L2CAP_DEFAULT_MTU;
339339
}
340340

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+
341348
chan_hold(chan);
342349

343350
list_add(&chan->list, &conn->chan_l);

0 commit comments

Comments
 (0)