300-display_interface_TX_power.patch 781 B

123456789101112131415161718192021222324252627282930
  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. Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
  8. [print dBm]
  9. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
  10. ---
  11. interface.c | 7 +++++++
  12. 1 file changed, 7 insertions(+)
  13. --- a/interface.c
  14. +++ b/interface.c
  15. @@ -368,6 +368,13 @@ static int print_iface_handler(struct nl
  16. printf("\n");
  17. }
  18. + if (tb_msg[NL80211_ATTR_WIPHY_TX_POWER_LEVEL]) {
  19. + uint32_t txp = nla_get_u32(tb_msg[NL80211_ATTR_WIPHY_TX_POWER_LEVEL]);
  20. +
  21. + printf("%s\ttxpower %d.%.2d dBm\n",
  22. + indent, txp / 100, txp % 100);
  23. + }
  24. +
  25. return NL_SKIP;
  26. }