]> git.ipfire.org Git - thirdparty/iw.git/commitdiff
iw: handle DFS CAC time param
authorJanusz Dziedzic <janusz.dziedzic@tieto.com>
Fri, 9 May 2014 08:19:55 +0000 (10:19 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Tue, 13 May 2014 13:48:23 +0000 (15:48 +0200)
Handle DFS CAC time param for
iw list/info, iw reg get

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
info.c
reg.c

diff --git a/info.c b/info.c
index 001b31786102e09b34d56e7f4cbc1bac67dc5bd5..97ff39d8d1ea272186bb35fe446a6b74922d4f38 100644 (file)
--- a/info.c
+++ b/info.c
@@ -199,6 +199,9 @@ next:
                                                        printf(" (for %lu sec)", time/1000);
                                                }
                                                printf("\n");
+                                               if (tb_freq[NL80211_FREQUENCY_ATTR_DFS_CAC_TIME])
+                                                       printf("\t\t\t  DFS CAC time: %u ms\n",
+                                                              nla_get_u32(tb_freq[NL80211_FREQUENCY_ATTR_DFS_CAC_TIME]));
                                        }
 
                                }
diff --git a/reg.c b/reg.c
index f2481fe54ac41d42ccfeb027a3c6d99aa8d5c43a..e1bb0d20925dfcdd5e4a677b7def4a17c7434135 100644 (file)
--- a/reg.c
+++ b/reg.c
@@ -134,6 +134,7 @@ static int print_reg_handler(struct nl_msg *msg, void *arg)
                [NL80211_ATTR_FREQ_RANGE_MAX_BW]        = { .type = NLA_U32 },
                [NL80211_ATTR_POWER_RULE_MAX_ANT_GAIN]  = { .type = NLA_U32 },
                [NL80211_ATTR_POWER_RULE_MAX_EIRP]      = { .type = NLA_U32 },
+               [NL80211_ATTR_DFS_CAC_TIME]             = { .type = NLA_U32 },
        };
 
        nla_parse(tb_msg, NL80211_ATTR_MAX, genlmsg_attrdata(gnlh, 0),
@@ -181,6 +182,11 @@ static int print_reg_handler(struct nl_msg *msg, void *arg)
 
                printf(", %d)", MBM_TO_DBM(max_eirp_mbm));
 
+               if ((flags & NL80211_RRF_DFS) && tb_rule[NL80211_ATTR_DFS_CAC_TIME])
+                       printf(", (%u ms)", nla_get_u32(tb_rule[NL80211_ATTR_DFS_CAC_TIME]));
+               else
+                       printf(", (N/A)");
+
                if (!flags) {
                        printf("\n");
                        continue;