iw: display interface TX power if available
[openwrt/staging/wigyori.git] / package / network / utils / iw / patches / 300-display_interface_TX_power.patch
1 From: =?utf-8?q?Rafa=C5=82_Mi=C5=82ecki?= <zajec5@gmail.com>
2 Date: Tue, 1 Sep 2015 09:55:52 +0200
3 Subject: iw: display interface TX power if available
4 MIME-Version: 1.0
5 Content-Type: text/plain; charset="utf-8"
6 Content-Transfer-Encoding: 8bit
7
8 Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
9 [print dBm]
10 Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 ---
12 interface.c | 7 +++++++
13 1 file changed, 7 insertions(+)
14
15 diff --git a/interface.c b/interface.c
16 index 73ccecd..4f0821d 100644
17 --- a/interface.c
18 +++ b/interface.c
19 @@ -368,6 +368,13 @@ static int print_iface_handler(struct nl_msg *msg, void *arg)
20 printf("\n");
21 }
22
23 + if (tb_msg[NL80211_ATTR_WIPHY_TX_POWER_LEVEL]) {
24 + uint32_t txp = nla_get_u32(tb_msg[NL80211_ATTR_WIPHY_TX_POWER_LEVEL]);
25 +
26 + printf("%s\ttxpower %d.%.2d dBm\n",
27 + indent, txp / 100, txp % 100);
28 + }
29 +
30 return NL_SKIP;
31 }
32