diff mbox series

[6/7] wiphy: print driver flags on startup

Message ID 20230615192415.1718516-6-prestwoj@gmail.com (mailing list archive)
State New
Headers show
Series [1/7] wiphy: store driver flags directly in wiphy object | expand

Commit Message

James Prestwood June 15, 2023, 7:24 p.m. UTC
Similar to other basic information, print the driver flags so the
user is informed what is set.
---
 src/wiphy.c | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
diff mbox series

Patch

diff --git a/src/wiphy.c b/src/wiphy.c
index 2c09d47a..ebc91206 100644
--- a/src/wiphy.c
+++ b/src/wiphy.c
@@ -1333,6 +1333,27 @@  static void wiphy_print_basic_info(struct wiphy *wiphy)
 		l_free(joined);
 		l_strfreev(iftypes);
 	}
+
+	if (wiphy->driver_flags) {
+		char **flags = l_strv_new();
+		char *joined;
+
+		if (wiphy->driver_flags & DEFAULT_IF)
+			flags = l_strv_append(flags, "DefaultInterface");
+
+		if (wiphy->driver_flags & FORCE_PAE)
+			flags = l_strv_append(flags, "ForcePae");
+
+		if (wiphy->driver_flags & POWER_SAVE_DISABLE)
+			flags = l_strv_append(flags, "PowerSaveDisable");
+
+		joined = l_strjoinv(flags, ' ');
+
+		l_info("\tDriver Flags: %s", joined);
+
+		l_free(joined);
+		l_strfreev(flags);
+	}
 }
 
 static void parse_supported_commands(struct wiphy *wiphy,