summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndre Heider <a.heider@gmail.com>2023-01-18 14:24:36 +0100
committerChristian Marangi <ansuelsmth@gmail.com>2023-01-20 16:08:00 +0100
commitdbc0ee7c57134f848726f7bbe7638ab10d8596e8 (patch)
tree50f8cf836b4ab5b0c5e04e36ae131acf2741ac1e
parent891acee6186d3600e5516c95fe613360b353c897 (diff)
downloadiwinfo-dbc0ee7c57134f848726f7bbe7638ab10d8596e8.tar.gz
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>
-rw-r--r--iwinfo_cli.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/iwinfo_cli.c b/iwinfo_cli.c
index 9b3e8e3..3bce96e 100644
--- a/iwinfo_cli.c
+++ b/iwinfo_cli.c
@@ -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,