summaryrefslogtreecommitdiffstats
path: root/package/iw/patches/110-freq.patch
blob: f73d303bb6a239fae43541369247083435018c2f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
--- a/interface.c
+++ b/interface.c
@@ -260,6 +260,27 @@ static int print_iface_handler(struct nl
 		printf("%s\tifindex %d\n", indent, nla_get_u32(tb_msg[NL80211_ATTR_IFINDEX]));
 	if (tb_msg[NL80211_ATTR_IFTYPE])
 		printf("%s\ttype %s\n", indent, iftype_name(nla_get_u32(tb_msg[NL80211_ATTR_IFTYPE])));
+	if (tb_msg[NL80211_ATTR_WIPHY_FREQ]) {
+		const char *mode;
+
+		if (tb_msg[NL80211_ATTR_WIPHY_CHANNEL_TYPE])
+			switch(nla_get_u32(tb_msg[NL80211_ATTR_WIPHY_CHANNEL_TYPE])) {
+			case NL80211_CHAN_HT20:
+				mode = "HT20";
+				break;
+			case NL80211_CHAN_HT40PLUS:
+				mode = "HT40+";
+				break;
+			case NL80211_CHAN_HT40MINUS:
+				mode = "HT40-";
+				break;
+			default:
+				mode = "";
+			}
+
+		printf("%s\tfrequency %d MHz %s\n", indent, nla_get_u32(tb_msg[NL80211_ATTR_WIPHY_FREQ]), mode);
+	}
+
 
 	return NL_SKIP;
 }