diff options
author | Luis R. Rodriguez <mcgrof@do-not-panic.com> | 2013-10-21 14:06:56 +0200 |
---|---|---|
committer | Luis R. Rodriguez <mcgrof@do-not-panic.com> | 2013-10-30 12:21:39 -0700 |
commit | 3fb58aa07753669d5caea24a9bd134ac3d08af57 (patch) | |
tree | 3e4ee1a79dfd24397d4e23f5505ff4def22b5a00 | |
parent | 6145db245cb1af399c3605ecb0cc1392feeb444e (diff) | |
download | crda-3fb58aa07753669d5caea24a9bd134ac3d08af57.tar.gz |
crda: consolidate passive-scan and no-ibss flags
We consolidate these two flags into one flag to indicate
initiating radiation is not allowed.
For parsing we'll treat the no-ibss flag moving forward
as also passive-scan as well, newer kernels will always
treat these equally, older kernels will use the still
use them separately even though in practice they are
used together interchangably.
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
-rw-r--r-- | regdb.h | 6 | ||||
-rw-r--r-- | reglib.c | 9 |
2 files changed, 9 insertions, 6 deletions
@@ -79,10 +79,12 @@ enum reg_rule_flags { * links */ RRF_PTMP_ONLY = 1<<6, /* this is only for Point To Multi * Point links */ - RRF_PASSIVE_SCAN = 1<<7, /* passive scan is required */ - RRF_NO_IBSS = 1<<8, /* IBSS is not allowed */ + RRF_NO_IR = 1<<7, /* do not initiate radiation */ + __RRF_NO_IBSS = 1<<8, /* old no-IBSS rule, maps to no-ir */ }; +#define RRF_NO_IR_ALL (RRF_NO_IR | __RRF_NO_IBSS) + /** * enum regdb_dfs_regions - regulatory DFS regions * @@ -313,6 +313,9 @@ static void reg_rule2rd(uint8_t *db, size_t dblen, rd_power_rule->max_eirp = ntohl(power->max_eirp); rd_reg_rule->flags = ntohl(rule->flags); + + if (rd_reg_rule->flags & RRF_NO_IR_ALL) + rd_reg_rule->flags |= RRF_NO_IR_ALL; } /* Converts a file regdomain to ieee80211_regdomain, easier to manage */ @@ -694,10 +697,8 @@ static void print_reg_rule(const struct ieee80211_reg_rule *rule) printf(", PTP-ONLY"); if (rule->flags & RRF_PTMP_ONLY) printf(", PTMP-ONLY"); - if (rule->flags & RRF_PASSIVE_SCAN) - printf(", PASSIVE-SCAN"); - if (rule->flags & RRF_NO_IBSS) - printf(", NO-IBSS"); + if (rule->flags & RRF_NO_IR_ALL) + printf(", NO-IR"); printf("\n"); } |