summaryrefslogtreecommitdiff
path: root/hw/bt/core.c
diff options
context:
space:
mode:
authorMiroslav Rezanina <mrezanin@redhat.com>2013-09-03 11:23:08 +0200
committerGerd Hoffmann <kraxel@redhat.com>2013-09-10 11:14:41 +0200
commit644e1a8a34d2f799bfeefae94b71593a2aa662ae (patch)
tree0979c9a61023be59e703f47e888b75a8face7773 /hw/bt/core.c
parentc60174e847082ab9f70720f86509a3353f816fad (diff)
downloadqemu-644e1a8a34d2f799bfeefae94b71593a2aa662ae.tar.gz
Preparation for usb-bt-dongle conditional build
To allow disable usb-bt-dongle device using CONFIG_BLUETOOTH option, some of functions in vl.c file has to be made accessible in dev-bluetooth.c. This is pure code moving. Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'hw/bt/core.c')
-rw-r--r--hw/bt/core.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/hw/bt/core.c b/hw/bt/core.c
index 49012e028c..0ffc948898 100644
--- a/hw/bt/core.c
+++ b/hw/bt/core.c
@@ -119,3 +119,26 @@ void bt_device_done(struct bt_device_s *dev)
*p = dev->next;
}
+
+static struct bt_vlan_s {
+ struct bt_scatternet_s net;
+ int id;
+ struct bt_vlan_s *next;
+} *first_bt_vlan;
+
+/* find or alloc a new bluetooth "VLAN" */
+struct bt_scatternet_s *qemu_find_bt_vlan(int id)
+{
+ struct bt_vlan_s **pvlan, *vlan;
+ for (vlan = first_bt_vlan; vlan != NULL; vlan = vlan->next) {
+ if (vlan->id == id)
+ return &vlan->net;
+ }
+ vlan = g_malloc0(sizeof(struct bt_vlan_s));
+ vlan->id = id;
+ pvlan = &first_bt_vlan;
+ while (*pvlan != NULL)
+ pvlan = &(*pvlan)->next;
+ *pvlan = vlan;
+ return &vlan->net;
+}