mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-23 23:32:14 +00:00
Bluetooth: Simplify l2cap_chan initialization for LE CoC
The values in l2cap_chan that are used for actually transmitting data only need to be initialized right after we've received an L2CAP Connect Request or just before we send one. The only thing that we need to initialize though bind() and connect() is the chan->mode value. This way all other initializations can be done in the l2cap_le_flowctl_init function (which now becomes private to l2cap_core.c) and the l2cap_le_flowctl_start function can be completely removed. Also, since the l2cap_sock_init function initializes the imtu and omtu to adequate values these do not need to be part of l2cap_le_flowctl_init. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
This commit is contained in:
parent
f15b8ecf98
commit
0ce43ce60d
3 changed files with 14 additions and 26 deletions
|
@ -153,7 +153,7 @@ static int l2cap_sock_bind(struct socket *sock, struct sockaddr *addr, int alen)
|
|||
chan->src_type = la.l2_bdaddr_type;
|
||||
|
||||
if (chan->psm && bdaddr_type_is_le(chan->src_type))
|
||||
l2cap_le_flowctl_init(chan);
|
||||
chan->mode = L2CAP_MODE_LE_FLOWCTL;
|
||||
|
||||
chan->state = BT_BOUND;
|
||||
sk->sk_state = BT_BOUND;
|
||||
|
@ -226,7 +226,7 @@ static int l2cap_sock_connect(struct socket *sock, struct sockaddr *addr,
|
|||
}
|
||||
|
||||
if (chan->psm && bdaddr_type_is_le(chan->src_type))
|
||||
l2cap_le_flowctl_init(chan);
|
||||
chan->mode = L2CAP_MODE_LE_FLOWCTL;
|
||||
|
||||
err = l2cap_chan_connect(chan, la.l2_psm, __le16_to_cpu(la.l2_cid),
|
||||
&la.l2_bdaddr, la.l2_bdaddr_type);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue