aboutsummaryrefslogtreecommitdiffstats
path: root/package/network/utils/iw/patches/300-display_interface_TX_power.patch
blob: 2cdf360cc57a512680e7f9f0b2450055c2c81d35 (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
From: =?utf-8?q?Rafa=C5=82_Mi=C5=82ecki?= <zajec5@gmail.com>
Date: Tue, 1 Sep 2015 09:55:52 +0200
Subject: iw: display interface TX power if available
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
[print dBm]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 interface.c | 7 +++++++
 1 file changed, 7 insertions(+)

--- a/interface.c
+++ b/interface.c
@@ -368,6 +368,13 @@ static int print_iface_handler(struct nl
 		printf("\n");
 	}
 
+	if (tb_msg[NL80211_ATTR_WIPHY_TX_POWER_LEVEL]) {
+		uint32_t txp = nla_get_u32(tb_msg[NL80211_ATTR_WIPHY_TX_POWER_LEVEL]);
+
+		printf("%s\ttxpower %d.%.2d dBm\n",
+		       indent, txp / 100, txp % 100);
+	}
+
 	return NL_SKIP;
 }