Bluetooth: Pass full hci_dev struct to mgmt callbacks
authorJohan Hedberg <johan.hedberg@intel.com>
Tue, 8 Nov 2011 18:40:14 +0000 (20:40 +0200)
committerGustavo F. Padovan <padovan@profusion.mobi>
Wed, 9 Nov 2011 14:33:26 +0000 (12:33 -0200)
commit744cf19eadcf4de914394e0eb227f94f4318f5e4
treea8c06c43be956e5db8db1bc1e052b773626892c6
parent4c659c3976e81f9def48993cd00988d53d7379f2
Bluetooth: Pass full hci_dev struct to mgmt callbacks

The current global pending command list in mgmt.c is racy. Possibly the
simplest way to fix it is to have per-hci dev lists instead of a global
one (all commands that need a pending struct are hci_dev specific).
This way the list can be protected using the already existing per-hci
dev lock. To enable this refactoring the first thing that needs to be
done is to ensure that the mgmt functions have access to the hci_dev
struct (instead of just the dev id).

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
include/net/bluetooth/hci_core.h
net/bluetooth/hci_core.c
net/bluetooth/hci_event.c
net/bluetooth/mgmt.c