struct HCIInfo *hci_init(const char *str)

{

    char *endp;

    struct bt_scatternet_s *vlan = 0;



    if (!strcmp(str, "null"))

        /* null */

        return &null_hci;

    else if (!strncmp(str, "host", 4) && (str[4] == '\0' || str[4] == ':'))

        /* host[:hciN] */

        return bt_host_hci(str[4] ? str + 5 : "hci0");

    else if (!strncmp(str, "hci", 3)) {

        /* hci[,vlan=n] */

        if (str[3]) {

            if (!strncmp(str + 3, ",vlan=", 6)) {

                vlan = qemu_find_bt_vlan(strtol(str + 9, &endp, 0));

                if (*endp)

                    vlan = 0;

            }

        } else

            vlan = qemu_find_bt_vlan(0);

        if (vlan)

           return bt_new_hci(vlan);

    }



    fprintf(stderr, "qemu: Unknown bluetooth HCI `%s'.\n", str);



    return 0;

}

struct HCIInfo *hci_init(const char *str)

{

    char *endp;

    struct bt_scatternet_s *vlan = 0;



    if (!strcmp(str, "null"))

        

        return &null_hci;

    else if (!strncmp(str, "host", 4) && (str[4] == '\0' || str[4] == ':'))

        

        return bt_host_hci(str[4] ? str + 5 : "hci0");

    else if (!strncmp(str, "hci", 3)) {

        

        if (str[3]) {

            if (!strncmp(str + 3, ",vlan=", 6)) {

                vlan = qemu_find_bt_vlan(strtol(str + 9, &endp, 0));

                if (*endp)

                    vlan = 0;

            }

        } else

            vlan = qemu_find_bt_vlan(0);

        if (vlan)

           return bt_new_hci(vlan);

    }



    fprintf(stderr, "qemu: Unknown bluetooth HCI `%s'.\n", str);



    return 0;

}

struct HCIInfo *FUNC_0(const char *VAR_0)

{

    char *VAR_1;

    struct bt_scatternet_s *VAR_2 = 0;



    if (!strcmp(VAR_0, "null"))

        

        return &null_hci;

    else if (!strncmp(VAR_0, "host", 4) && (VAR_0[4] == '\0' || VAR_0[4] == ':'))

        

        return bt_host_hci(VAR_0[4] ? VAR_0 + 5 : "hci0");

    else if (!strncmp(VAR_0, "hci", 3)) {

        

        if (VAR_0[3]) {

            if (!strncmp(VAR_0 + 3, ",VAR_2=", 6)) {

                VAR_2 = qemu_find_bt_vlan(strtol(VAR_0 + 9, &VAR_1, 0));

                if (*VAR_1)

                    VAR_2 = 0;

            }

        } else

            VAR_2 = qemu_find_bt_vlan(0);

        if (VAR_2)

           return bt_new_hci(VAR_2);

    }



    fprintf(stderr, "qemu: Unknown bluetooth HCI `%s'.\n", VAR_0);



    return 0;

}

struct HCIInfo *FUNC_0(const char *VAR_0)
{ char *VAR_1; struct bt_scatternet_s *VAR_2 = 0; if (!strcmp(VAR_0, "null"))
return &null_hci; else if (!strncmp(VAR_0, "host", 4) && (VAR_0[4] == '\0' || VAR_0[4] == ':'))
return bt_host_hci(VAR_0[4] ? VAR_0 + 5 : "hci0"); else if (!strncmp(VAR_0, "hci", 3)) { if (VAR_0[3]) { if (!strncmp(VAR_0 + 3, ",VAR_2=", 6)) { VAR_2 = qemu_find_bt_vlan(strtol(VAR_0 + 9, &VAR_1, 0)); if (*VAR_1)
VAR_2 = 0; } } else VAR_2 = qemu_find_bt_vlan(0); if (VAR_2)
return bt_new_hci(VAR_2); } fprintf(stderr, "qemu: Unknown bluetooth HCI `%s'.\n", VAR_0); return 0; }