cli: describe USB devices as such

This makes it clear if the hardware is embedded or usb/pci based.

Signed-off-by: Andre Heider <a.heider@gmail.com>
This commit is contained in:
Andre Heider 2023-01-18 14:24:36 +01:00 committed by Christian Marangi
parent 891acee618
commit dbc0ee7c57
No known key found for this signature in database
GPG key ID: AC001D09ADBFEAD7

View file

@ -337,6 +337,10 @@ static char * print_hardware_id(const struct iwinfo_ops *iw, const char *ifname)
{ {
if (strlen(ids.compatible) > 0) if (strlen(ids.compatible) > 0)
snprintf(buf, sizeof(buf), "embedded"); 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 else
snprintf(buf, sizeof(buf), "%04X:%04X %04X:%04X", snprintf(buf, sizeof(buf), "%04X:%04X %04X:%04X",
ids.vendor_id, ids.device_id, ids.vendor_id, ids.device_id,