]> git.baikalelectronics.ru Git - kernel.git/commit
Bluetooth: Fix waiting for clearing of BT_SK_SUSPEND flag
authorJohan Hedberg <johan.hedberg@intel.com>
Mon, 16 Sep 2013 10:05:19 +0000 (13:05 +0300)
committerGustavo Padovan <gustavo.padovan@collabora.co.uk>
Wed, 18 Sep 2013 22:02:59 +0000 (17:02 -0500)
commitb63cb17557712b6b2faa24180c54aa0d35bad4d9
tree887bbd39d57da0418c41f5bd37f19ca7d1e4f347
parent7c0507235c095d8e776c8049c2745d736104396f
Bluetooth: Fix waiting for clearing of BT_SK_SUSPEND flag

In the case of blocking sockets we should not proceed with sendmsg() if
the socket has the BT_SK_SUSPEND flag set. So far the code was only
ensuring that POLLOUT doesn't get set for non-blocking sockets using
poll() but there was no code in place to ensure that blocking sockets do
the right thing when writing to them.

This patch adds a new bt_sock_wait_ready helper function to sleep in the
sendmsg call if the BT_SK_SUSPEND flag is set, and wake up as soon as it
is unset. It also updates the L2CAP and RFCOMM sendmsg callbacks to take
advantage of this new helper function.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
include/net/bluetooth/bluetooth.h
net/bluetooth/af_bluetooth.c
net/bluetooth/l2cap_sock.c
net/bluetooth/rfcomm/sock.c