[PATCH 2/4] cli: describe USB devices as such

Andre Heider a.heider at gmail.com
Wed Jan 18 05:24:36 PST 2023


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

Signed-off-by: Andre Heider <a.heider at gmail.com>
---
 iwinfo_cli.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/iwinfo_cli.c b/iwinfo_cli.c
index f46772b..5dcee9a 100644
--- a/iwinfo_cli.c
+++ b/iwinfo_cli.c
@@ -367,6 +367,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,
-- 
2.39.0




More information about the openwrt-devel mailing list