mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-06 17:23:56 -06:00
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>
This commit is contained in:
parent
c60174e847
commit
644e1a8a34
4 changed files with 74 additions and 69 deletions
23
hw/bt/core.c
23
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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue