diff options
author | Luis R. Rodriguez <mcgrof@do-not-panic.com> | 2013-05-30 17:41:18 -0700 |
---|---|---|
committer | Luis R. Rodriguez <mcgrof@do-not-panic.com> | 2013-05-30 18:56:16 -0700 |
commit | 1c2fb479285d532dcc96f5f64d2a03b73a8f768e (patch) | |
tree | 5a2cf1095ca5948ebd2ec4c068a8f6556cb9e4a7 | |
parent | ad2f359b796c59f14c692ef2445ebf2d4d757178 (diff) | |
download | crda-1c2fb479285d532dcc96f5f64d2a03b73a8f768e.tar.gz |
crda: pass struct reglib_regdb_ctx to country2rd()
This consolidates the number of arguments.
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
-rw-r--r-- | reglib.c | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -298,18 +298,18 @@ static void reg_rule2rd(uint8_t *db, int dblen, /* Converts a file regdomain to ieee80211_regdomain, easier to manage */ const static struct ieee80211_regdomain * -country2rd(uint8_t *db, int dblen, +country2rd(const struct reglib_regdb_ctx *ctx, struct regdb_file_reg_country *country) { struct regdb_file_reg_rules_collection *rcoll; struct ieee80211_regdomain *rd; int i, num_rules, size_of_rd; - rcoll = reglib_get_file_ptr(db, dblen, sizeof(*rcoll), - country->reg_collection_ptr); + rcoll = reglib_get_file_ptr(ctx->db, ctx->dblen, sizeof(*rcoll), + country->reg_collection_ptr); num_rules = ntohl(rcoll->reg_rule_num); /* re-get pointer with sanity checking for num_rules */ - rcoll = reglib_get_file_ptr(db, dblen, + rcoll = reglib_get_file_ptr(ctx->db, ctx->dblen, sizeof(*rcoll) + num_rules * sizeof(uint32_t), country->reg_collection_ptr); @@ -328,7 +328,7 @@ country2rd(uint8_t *db, int dblen, rd->n_reg_rules = num_rules; for (i = 0; i < num_rules; i++) { - reg_rule2rd(db, dblen, rcoll->reg_rule_ptrs[i], + reg_rule2rd(ctx->db, ctx->dblen, rcoll->reg_rule_ptrs[i], &rd->reg_rules[i]); } @@ -351,7 +351,7 @@ reglib_get_rd_idx(unsigned int idx, const char *file) country = ctx->countries + idx; - rd = country2rd(ctx->db, ctx->dblen, country); + rd = country2rd(ctx, country); if (!rd) goto out; @@ -384,7 +384,7 @@ reglib_get_rd_alpha2(const char *alpha2, const char *file) if (!found_country) goto out; - rd = country2rd(ctx->db, ctx->dblen, country); + rd = country2rd(ctx, country); if (!rd) goto out; |