Commit 7c694524 authored by Luis R. Rodriguez's avatar Luis R. Rodriguez

crda: rename crda_get_file_ptr() to reglib_get_file_ptr()

Signed-off-by: 's avatarLuis R. Rodriguez <mcgrof@do-not-panic.com>
parent ebe619ac
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
#include "keys-gcrypt.c" #include "keys-gcrypt.c"
#endif #endif
void *crda_get_file_ptr(uint8_t *db, int dblen, int structlen, uint32_t ptr) void *reglib_get_file_ptr(uint8_t *db, int dblen, int structlen, uint32_t ptr)
{ {
uint32_t p = ntohl(ptr); uint32_t p = ntohl(ptr);
...@@ -196,9 +196,9 @@ static void reg_rule2rd(uint8_t *db, int dblen, ...@@ -196,9 +196,9 @@ static void reg_rule2rd(uint8_t *db, int dblen,
struct ieee80211_freq_range *rd_freq_range = &rd_reg_rule->freq_range; struct ieee80211_freq_range *rd_freq_range = &rd_reg_rule->freq_range;
struct ieee80211_power_rule *rd_power_rule = &rd_reg_rule->power_rule; struct ieee80211_power_rule *rd_power_rule = &rd_reg_rule->power_rule;
rule = crda_get_file_ptr(db, dblen, sizeof(*rule), ruleptr); rule = reglib_get_file_ptr(db, dblen, sizeof(*rule), ruleptr);
freq = crda_get_file_ptr(db, dblen, sizeof(*freq), rule->freq_range_ptr); freq = reglib_get_file_ptr(db, dblen, sizeof(*freq), rule->freq_range_ptr);
power = crda_get_file_ptr(db, dblen, sizeof(*power), rule->power_rule_ptr); power = reglib_get_file_ptr(db, dblen, sizeof(*power), rule->power_rule_ptr);
rd_freq_range->start_freq_khz = ntohl(freq->start_freq); rd_freq_range->start_freq_khz = ntohl(freq->start_freq);
rd_freq_range->end_freq_khz = ntohl(freq->end_freq); rd_freq_range->end_freq_khz = ntohl(freq->end_freq);
...@@ -219,11 +219,11 @@ country2rd(uint8_t *db, int dblen, ...@@ -219,11 +219,11 @@ country2rd(uint8_t *db, int dblen,
struct ieee80211_regdomain *rd; struct ieee80211_regdomain *rd;
int i, num_rules, size_of_rd; int i, num_rules, size_of_rd;
rcoll = crda_get_file_ptr(db, dblen, sizeof(*rcoll), rcoll = reglib_get_file_ptr(db, dblen, sizeof(*rcoll),
country->reg_collection_ptr); country->reg_collection_ptr);
num_rules = ntohl(rcoll->reg_rule_num); num_rules = ntohl(rcoll->reg_rule_num);
/* re-get pointer with sanity checking for num_rules */ /* re-get pointer with sanity checking for num_rules */
rcoll = crda_get_file_ptr(db, dblen, rcoll = reglib_get_file_ptr(db, dblen,
sizeof(*rcoll) + num_rules * sizeof(uint32_t), sizeof(*rcoll) + num_rules * sizeof(uint32_t),
country->reg_collection_ptr); country->reg_collection_ptr);
...@@ -279,7 +279,7 @@ reglib_get_rd_idx(unsigned int idx, const char *file) ...@@ -279,7 +279,7 @@ reglib_get_rd_idx(unsigned int idx, const char *file)
return NULL; return NULL;
} }
header = crda_get_file_ptr(db, dblen, sizeof(*header), 0); header = reglib_get_file_ptr(db, dblen, sizeof(*header), 0);
if (ntohl(header->magic) != REGDB_MAGIC) if (ntohl(header->magic) != REGDB_MAGIC)
goto out; goto out;
...@@ -299,7 +299,7 @@ reglib_get_rd_idx(unsigned int idx, const char *file) ...@@ -299,7 +299,7 @@ reglib_get_rd_idx(unsigned int idx, const char *file)
goto out; goto out;
num_countries = ntohl(header->reg_country_num); num_countries = ntohl(header->reg_country_num);
countries = crda_get_file_ptr(db, dblen, countries = reglib_get_file_ptr(db, dblen,
sizeof(struct regdb_file_reg_country) * num_countries, sizeof(struct regdb_file_reg_country) * num_countries,
header->reg_country_ptr); header->reg_country_ptr);
...@@ -350,7 +350,7 @@ reglib_get_rd_alpha2(const char *alpha2, const char *file) ...@@ -350,7 +350,7 @@ reglib_get_rd_alpha2(const char *alpha2, const char *file)
return NULL; return NULL;
} }
header = crda_get_file_ptr(db, dblen, sizeof(*header), 0); header = reglib_get_file_ptr(db, dblen, sizeof(*header), 0);
if (ntohl(header->magic) != REGDB_MAGIC) if (ntohl(header->magic) != REGDB_MAGIC)
goto out; goto out;
...@@ -370,7 +370,7 @@ reglib_get_rd_alpha2(const char *alpha2, const char *file) ...@@ -370,7 +370,7 @@ reglib_get_rd_alpha2(const char *alpha2, const char *file)
goto out; goto out;
num_countries = ntohl(header->reg_country_num); num_countries = ntohl(header->reg_country_num);
countries = crda_get_file_ptr(db, dblen, countries = reglib_get_file_ptr(db, dblen,
sizeof(struct regdb_file_reg_country) * num_countries, sizeof(struct regdb_file_reg_country) * num_countries,
header->reg_country_ptr); header->reg_country_ptr);
......
...@@ -70,7 +70,7 @@ static inline uint32_t min(uint32_t a, uint32_t b) ...@@ -70,7 +70,7 @@ static inline uint32_t min(uint32_t a, uint32_t b)
return (a > b) ? b : a; return (a > b) ? b : a;
} }
void *crda_get_file_ptr(uint8_t *db, int dblen, int structlen, uint32_t ptr); void *reglib_get_file_ptr(uint8_t *db, int dblen, int structlen, uint32_t ptr);
int crda_verify_db_signature(uint8_t *db, int dblen, int siglen); int crda_verify_db_signature(uint8_t *db, int dblen, int siglen);
const struct ieee80211_regdomain * const struct ieee80211_regdomain *
......
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