Commit 63ed948a authored by Diego 'Flameeyes' Pettenò's avatar Diego 'Flameeyes' Pettenò Committed by Luis R. Rodriguez

Move is_valid_reg_rule() in intersect.c.

The function is only ever used in that translation unit so it makes no
sense to define it for all the binaries.
Signed-off-by: 's avatarDiego E. 'Flameeyes' Pettenò <flameeyes@gmail.com>
Signed-off-by: 's avatarLuis R. Rodriguez <lrodriguez@atheros.com>
parent 58cba45b
......@@ -19,6 +19,26 @@
} \
} while (0)
/* Sanity check on a regulatory rule */
static int is_valid_reg_rule(const struct ieee80211_reg_rule *rule)
{
const struct ieee80211_freq_range *freq_range = &rule->freq_range;
__u32 freq_diff;
if (freq_range->start_freq_khz == 0 || freq_range->end_freq_khz == 0)
return 0;
if (freq_range->start_freq_khz > freq_range->end_freq_khz)
return 0;
freq_diff = freq_range->end_freq_khz - freq_range->start_freq_khz;
if (freq_diff == 0 || freq_range->max_bandwidth_khz > freq_diff)
return 0;
return 1;
}
/* Helper for regdom_intersect(), this does the real
* mathematical intersection fun */
static int reg_rules_intersect(
......
......@@ -195,26 +195,6 @@ struct ieee80211_regdomain *country2rd(__u8 *db, int dblen,
return rd;
}
/* Sanity check on a regulatory rule */
int is_valid_reg_rule(const struct ieee80211_reg_rule *rule)
{
const struct ieee80211_freq_range *freq_range = &rule->freq_range;
__u32 freq_diff;
if (freq_range->start_freq_khz == 0 || freq_range->end_freq_khz == 0)
return 0;
if (freq_range->start_freq_khz > freq_range->end_freq_khz)
return 0;
freq_diff = freq_range->end_freq_khz - freq_range->start_freq_khz;
if (freq_diff == 0 || freq_range->max_bandwidth_khz > freq_diff)
return 0;
return 1;
}
static void print_reg_rule(struct ieee80211_reg_rule *rule)
{
struct ieee80211_freq_range *freq;
......
......@@ -92,7 +92,6 @@ struct ieee80211_regdomain *country2rd(__u8 *db, int dblen,
struct regdb_file_reg_country *country);
/* reg helpers */
int is_valid_reg_rule(const struct ieee80211_reg_rule *rule);
void print_regdom(struct ieee80211_regdomain *rd);
#endif
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