cli: describe USB devices as such
authorAndre Heider <a.heider@gmail.com>
Wed, 18 Jan 2023 13:24:36 +0000 (14:24 +0100)
committerChristian Marangi <ansuelsmth@gmail.com>
Fri, 20 Jan 2023 15:08:00 +0000 (16:08 +0100)
This makes it clear if the hardware is embedded or usb/pci based.

Signed-off-by: Andre Heider <a.heider@gmail.com>
iwinfo_cli.c

index 9b3e8e367d6254d32be0c06d6e503d743b36b6de..3bce96e5536fc3d30aca5b0ced1b9c29673f5e30 100644 (file)
@@ -337,6 +337,10 @@ static char * print_hardware_id(const struct iwinfo_ops *iw, const char *ifname)
        {
                if (strlen(ids.compatible) > 0)
                        snprintf(buf, sizeof(buf), "embedded");
+               else if (ids.vendor_id == 0 && ids.device_id == 0 &&
+                        ids.subsystem_vendor_id != 0 && ids.subsystem_device_id != 0)
+                       snprintf(buf, sizeof(buf), "USB %04X:%04X",
+                               ids.subsystem_vendor_id, ids.subsystem_device_id);
                else
                        snprintf(buf, sizeof(buf), "%04X:%04X %04X:%04X",
                                ids.vendor_id, ids.device_id,