OSDN Git Service

Bluetooth: Fix L2CAP information request handling for fixed channels
authorJohan Hedberg <johan.hedberg@intel.com>
Thu, 11 Sep 2014 00:37:46 +0000 (17:37 -0700)
committerMarcel Holtmann <marcel@holtmann.org>
Thu, 11 Sep 2014 00:45:24 +0000 (02:45 +0200)
commitaeaeb4bbca520b862d3b3e7cd74c23042815a160
tree334e793438d245be89700c1264a5e79b72212d83
parenta6f7833ca353d50de46e3532afebe4abfc5dc4d9
Bluetooth: Fix L2CAP information request handling for fixed channels

Even if we have no connection-oriented channels we should perform the
L2CAP Information Request procedures before notifying L2CAP channels of
the connection. This is so that the L2CAP channel implementations can
perform checks on what the remote side supports (e.g. does it support
the fixed channel in question).

So far the code has relied on the l2cap_do_start() function to initiate
the Information Request, however l2cap_do_start() is used on a
per-channel basis and only for connection-oriented channels. This means
that if there are no connection-oriented channels on the system we would
never start the Information Request procedure.

This patch creates a new l2cap_request_info() helper function to
initiate the Information Request procedure, and ensures that it is
called whenever a BR/EDR connection has been established. The patch also
updates fixed channels to be notified of connection readiness only once
the Information Request procedure has completed.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
net/bluetooth/l2cap_core.c