Bluetooth: Use event-driven approach for handling ERTM receive buffer
authorMat Martineau <mathewm@codeaurora.org>
Thu, 7 Jul 2011 16:39:02 +0000 (09:39 -0700)
committerJaikumar Ganesh <jaikumar@google.com>
Mon, 11 Jul 2011 18:59:33 +0000 (11:59 -0700)
commitc0675b8d3c9cef40cd0c41d341815bd4e9faf5b6
tree0d15342a23b79a7449ad77b823e54e32212c464d
parentd0336628cc629b3ef9c2814016c5f5af7a8f0bce
Bluetooth: Use event-driven approach for handling ERTM receive buffer

This change moves most L2CAP ERTM receive buffer handling out of the
L2CAP core and in to the socket code.  It's up to the higher layer
(the socket code, in this case) to tell the core when its buffer is
full or has space available.  The recv op should always accept
incoming ERTM data or else the connection will go down.

Within the socket layer, an skb that does not fit in the socket
receive buffer will be temporarily stored.  When the socket is read
from, that skb will be placed in the receive buffer if possible.  Once
adequate buffer space becomes available, the L2CAP core is informed
and the ERTM local busy state is cleared.

Receive buffer management for non-ERTM modes is unchanged.

Signed-off-by: Mat Martineau <mathewm@codeaurora.org>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
include/net/bluetooth/l2cap.h
net/bluetooth/l2cap_core.c
net/bluetooth/l2cap_sock.c