[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCHv2] Make usb-bt-dongle configurable
From: |
Gerd Hoffmann |
Subject: |
Re: [Qemu-devel] [PATCHv2] Make usb-bt-dongle configurable |
Date: |
Tue, 03 Sep 2013 09:41:11 +0200 |
> diff --git a/hw/bt/core.c b/hw/bt/core.c
> index 49012e0..ef27b15 100644
> --- a/hw/bt/core.c
> +++ b/hw/bt/core.c
> @@ -119,3 +119,28 @@ 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;
> +}
This (and some other bits) are pure code motion from vl.c, correct?
Can you split this into a separate patch please? That'll simplify the
review o the actual code changes.
It also doesn't make much sense to compile hw/bt/ with
CONFIG_USB_BLUETOOTH=n. It's basically dead code then.
cheers,
Gerd