]> git.ipfire.org Git - thirdparty/iw.git/commitdiff
iw: phy: dump wiphy index
authorBrian Norris <briannorris@chromium.org>
Thu, 12 Mar 2020 01:05:15 +0000 (18:05 -0700)
committerJohannes Berg <johannes.berg@intel.com>
Fri, 20 Mar 2020 09:48:51 +0000 (10:48 +0100)
We support getting wiphy info by index (e.g., 'iw phy#0 info') but we
don't actually dump that info anywhere. Let's fix that.

Signed-off-by: Brian Norris <briannorris@chromium.org>
Link: https://lore.kernel.org/r/20200312010515.21095-1-briannorris@chromium.org
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
info.c

diff --git a/info.c b/info.c
index 04f4bd7414d62252d4f5dab08033f227cb790541..97240f68371d21f6a1049708aa9ad17de796aa42 100644 (file)
--- a/info.c
+++ b/info.c
@@ -133,6 +133,9 @@ static int print_phy_handler(struct nl_msg *msg, void *arg)
        if (print_name && tb_msg[NL80211_ATTR_WIPHY_NAME])
                printf("Wiphy %s\n", nla_get_string(tb_msg[NL80211_ATTR_WIPHY_NAME]));
 
+       if (print_name && tb_msg[NL80211_ATTR_WIPHY])
+               printf("\twiphy index: %u\n", nla_get_u32(tb_msg[NL80211_ATTR_WIPHY]));
+
        /* needed for split dump */
        if (tb_msg[NL80211_ATTR_WIPHY_BANDS]) {
                nla_for_each_nested(nl_band, tb_msg[NL80211_ATTR_WIPHY_BANDS], rem_band) {