2 Copyright (c) 2010,2011 Code Aurora Forum. All rights reserved.
3 Copyright (c) 2011,2012 Intel Corp.
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License version 2 and
7 only version 2 as published by the Free Software Foundation.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
15 #include <net/bluetooth/bluetooth.h>
16 #include <net/bluetooth/hci_core.h>
17 #include <net/bluetooth/l2cap.h>
19 static struct l2cap_ops a2mp_chan_ops
= {
20 .name
= "L2CAP A2MP channel",
23 static struct l2cap_chan
*a2mp_chan_open(struct l2cap_conn
*conn
)
25 struct l2cap_chan
*chan
;
28 chan
= l2cap_chan_create();
32 BT_DBG("chan %p", chan
);
34 hci_conn_hold(conn
->hcon
);
36 chan
->omtu
= L2CAP_A2MP_DEFAULT_MTU
;
37 chan
->imtu
= L2CAP_A2MP_DEFAULT_MTU
;
38 chan
->flush_to
= L2CAP_DEFAULT_FLUSH_TO
;
40 chan
->ops
= &a2mp_chan_ops
;
42 l2cap_chan_set_defaults(chan
);
43 chan
->remote_max_tx
= chan
->max_tx
;
44 chan
->remote_tx_win
= chan
->tx_win
;
46 chan
->retrans_timeout
= L2CAP_DEFAULT_RETRANS_TO
;
47 chan
->monitor_timeout
= L2CAP_DEFAULT_MONITOR_TO
;
49 skb_queue_head_init(&chan
->tx_q
);
51 chan
->mode
= L2CAP_MODE_ERTM
;
53 err
= l2cap_ertm_init(chan
);
55 l2cap_chan_del(chan
, 0);
61 l2cap_chan_add(conn
, chan
);
63 chan
->remote_mps
= chan
->omtu
;
64 chan
->mps
= chan
->omtu
;
66 chan
->state
= BT_CONNECTED
;
This page took 0.032172 seconds and 5 git commands to generate.