Bluetooth: Add callback to create proper cmd_complete events
authorJohan Hedberg <johan.hedberg@intel.com>
Fri, 5 Dec 2014 11:36:00 +0000 (13:36 +0200)
committerMarcel Holtmann <marcel@holtmann.org>
Fri, 5 Dec 2014 11:46:09 +0000 (12:46 +0100)
commit1b9b5ee53023b7299495c01fbee17f1985ec0d47
treeda3c709f2a3c5874018afc64649b9642894537d7
parent1db996045213e02a5c5e31ef6b07b3154b4f9bd9
Bluetooth: Add callback to create proper cmd_complete events

We've got a couple of generic scenarios where all pending mgmt commands
are processed and responses are sent to them. These scenarios are
powering off the adapter and removing the adapter. So far the code has
been generating cmd_status responses with NOT_POWERED and INVALID_INDEX
resposes respectively, but this violates the mgmt specification for
commands that should always generate a cmd_complete.

This patch adds support for specifying a callback for the pending_cmd
context that each command handler can use for command-specific
cmd_complete event generation. The actual per-command event generators
will come in subsequent patches.

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