linux/include/net/bluetooth
Andrei Emeltchenko e702112ff6 Bluetooth: Use non-flushable by default L2CAP data packets
Modification of Nick Pelly <npelly@google.com> patch.

With Bluetooth 2.1 ACL packets can be flushable or non-flushable. This commit
makes ACL data packets non-flushable by default on compatible chipsets, and
adds the BT_FLUSHABLE socket option to explicitly request flushable ACL
data packets for a given L2CAP socket. This is useful for A2DP data which can
be safely discarded if it can not be delivered within a short time (while
other ACL data should not be discarded).

Note that making ACL data flushable has no effect unless the automatic flush
timeout for that ACL link is changed from its default of 0 (infinite).

Default packet types (for compatible chipsets):
Frame 34: 13 bytes on wire (104 bits), 13 bytes captured (104 bits)
Bluetooth HCI H4
Bluetooth HCI ACL Packet
    .... 0000 0000 0010 = Connection Handle: 0x0002
    ..00 .... .... .... = PB Flag: First Non-automatically Flushable Packet (0)
    00.. .... .... .... = BC Flag: Point-To-Point (0)
    Data Total Length: 8
Bluetooth L2CAP Packet

After setting BT_FLUSHABLE
(sock.setsockopt(274 /*SOL_BLUETOOTH*/, 8 /* BT_FLUSHABLE */, 1 /* flush */))
Frame 34: 13 bytes on wire (104 bits), 13 bytes captured (104 bits)
Bluetooth HCI H4
Bluetooth HCI ACL Packet
    .... 0000 0000 0010 = Connection Handle: 0x0002
    ..10 .... .... .... = PB Flag: First Automatically Flushable Packet (2)
    00.. .... .... .... = BC Flag: Point-To-Point (0)
    Data Total Length: 8
Bluetooth L2CAP Packet

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@nokia.com>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-02-08 01:40:04 -02:00
..
bluetooth.h Bluetooth: Use non-flushable by default L2CAP data packets 2011-02-08 01:40:04 -02:00
hci.h Bluetooth: Use non-flushable by default L2CAP data packets 2011-02-08 01:40:04 -02:00
hci_core.h Bluetooth: Use non-flushable by default L2CAP data packets 2011-02-08 01:40:04 -02:00
l2cap.h Bluetooth: Use non-flushable by default L2CAP data packets 2011-02-08 01:40:04 -02:00
mgmt.h Bluetooth: Add management events for controller addition & removal 2010-12-22 22:58:00 -02:00
rfcomm.h Bluetooth: clean up legal text 2010-12-01 21:04:43 -02:00
sco.h Bluetooth: clean up legal text 2010-12-01 21:04:43 -02:00