device: show a bit more info if the device is not present
authorFelix Fietkau <nbd@openwrt.org>
Mon, 4 Jun 2012 18:16:57 +0000 (20:16 +0200)
committerFelix Fietkau <nbd@openwrt.org>
Mon, 4 Jun 2012 18:16:57 +0000 (20:16 +0200)
device.c

index b6f4725..9dcd29a 100644 (file)
--- a/device.c
+++ b/device.c
@@ -704,10 +704,13 @@ device_dump_status(struct blob_buf *b, struct device *dev)
                return;
        }
 
                return;
        }
 
+       blobmsg_add_u8(b, "external", dev->external);
+       blobmsg_add_u8(b, "present", dev->present);
+       blobmsg_add_string(b, "type", dev->type->name);
+
        if (!dev->present)
                return;
 
        if (!dev->present)
                return;
 
-       blobmsg_add_string(b, "type", dev->type->name);
        blobmsg_add_u8(b, "up", !!dev->active);
        if (dev->type->dump_info)
                dev->type->dump_info(dev, b);
        blobmsg_add_u8(b, "up", !!dev->active);
        if (dev->type->dump_info)
                dev->type->dump_info(dev, b);