struct ieee80211_beacon_channel {
__u16 center_freq;
- bool passive_scan;
+ bool no_ir;
bool no_ibss;
};
struct nlattr *tb_freq[NL80211_FREQUENCY_ATTR_MAX + 1];
static struct nla_policy beacon_freq_policy[NL80211_FREQUENCY_ATTR_MAX + 1] = {
[NL80211_FREQUENCY_ATTR_FREQ] = { .type = NLA_U32 },
- [NL80211_FREQUENCY_ATTR_PASSIVE_SCAN] = { .type = NLA_FLAG },
- [NL80211_FREQUENCY_ATTR_NO_IBSS] = { .type = NLA_FLAG },
+ [NL80211_FREQUENCY_ATTR_NO_IR] = { .type = NLA_FLAG },
+ [__NL80211_FREQUENCY_ATTR_NO_IBSS] = { .type = NLA_FLAG },
};
if (nla_parse_nested(tb_freq,
chan->center_freq = nla_get_u32(tb_freq[NL80211_FREQUENCY_ATTR_FREQ]);
- if (tb_freq[NL80211_FREQUENCY_ATTR_PASSIVE_SCAN])
- chan->passive_scan = true;
- if (tb_freq[NL80211_FREQUENCY_ATTR_NO_IBSS])
+ if (tb_freq[NL80211_FREQUENCY_ATTR_NO_IR])
+ chan->no_ir = true;
+ if (tb_freq[__NL80211_FREQUENCY_ATTR_NO_IBSS])
chan->no_ibss = true;
return 0;
chan_before_beacon.center_freq,
ieee80211_frequency_to_channel(chan_before_beacon.center_freq));
- if (chan_before_beacon.passive_scan && !chan_after_beacon.passive_scan)
- printf("\to active scanning enabled\n");
- if (chan_before_beacon.no_ibss && !chan_after_beacon.no_ibss)
- printf("\to beaconing enabled\n");
+ if (chan_before_beacon.no_ir && !chan_after_beacon.no_ir) {
+ if (chan_before_beacon.no_ibss && !chan_after_beacon.no_ibss)
+ printf("\to Initiating radiation enabled\n");
+ else
+ printf("\to active scan enabled\n");
+ } else if (chan_before_beacon.no_ibss && !chan_after_beacon.no_ibss) {
+ printf("\to ibss enabled\n");
+ }
break;
case NL80211_CMD_NEW_STATION:
static struct nla_policy freq_policy[NL80211_FREQUENCY_ATTR_MAX + 1] = {
[NL80211_FREQUENCY_ATTR_FREQ] = { .type = NLA_U32 },
[NL80211_FREQUENCY_ATTR_DISABLED] = { .type = NLA_FLAG },
- [NL80211_FREQUENCY_ATTR_PASSIVE_SCAN] = { .type = NLA_FLAG },
- [NL80211_FREQUENCY_ATTR_NO_IBSS] = { .type = NLA_FLAG },
+ [NL80211_FREQUENCY_ATTR_NO_IR] = { .type = NLA_FLAG },
+ [__NL80211_FREQUENCY_ATTR_NO_IBSS] = { .type = NLA_FLAG },
[NL80211_FREQUENCY_ATTR_RADAR] = { .type = NLA_FLAG },
[NL80211_FREQUENCY_ATTR_MAX_TX_POWER] = { .type = NLA_U32 },
};
print_flag("disabled", &open);
goto next;
}
- if (tb_freq[NL80211_FREQUENCY_ATTR_PASSIVE_SCAN])
- print_flag("passive scanning", &open);
- if (tb_freq[NL80211_FREQUENCY_ATTR_NO_IBSS])
- print_flag("no IBSS", &open);
+
+ /* If both flags are set assume an new kernel */
+ if (tb_freq[NL80211_FREQUENCY_ATTR_NO_IR] && tb_freq[__NL80211_FREQUENCY_ATTR_NO_IBSS]) {
+ print_flag("no IR", &open);
+ } else if (tb_freq[NL80211_FREQUENCY_ATTR_PASSIVE_SCAN]) {
+ print_flag("passive scan", &open);
+ } else if (tb_freq[__NL80211_FREQUENCY_ATTR_NO_IBSS]){
+ print_flag("no ibss", &open);
+ }
+
if (tb_freq[NL80211_FREQUENCY_ATTR_RADAR])
print_flag("radar detection", &open);
next:
PARSE_FLAG(NL80211_RRF_NO_OUTDOOR, "NO-OUTDOOR");
PARSE_FLAG(NL80211_RRF_DFS, "DFS");
PARSE_FLAG(NL80211_RRF_PTP_ONLY, "PTP-ONLY");
- PARSE_FLAG(NL80211_RRF_PASSIVE_SCAN, "PASSIVE-SCAN");
- PARSE_FLAG(NL80211_RRF_NO_IBSS, "NO-IBSS");
+
+ /* Kernels that support NO_IR always turn on both flags */
+ if ((flags & NL80211_RRF_NO_IR) && (flags & __NL80211_RRF_NO_IBSS)) {
+ printf(", NO-IR");
+ } else {
+ PARSE_FLAG(NL80211_RRF_PASSIVE_SCAN, "PASSIVE-SCAN");
+ PARSE_FLAG(__NL80211_RRF_NO_IBSS, "NO-IBSS");
+ }
printf("\n");
}