Ejemplo n.º 1
0
static int cmd_host_bus_device_list(struct vmm_chardev *cdev,
                                    const char *bus_name)
{
    u32 num, count = vmm_devdrv_bus_count();
    struct vmm_bus *b;
    struct vmm_device *d;

    b = vmm_devdrv_find_bus(bus_name);
    if (!b) {
        vmm_cprintf(cdev, "Failed to find %s bus\n", bus_name);
        return VMM_ENOTAVAIL;
    }
    count = vmm_devdrv_bus_device_count(b);

    vmm_cprintf(cdev, "----------------------------------------");
    vmm_cprintf(cdev, "--------------------\n");
    vmm_cprintf(cdev, " %-7s %-25s %-25s\n",
                "Num#", "Device Name", "Parent Name");
    vmm_cprintf(cdev, "----------------------------------------");
    vmm_cprintf(cdev, "--------------------\n");
    for (num = 0; num < count; num++) {
        d = vmm_devdrv_bus_device(b, num);
        vmm_cprintf(cdev, " %-7d %-25s %-25s\n",
                    num, d->name, (d->parent) ? d->parent->name : "---");
    }
    vmm_cprintf(cdev, "----------------------------------------");
    vmm_cprintf(cdev, "--------------------\n");

    return VMM_OK;
}
Ejemplo n.º 2
0
static int cmd_host_bus_list_iter(struct vmm_bus *b, void *data)
{
	u32 dcount;
	struct cmd_host_list_iter *p = data;

	dcount = vmm_devdrv_bus_device_count(b);
	vmm_cprintf(p->cdev, " %-7d %-15s %-15d\n", p->num++, b->name, dcount);

	return VMM_OK;
}
Ejemplo n.º 3
0
static void cmd_host_bus_list(struct vmm_chardev *cdev)
{
    u32 num, dcount, count = vmm_devdrv_bus_count();
    struct vmm_bus *b;

    vmm_cprintf(cdev, "----------------------------------------\n");
    vmm_cprintf(cdev, " %-7s %-15s %-15s\n",
                "Num#", "Bus Name", "Device Count");
    vmm_cprintf(cdev, "----------------------------------------\n");
    for (num = 0; num < count; num++) {
        b = vmm_devdrv_bus(num);
        dcount = vmm_devdrv_bus_device_count(b);
        vmm_cprintf(cdev, " %-7d %-15s %-15d\n",
                    num, b->name, dcount);
    }
    vmm_cprintf(cdev, "----------------------------------------\n");
}