Bluetooth: AMP: Remote AMP ctrl definitions
Create remote AMP controllers structure. It is used to keep information
about discovered remote AMP controllers by A2MP protocol.
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
diff --git a/net/bluetooth/a2mp.c b/net/bluetooth/a2mp.c
index f04c441..35e188c 100644
--- a/net/bluetooth/a2mp.c
+++ b/net/bluetooth/a2mp.c
@@ -594,6 +594,7 @@
list_del(&mgr->list);
mutex_unlock(&_mgr_list_lock);
+ amp_ctrl_list_flush(mgr);
kfree(mgr);
}
@@ -630,6 +631,10 @@
kref_init(&mgr->kref);
+ /* Remote AMP ctrl list initialization */
+ INIT_LIST_HEAD(&mgr->amp_ctrls);
+ mutex_init(&mgr->amp_ctrls_lock);
+
mutex_lock(&_mgr_list_lock);
list_add(&mgr->list, &_mgr_list);
mutex_unlock(&_mgr_list_lock);