Commit 4c7d3982 authored by Luis R. Rodriguez's avatar Luis R. Rodriguez Committed by Johannes Berg

cfg80211: use enum nl80211_dfs_regions for dfs_region everywhere

u8 was used in some other places, just stick to the enum,
this forces us to express the values that are expected.
Signed-off-by: default avatarLuis R. Rodriguez <mcgrof@do-not-panic.com>
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent f7d8ad81
...@@ -79,7 +79,7 @@ struct regulatory_request { ...@@ -79,7 +79,7 @@ struct regulatory_request {
enum nl80211_reg_initiator initiator; enum nl80211_reg_initiator initiator;
enum nl80211_user_reg_hint_type user_reg_hint_type; enum nl80211_user_reg_hint_type user_reg_hint_type;
char alpha2[2]; char alpha2[2];
u8 dfs_region; enum nl80211_dfs_regions dfs_region;
bool intersect; bool intersect;
bool processed; bool processed;
enum environment_cap country_ie_env; enum environment_cap country_ie_env;
...@@ -157,7 +157,7 @@ struct ieee80211_regdomain { ...@@ -157,7 +157,7 @@ struct ieee80211_regdomain {
struct rcu_head rcu_head; struct rcu_head rcu_head;
u32 n_reg_rules; u32 n_reg_rules;
char alpha2[2]; char alpha2[2];
u8 dfs_region; enum nl80211_dfs_regions dfs_region;
struct ieee80211_reg_rule reg_rules[]; struct ieee80211_reg_rule reg_rules[];
}; };
......
...@@ -5079,7 +5079,7 @@ static int nl80211_set_reg(struct sk_buff *skb, struct genl_info *info) ...@@ -5079,7 +5079,7 @@ static int nl80211_set_reg(struct sk_buff *skb, struct genl_info *info)
char *alpha2 = NULL; char *alpha2 = NULL;
int rem_reg_rules = 0, r = 0; int rem_reg_rules = 0, r = 0;
u32 num_rules = 0, rule_idx = 0, size_of_regd; u32 num_rules = 0, rule_idx = 0, size_of_regd;
u8 dfs_region = 0; enum nl80211_dfs_regions dfs_region = NL80211_DFS_UNSET;
struct ieee80211_regdomain *rd = NULL; struct ieee80211_regdomain *rd = NULL;
if (!info->attrs[NL80211_ATTR_REG_ALPHA2]) if (!info->attrs[NL80211_ATTR_REG_ALPHA2])
......
...@@ -2115,7 +2115,7 @@ static void print_rd_rules(const struct ieee80211_regdomain *rd) ...@@ -2115,7 +2115,7 @@ static void print_rd_rules(const struct ieee80211_regdomain *rd)
} }
} }
bool reg_supported_dfs_region(u8 dfs_region) bool reg_supported_dfs_region(enum nl80211_dfs_regions dfs_region)
{ {
switch (dfs_region) { switch (dfs_region) {
case NL80211_DFS_UNSET: case NL80211_DFS_UNSET:
...@@ -2130,7 +2130,7 @@ bool reg_supported_dfs_region(u8 dfs_region) ...@@ -2130,7 +2130,7 @@ bool reg_supported_dfs_region(u8 dfs_region)
} }
} }
static void print_dfs_region(u8 dfs_region) static void print_dfs_region(enum nl80211_dfs_regions dfs_region)
{ {
if (!dfs_region) if (!dfs_region)
return; return;
......
...@@ -20,7 +20,7 @@ extern const struct ieee80211_regdomain __rcu *cfg80211_regdomain; ...@@ -20,7 +20,7 @@ extern const struct ieee80211_regdomain __rcu *cfg80211_regdomain;
bool reg_is_valid_request(const char *alpha2); bool reg_is_valid_request(const char *alpha2);
bool is_world_regdom(const char *alpha2); bool is_world_regdom(const char *alpha2);
bool reg_supported_dfs_region(u8 dfs_region); bool reg_supported_dfs_region(enum nl80211_dfs_regions dfs_region);
int regulatory_hint_user(const char *alpha2, int regulatory_hint_user(const char *alpha2,
enum nl80211_user_reg_hint_type user_reg_hint_type); enum nl80211_user_reg_hint_type user_reg_hint_type);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment