]> git.baikalelectronics.ru Git - kernel.git/commit
Bluetooth: Provide L2CAP ops callback for memcpy_fromiovec
authorJukka Rissanen <jukka.rissanen@linux.intel.com>
Wed, 18 Jun 2014 13:37:07 +0000 (16:37 +0300)
committerMarcel Holtmann <marcel@holtmann.org>
Thu, 3 Jul 2014 15:42:43 +0000 (17:42 +0200)
commit53f17efb99dd7bdec6bb9b2326991b613f208c41
tree644ce8cb68ff8d441f5e0d8871a31fa9bb2348c0
parent19a4b5e5fe7952f857b6b80f70f0c22e0f242e39
Bluetooth: Provide L2CAP ops callback for memcpy_fromiovec

The highly optimized TX path for L2CAP channels and its fragmentation
within the HCI ACL packets requires to copy data from user provided
IO vectors and also kernel provided memory buffers.

This patch allows channel clients to provide a memcpy_fromiovec callback
to keep this optimized behavior, but adapt it to kernel vs user memory
for the TX path. For all kernel internal L2CAP channels, a default
implementation is provided that can be referenced.

In case of A2MP, this fixes a long-standing issue with wrongly accessing
kernel memory as user memory.

This patch originally by Marcel Holtmann.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
include/net/bluetooth/l2cap.h
net/bluetooth/a2mp.c
net/bluetooth/l2cap_core.c
net/bluetooth/l2cap_sock.c