Search Linux Wireless

[PATCH 2/2] iw: print firmware and hardware version

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



struct wiphy now contains firmware and hardware version, print that
information to the user.
---

 info.c    |   15 +++++++++++++++
 nl80211.h |    3 +++
 2 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/info.c b/info.c
index 7bca69d..ae3ed54 100644
--- a/info.c
+++ b/info.c
@@ -66,6 +66,7 @@ static int print_phy_handler(struct nl_msg *msg, void *arg)
 	struct nlattr *nl_freq;
 	struct nlattr *nl_rate;
 	struct nlattr *nl_mode;
+	const char *str;
 	int bandidx = 1;
 	int rem_band, rem_freq, rem_rate, rem_mode;
 	int open;
@@ -263,6 +264,20 @@ static int print_phy_handler(struct nl_msg *msg, void *arg)
 			printf("\tRTS threshold: %d\n", rts);
 	}
 
+	if (tb_msg[NL80211_ATTR_FW_VERSION]) {
+		str = nla_get_string(tb_msg[NL80211_ATTR_FW_VERSION]);
+		if (strlen(str) == 0)
+			str = "<unknown>";
+		printf("\tFirmware version: %s\n", str);
+	}
+
+	if (tb_msg[NL80211_ATTR_HW_VERSION]) {
+		str = nla_get_string(tb_msg[NL80211_ATTR_HW_VERSION]);
+		if (strlen(str) == 0)
+			str = "<unknown>";
+		printf("\tHardware version: %s\n", str);
+	}
+
 	if (!tb_msg[NL80211_ATTR_SUPPORTED_IFTYPES])
 		return NL_SKIP;
 
diff --git a/nl80211.h b/nl80211.h
index a8d71ed..6d6651f 100644
--- a/nl80211.h
+++ b/nl80211.h
@@ -714,6 +714,9 @@ enum nl80211_attrs {
 
 	NL80211_ATTR_PID,
 
+	NL80211_ATTR_FW_VERSION,
+	NL80211_ATTR_HW_VERSION,
+
 	/* add attributes here, update the policy in nl80211.c */
 
 	__NL80211_ATTR_AFTER_LAST,

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux